Successfully reported this slideshow.
Upcoming SlideShare
×

Theory of Computation - Lectures 4 and 5

725 views

Published on

TOC lectures 4 and 5:
Formal definition of computation, regular languages, regular expressions, Designing Finite Automata, Regular operations

Published in: Education, Technology
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Theory of Computation - Lectures 4 and 5

1. 1. Formal Definition of Computation Let M = (Q, ∑ , δ, q0, F) be a finite automaton and let w = w1w2.....wn be a string where each wi is a member of the alphabet ∑. Then M accepts w if a sequence of states r0, r1, ….,rn In Q exists with three conditions: 1- r0= q0, 2- δ(ri, wi+1)=ri+1, for i=0,...,n-1, and 3- rn∈ F
2. 2. Cont.    Condition 1 says that the machine starts in the start state. Condition 2 says that the machine goes from state to another according to the transition function Condition 3 says that the machine accepts its input if it ends up in an accept state. We say that M recognizes language A if A = {w | M accepts w}
3. 3. Regular Language  Definition: A language is called a regular language if some finite automaton recognizes it. See example 1.17 p. 41
4. 4. Designing Finite Automata    Just like artwork, design is a creative process... Suppose you are given some language, and you want to design a FA that recognizes it...pretend that you are the machine! Take symbols, one by one, and and after each symbol, you should decide whether the string so far is in the language or not.
5. 5. Designing Finite Automata –Cont.   What if the string is from earth to moon long? And your memory (as a FA) is like a sheet of paper? Worry-less, you will have to memorize the crucial info only, like: “What's my status now?” Example: suppose: alphabet = {0,1}, and that the language consists of all strings with an odd number of 1s. You want to construct a FA E1 to recognize this language
6. 6. Designing Finite Automata –Cont. By pretending that you're the FA, get the symbols (1 by 1), do you need to remember all the string? No! Just remembering the number of 1s so far is even or not is enough, so that if next is 0, don't change, if 1, change!  Therefore, you have 2 states, say: q odd, qeven.
7. 7. Designing Finite Automata –Cont.   Next, assign transitions. Assign a start state (qeven) in our example, since no symbol has been entered so far (0) and 0 is even.  What about Final state (accept)?  See example 1.21 - P.43
8. 8. Regular Operations  We use them to study properties of regular languages, those properties will help us develop a toolbox that will include ways of proving certain other languages are nonregular (i.e. beyond the capability of FA)
9. 9. Regular Operations  If A and B are languages, then:  Union: A∪B = {x|x ∈ A or x ∈ B}    Concatenation: A ○ B = {xy | x ∈ A and y ∈ B} Star: A* = {x1x2....xk | k>=0 and each xi∈A} The star operation is unary operation (on 1 language) while the union and conc. are binary operations