Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS154 Formal Languages and Computability Thaddeus Aid Department of Computer Science San Jose State University Spring 2016 Creative Commons Attribution-ShareAlike.

Similar presentations


Presentation on theme: "CS154 Formal Languages and Computability Thaddeus Aid Department of Computer Science San Jose State University Spring 2016 Creative Commons Attribution-ShareAlike."— Presentation transcript:

1 CS154 Formal Languages and Computability Thaddeus Aid Department of Computer Science San Jose State University Spring 2016 Creative Commons Attribution-ShareAlike 4.0 International License 1

2 Citation Lecture developed in conjunction with: Introduction to Theory of Computation Anil Maheshwari Michiel Smid http://cglab.ca/~michiel/TheoryOfComputation/TheoryOfComputation.pdf Creative Commons Attribution-ShareAlike 4.0 International License 2

3 A Quick Political Aside I have already mentioned that the point of computer science is to fix problems and change the world. Technology and education are highly impacted by politics Science is highly impacted by politics Voter turnout in 2012 – 56% Voter turnout in 2014 – 36% This means that if you show up your voice is worth 2-3x what it should be Your tuition fees, etc depend on the outcome of the election Young voters out number old voters Get registered and vote!!!! http://www.rockthevote.com Creative Commons Attribution-ShareAlike 4.0 International License 3

4 Adds – Good News Professor Khuri (Chair of CS) has approved increasing class size This may mean moving class rooms See me during break for add code Creative Commons Attribution-ShareAlike 4.0 International License 4

5 TotalBoox.com The MLK library offers San Jose City Library card to all students Take in proof of address to obtain card The San Jose City Library system offers card holders TotalBoox.com memberships TotalBoox.com gives free access to a LARGE number of technical ebooks (as well as normal library books) Please make time to sign up, I will be using these books for reading material. http://www.totalboox.com/ Creative Commons Attribution-ShareAlike 4.0 International License 5

6 Complexity Theory “What makes some problems computationally hard and other problems easy?” What do we mean by “hard” and “easy”? Easy: efficiently solvable Hard: not efficiently solvable Examples? Central Question in Complexity Theory: Classify problems according to their degree of “difficulty”. Give a rigorous proof that problems that seem to be “hard” are really “hard”. Creative Commons Attribution-ShareAlike 4.0 International License 6

7 Defining a Problem A problem is an abstract of a question A Problem Instance is a particular case of a problem A problem is “is X number prime?” the instance would be “is 15 prime?” A Problem Instance is represented by a “String” formed from an “Alphabet” The “String” is the question in symbolic form The “Alphabet” defines the symbols used in the Question Creative Commons Attribution-ShareAlike 4.0 International License 7

8 Decision Problems A subset of Problems where the answer is yes or no. May be represented as True/False or 1/0 Is distinct from where the answer is yes/not-yes/no This is a problem with ambiguous language and high lights the need for formal language A formal language does not allow for ambiguous responses This may require that the question be restructured Does 10 + 5 == 15? Do you like candidate X? Creative Commons Attribution-ShareAlike 4.0 International License 8

9 Functions More complex than Decision Problems Map 1 input to 1 output 10 + 5 always equals 15 Output may or may not be unique depending on the Problem Creative Commons Attribution-ShareAlike 4.0 International License 9

10 Complexity Theory - Corollary What do we do after defining difficulty? Make problems easier. Dynamic Programming Algorithms Divide and Conquer Branch and Bound Etc. Creative Commons Attribution-ShareAlike 4.0 International License 10

11 What is an Algorithm? An algorithm is a self contained, step-by-step process, to go from input to output. Named for Al-Khwārizmī (Persian: خوارزمي ‎‎, c. 780-850) was a Persian mathematician, astronomer, geographer, and scholar.Al-KhwārizmīPersian astronomergeographer Creative Commons Attribution-ShareAlike 4.0 International License 11

12 The Importance of Naming https://www.youtube.com/watch?v=fDAT98eEN5Q Creative Commons Attribution-ShareAlike 4.0 International License 12

13 An Algorithm is: Efficient – minimum number of steps and effort Finite – It must have a well defined beginning and end Well Defined – No Ambiguity!!! Correct!!! An Algorithm: Starts at a defined “position” Moves through a finite series of steps Produces an output Creative Commons Attribution-ShareAlike 4.0 International License 13

