Welcome to CS5 and Happy and fruitful ew Year שנה טובה (Happy ew Year) Meeting Times Lectures: Tue Thu 3:3p -4:5p WLH ote: Thu Oct 9 Lecture is canceled there may be a make-up lecture by quarter s end. Sections: Mon :p -:5p WLH 9 Scott Tue 3:p -3:5p WLH 9 Amos ote: Students should come to both sections. Mid-term: Thu Oct 3 3:3p WLH Final: Tue Dec 9 :3a -:p TBA 3 Staff Instructor: Amos Israeli room -6. Office Hours: Fri - or by arrangement Tel#: 534-886 e-mail: aisraeli at cs.ucsd.edu TA: Scott Yilek room B-4a Office Hours: Mon 4-5:3 e-mail: syilek at cs.ucsd.edu Web Page: http://www.cse.ucsd.edu/classes/fa8/cse5 Homework There will be 5-6 assignments. Assignments will be given on Monday s section and must be returned by the Thu lecture one week later. First assignment will be given next Monday and must be returned on Wed Oct 8 or in Scott s mailbox on Thu Oct 9 th. 4
Academic Integrity You are encouraged to discuss the assignments problems among yourselves. Each student must hand in her/his own solution. You must Adhere to all rules of Academic Integrity of CS Dept. UCSD and others. (Meaning: no cheating or copying from any source) 5 Grading A: (85-) B: (7-84) C: (55-69) D: (4-54) F: (-39) 7 Grading Assignments: % Midterm: 3% -% (students are allowed to drop it) open book open notes. Final: 5% -8% open book open notes. 6 Bibliography Required: Michael Sipser: Introduction to the Theory of Computation Second Edition Thomson. 8
Introduction to Computability Theory Lecture: Finite Automata and Regular Languages Prof. Amos Israeli (פרופ' עמוס ישראלי) 9 Introduction Computability Theory deals with the profound mathematical basis for Computer Science yet it has some interesting practical ramifications that I will try to point out sometimes. The question we will try to answer in this course is: What can be computed? What Cannot be computed and where is the line between the two? Introduction Computer Science stems from two starting points: Mathematics: What can be computed? And what cannot be computed? Electrical Engineering:How can we build computers? ot in this course. Computational Models A Computational Model is a mathematical object (Defined on paper) that enables us to reason about computation and to study the properties and limitations of computing. We will deal with Three principal computational models in increasing order of Computational Power.
Computational Models We will deal with three principal models of computations:. Finite Automaton (in short FA). recognizes Regular Languages.. Stack Automaton. recognizes Context Free Languages. 3. Turing Machines (in short TM). recognizes Computable Languages. 3 Finite Automata - A Short Example The control of a washing machine is a very simple example of a finite automaton. The most simple washing machine accepts quarters and operation does not start until at least 3 quarters were inserted. Alan Turing -A Short Detour Dr. Alan Turing is one of the founders of Computer Science (he was an English Mathematician). Important facts:. Invented Turing machines.. Invented the Turing Test. 3. Broke the German submarine transmission coding machine Enigma. 4. Was arraigned for being gay and committed suicide soon after. 4 Thanks: Vadim Lyubasehvsky ow on PostDoc in Tel-Aviv
Finite Automata - A Short Example The control of a washing machine is a very simple example of a finite automaton. The most simple washing machine accepts quarters and operation does not start until at least 3 quarters were inserted. The second washing machine accepts 5 cents coins as well. Finite Automata - A Short Example The control of a washing machine is a very simple example of a finite automaton. The most simple washing machine accepts quarters and operation does not start until at least 3 quarters were inserted. The second washing machine accepts 5 cents coins as well. The most complex washing machine accepts $ coins too.
Finite Automaton -An Example q s q q States: Q = { q q q s Initial State: s Final State: q q } Finite Automaton Formal Definition ( F ) A finite automaton is a 5-tupple Q Σδ q where:. Q is a finite set called the states.. Σ is a finite set called the alphabet. 3. δ : Q Σ Q is the transition function. 4. q Q is the start state and 5. F Q is the set of accept states. 3 Finite Automaton An Example q s q q Transition Function: δ ( q s ) = q δ ( q s ) = q δ ( q ) =δ ( q ) = q δ ( q ) =δ ( q ) = q Alphabet: { }. ote: Each state has all transitions. Accepted words:... Observations. Each state has a single transition for each symbol in the alphabet.. Every FA has a computation for every finite string over the alphabet. 4
Examples. accepts all words (strings) ending with. M The language recognized by called L ( ) M M ( ) { } satisfies: L M ends with. = w w 5 The automaton Correctness Argument: The FA s states encode the last input bit and q is the only accepting state. The transition function preserves the states encoding. How to do it. Find some simple examples (short accepted and rejected words). Think what should each state remember (represent). 3. Draw the states with a proper name. 4. Draw transitions that preserve the states memory. 5. Validate or correct. 6. Write a correctness argument. Examples. accepts all words (strings) ending with. M ( ) { ends with } L M = w w. accepts all words ending with. M 3. accepts all words ending with and M 4 ε the empty word. This is the Complement Automaton of.. M 8
Examples M. accepts all words (strings) ending with. ( ) { ends with } L M = w w.. accepts all words ending with. M 3 M { ab } 3. accepts all strings over alphabet 4 that start and end with the samesymbol. 9 Languages Definition:A language is a set of strings over some alphabet. Examples: L = L L 3 { } m n { n are positive integers } = m = bit strings whose binary value is a multiple of 4 3 Examples (cont) n m M 5 4. accepts all words of the form mn m n > where are integers and. 5. accepts all words in. M 6 { } 3 Languages A language of an FA M L M is the set of M ( ) words (strings) that M accepts. ( M ) If we say that recognizes. La = L M La If La is recognized by some finite A La automaton is a Regular Language. 3
Some Questions Q: How do you prove that a language La is regular? M ( ) A: By presenting an FA satisfying La= L M. Q: How do you prove that a language La is not regular? A: Hard! to be answered on Week3 of the course. Q3: Why is it important? A3: Recognition of a regular language requires a controller with bounded Memory. 33 The Regular Operations given a language one can verify it is regular by presenting an FA that accept the language. Regular Operations give us a systematic way of constructing languages that are apriority regular. (That is: o verification is required). 35 The Regular Operations Let A and B be regular languages above the same alphabet. We define the 3 Regular Operations: Σ { } { } { x x x k and x A } Union: A B = x x A or x B. Concatenation: A o B = xy x A and y B. * Star: A =.... k k 34 The Regular Operations - Examples A = { good bad } A o B = goodgirl goodboy badgirl. B = { girl boy } { good bad girl boy } { badboy } A B = * ε good bad goodgood goodbad A =. goodgoodgoodbad badbadgood bad... 36
Theorem The class of Regular languages above the same alphabet is closedunder the union operation. Meaning: The union of two regular languages is Regular.. 37 Proof idea If A and A are regular each has its own recognizing automaton and respectively. In order to prove that the language A A is regular we have to construct an FA that accepts exactly the words in A A. ote:cannot apply followed by. 39 Example { } { } Consider L starts with and = w w L = w ends with. w The union set is the set of all bit strings that either start with or end with. Each of these sets can be recognized by an FA with 3 states. Can you construct an FA that recognizes the union set? Proof idea We construct an FA that simulates the computations of and simultaneously. Each state of the simulating FA represents a pair of states of and of respectively. Can you define the transition function and the final state(s) of the simulating FA? 4
Wrap up In this talk we:. Motivated the course.. Defined Finite Automata (Latin Pl. form of automaton). 3. Learned how to deal with construction of automata and how to come up with a correctness argument. A 4