14 Computation Theory What is Computable? Gödel, Church, and Turing discovered that not all Problems are computable. Central Question in Computability Theory: Classify problems as being solvable or unsolvable. Creative Commons Attribution-ShareAlike 4.0 International License 14

15 Back to Decision Problems Beyond how hard are Decision Problems to solve Are they actually solvable? Some are not Same with functions Classify how unsolvable they are Creative Commons Attribution-ShareAlike 4.0 International License 15

16 Introducing the Church-Turing Thesis In a Nutshell If an algorithm exists to solve a problem That problem is computable A good starting point to learn about unsolvable problems: https://en.wikipedia.org/wiki/List_of_undecidable_problems Remember Wikipedia is a good place to start research, but don’t cite it, go to the original source and make sure you understand the original source. Wikipedia is FANTASTIC for putting you on the right track. What Problems share algorithms? Creative Commons Attribution-ShareAlike 4.0 International License 16

17 Automata Theory Roughly “Automata” means “Self-Acting” The study of abstract “machines” Often thought experiments that lead to the creation of “real” machines Creative Commons Attribution-ShareAlike 4.0 International License 17

18 Finite State Machines An abstract model of a machine that changes “state” on input. Visualized as states drawn as circles and transitions drawn as arrows. Creative Commons Attribution-ShareAlike 4.0 International License 18

19 Context Free Grammars A finite set of symbols and rules The rules determine which order the symbols may be arranged The symbols determine the type of terminal they can be replaced by Combining rules produces sentences This can be applied in reverse to determine if a sentence is grammatically correct. Used to define languages and in AI programming Creative Commons Attribution-ShareAlike 4.0 International License 19

20 Turing Machines An abstract machine Manipulates symbols on a tape Subject to rules Can be implemented to solve any algorithm Turing Complete: The ability to create any Turing Machine Hence, the ability to solve any computable problem Creative Commons Attribution-ShareAlike 4.0 International License 20

21 Mathematics Review Pre-requisites: Math 19 – Pre-calculus Math 42 – Discrete Mathematics Creative Commons Attribution-ShareAlike 4.0 International License 21

22 Sets A well defined collection of objects. Each object is unique Sets are unordered A = {1, 2, 3} B = {a, c, e} Creative Commons Attribution-ShareAlike 4.0 International License 22

23 Common Sets Natural Numbers: Integers: Rational Numbers : Real Numbers: Note: for those that know LaTeX and want to use PowerPoint Google “IguanaTeX” Creative Commons Attribution-ShareAlike 4.0 International License 23

24 Interactions Union: Intersect: Difference: Cartesian Product: Complement: Binary Relation: Creative Commons Attribution-ShareAlike 4.0 International License 24

25 Functions Function notation: Creative Commons Attribution-ShareAlike 4.0 International License 25

26 Relationships A = {All Inputs} B = {All Outputs} Injective (one to one): Surjective (onto): Bijective: Function f is bijective if it is both injective and surjective Creative Commons Attribution-ShareAlike 4.0 International License 26

27 Relationships For some set A, for binary relationships R(a,a) Reflexive: Symmetric: Transitive: Equivalent if Reflexive + Symmetric + Transitive Creative Commons Attribution-ShareAlike 4.0 International License 27

28 Graphs Graph G = (V, E) V is a set of Vertices E is a distinct set of paired Vertices Degree of a vertix: deg(v) is the number of edges connected to it Creative Commons Attribution-ShareAlike 4.0 International License 28

29 Strings Alphabet: a finite set of symbols A string is a finite collection of symbols where the symbols are members of the alphabet. The length of the string |w| is the number of symbols in the string The empty string ε has a length 0 A language is a set of strings Creative Commons Attribution-ShareAlike 4.0 International License 29

30 Boolean Values Creative Commons Attribution-ShareAlike 4.0 International License 30

31 Break! 15 Minute Break Adds come talk to me! Creative Commons Attribution-ShareAlike 4.0 International License 31


Download ppt "CS154 Formal Languages and Computability Thaddeus Aid Department of Computer Science San Jose State University Spring 2016 Creative Commons Attribution-ShareAlike."

Similar presentations


Ads by Google