Finite Automata. Warren McCulloch ( ) and Walter Pitts ( )

Size: px
Start display at page:

Download "Finite Automata. Warren McCulloch ( ) and Walter Pitts ( )"

Transcription

1 2 C H A P T E R Finite Automata Warren McCulloch ( ) and Walter Pitts ( ) Warren S. McCulloch was an American psychiatrist and neurophysiologist who co-founded Cybernetics. His greatest contributions to Computer Science include an early existence proof for universal computers (Turing Machines) and a model of Artificial Neural Networks that stands as a theory which explains how a biological brain could perform logical calculations and serves as the basis of Artificial Intelligence (AI). In order to study the structural properties of nervous activity, McCulloch moved to the Yale Medical School and finally in 94, he moved to Chicago to accept a position as Professor of Psychiatry and Physiology. There, McCulloch met two students, Jerome Lettvin and Walter Pitts ( ), who would become his closest colleagues, collaborators and friends. Lettwin was a young medical student interested in the use of mathematics in biology and electrical properties of brain. Pitts was a polymath who had never graduated from high school nor enrolled in college, but began studying logic at University of Chicago after running away from home at the age of 4, the 8-year-old Homeless Pitts began working with McCulloch on a theory of mind which would show how neurons in the brain could represent logical propositions. In their 943 paper, McCulloch and Pitts demonstrated that a suitably configured network of mathematically idealized neurons could represent any well-formed logical proposition and compute any function representable in their logical calculus. Moreover, any such network could simulate a memory if its outputs were fed back into its inputs. Thus, their neuron nets were a kind of universal computer. In search of simplest models to capture the finite state machines, McCulloch and Pittes were among the first researchers to introduce a concept similar to finite Automaton in 943.

2 Finite Automata 5 Any deterministic automaton can be shown pictorially by using a state-transition graph where the states are represented by the vertices and each edge from any q to q is labeled with a symbol, say a, which belongs to S if d(q, a) Æ q. A directed labeled arrow is drawn from q to q. One circle is drawn for each state, and the name of the state is written inside the circle. An arrow that does not start at a state, but points to the initial state or starting state tells that this state is the starting state (see Figure 2., q is starting state). All circles drawn for final states F are drawn double, i.e., concentric circles (q is final state in Figure 2.) b a a,b q a q b q 2 Figure 2. Another way of representing dfa is transition table. Table has one row for each state and one column for each symbol. Row labelled with start state is prefixed by arrow Æ, and row labelled with final state is prefixed by arrow for a state q ŒQ and symbol x ŒS, in the position of row q, and column x, the state d(q, x) is written. Transition table for Figure 2. is shown in Figure Language of DFA Figure 2.2 Language is a set of all the strings accepted by the automaton. Formally, the language accepted by dfa M = (Q, S, d, q, F) is the set of all strings on S accepted by M. L(M) = {w S* : d* (q, w) ŒF}. If dfa enters into a state and after reading any symbol it cannot escape from that state (unable to reach other state) then this particular state is called sink state or trap state. State q 2 in Figure 2. is an example of trap state.

3 6 Automata Theory, Language of Machines and Computability Basic Properties of DFA Automaton that we are discussing is deterministic, because in every state and for every value of the alphabet that is read, there is one and only one state in which automata can be. Missing transitions are not allowed in dfa. There must be transition on each symbol of S from each state of dfa. If there is no transition on symbol a from only state q then a new trap state is introduced in state transition graph such that d(q, a) Æ f t and label this new state as f t. Example 2.2 Give dfa that recongizes the string ab on S = {a, b} First we will make a start state Now the first symbol of string is a so, The second symbol of string is b Since string is completed, after reading b, dfa is in state q 2, hence q 2 must be the final state. This is our generalized result. We know that missing transitions are not allowed in dfa so we add a new trap state f because d(q, b), d(q, a) and d(q 2, a), d(q 2, b) are missing. This is the final dfa we need. It accepts only ab and rejects all other strings. It can be written formally as M = ({q, q, q 2, f t }, S = {a, b}, d, q, {q 2 }) d : d(q, a) Æ q, d(q, b) Æ f t d(q, a) Æ f t, d(q, b) Æ q 2 d(q 2, a) Æ d t, d(q 2, b) Æ f t d(f, a) Æ f t, d(f, b) Æ f t

4 Finite Automata 7 Example 2.3 Give dfa that recognizes string on S = {, } First we will draw a generalized dfa. Now we will complete all missing transitions. f t Example 2.4 Give dfa which accepts all strings starting from ab on S = {a, b} First we will construct dfa to fulfil the basic need, i.e., prefix ab. Now completing missing transitions Example 2.5 Give dfa which accepts strings with even number of s on S = {, } For even number of s now s can be anywhere in the string so

5 Finite Automata 9 Example 2. Give dfa which accepts all the strings which contain odd number of a s followed by string abbb on S = {a, b}. Here first we consider dfa which accepts odd number of as. Now string bbaa Now we will join these automatons. Now fulfilling all the missing transitions. Example 2. Give dfa for language L = {aw aaw 2 a : w, w 2 Œ{a, b}*} on S = {a, b}. Write its formal definition with transition table. First of all we will construct dfa for the given language: q a b a b a q q a 2 q 3 b q 4 a b b f t a, b Now let us give its formal description M = ({q, q, q 2, q 3, q 4, f}, S = {a, b}, d, q, {q 4 }) d : d(q, a) Æ q d(q, b) Æ f t

6 2 Automata Theory, Language of Machines and Computability d(q, a) Æ q 2 d(q, b) Æ q d(q 2, a) Æ q 3 d(q 2, b) Æ q d(q 3, a) Æ q 4 d(q 3, b) Æ q 3 d(q 4, a) Æ q 4 d(q 4, b) Æ q 3 d(f t, a) Æ f t d(f t, b) Æ f t Transition table is given as: States Input symbols a b q q f t q q 2 q q 2 q 3 q q 3 q 4 q 3 q 4 q 4 q 3 f t f t f t 2.3 NON-DETERMINISTIC FINITE ACCEPTORS OR NFA Digital computers are completely deterministic, it means their state at any time is uniquely predictable. So, why do we need nfa s. nfa provides multiple options and are useful in solving problems easily. Non-determinism simplifies formal arguments also. Now let us see the fomal definition of nfa s. A non-deterministic finite acceptor or nfa is defined by the quintuple where M = (Q, S, d, q, F), Q is a finite set of internal states S is a finite set of symbols called the input alphabet d : Q (S {Œ} Æ 2 Q is transition function q Œ Q is the initial state F Õ Q is a set of final states

7 22 Automata Theory, Language of Machines and Computability Example 2.3 Give dfa on S = {, } for all those strings whose leftmost symbol is different from the rightmost symbol. It means if the leftmost symbol is the rightmost symbol must be and vice versa. q, q 3 q q 2 q 4, Example 2.4 Give dfa on S = {, } for all those strings of length five or more in which the fourth symbol from the left end is different from the left most symbol. q, q, 3 q 5 q, 7 q 9, q q 2 q 4 q 6 q 8 q,,,,, ft Example 2.5 Give dfa on S = {x, y, z} for all strings where the starting symbol is x and the last symbol is z. x, y x q q z q 2 y, z x, y, z f t x, y, z A string is accepted by an nfa if there is some sequence of possible moves that will put the machine in a final state at the end of the string. A string is rejected only if there is no possible sequence of moves by which a final state can be reached. Non-determinism

8 Finite Automata 23 can therefore be viewed as involving intuitive insight by which the best move can be chosen at every state. The language accepted by an nfa can be defined as the language consists of all strings w for which there is a walk present from initial vertex of transition graph to final vertex. Let us assume an nfa is in state q and reads the next symbol, say a, for which there is no transition present d (q, a) = f. Note that here f is not any state it means NULL here, then this situation is called a dead configuration. In Figure 2.3 d(q, a), d(q, b), d(q 2, a), d(q 2, b), d(q 3, a), d(q 3, b) are dead configurations. Example 2.6 Construct an nfa that accepts strings aaa or bbb. First of all draw nfa for string aaa Now let us draw nfa for string bbb Now we will join these two nfas in order to get the final solution. Since, missing transitions are allowed in nfa so, our nfa is ready. Example 2.7 Construct an nfa with three states that accept language {ab, abc}*. q a q b q 2 c,œ Note that * means it may repeat or more times. Example 2.8 Find an nfa with four states for L = {a n : n } {b n a : n } First see a n : n it means it can accept or more a s, so its nfa can be Now see {b n a:n }. It means any number of b s can be there but atleast one b must be there followed by single a

9 Finite Automata 25 For every language accepted by some nfa there is a dfa that accepts the same language. Two finite acceptors M and M 2 are said to be equivalent if L(M ) = L(M 2 ) i.e., if they both accept the same language. Let us focus on equivalence of dfa and nfa. Let M N be a non-deterministic finite acceptor and M D be deterministic finite acceptor. L(M N ) be the language accepted by nfa M N. Then M D equivalent to M N if NFA to DFA Conversion L(M N ) = L(M D ) To convert any nfa to its equivalent dfa, we must follow these steps: Step. Draw the start state of M D, label it with a set of all states of M N that we can reach from the start state of M N by following zero or more epsilon (Œ)-transitions. Step 2. Pick a symbol a ŒS, any state of M D so that this state does not have a transition for a. Draw transition from the state we chose to new state and label edge as a. The label of this new state is a set which includes every state that we can get to in M N by following exactly one transition labelled by a, and zero or more transitions a labelled by epsilon (Œ), starting from any state in M N that is subset labelling the state of M D we are starting from. Step 3. Repeat step 2 untill no more edges are missing Step 4. Each state in M D is an accept state iff it contains any state in its set which is a final state of M N. Step 5. If M N accepts Œ, start vertex of M D is also made a final vertex. For better understanding of this algorithm (conversion of nfa to its equivalent dfa) see Examples 2.2 to Example 2.2 Convert the given ndfa to its equivalent dfa. First of all draw the start state of our dfa including the start state of nfa and all the states we can reach from q by zero or more Œ-transitions as a set

10 26 Automata Theory, Language of Machines and Computability Now choosing this state and a symbol from S and making the next state to which it can reach by taking symbol as input. This new state is labeled by a set of states which is reached by the symbol and states which can be reached from that state by zero or more transitions of Œ. Now considering next symbol and same state {q, q } and repeating above process. In state {q, q } neither q is having a b transition nor q is having any transition for symbol b so we introduce a trap by state f t because missing transitions are not allowed in dfa. We have completed transitions for S for state {q, q }. Now choosing the next state {q 2, q 3 } and symbol a from S. Now considering input symbol b for state {q 2, q 3 }.

11 28 Automata Theory, Language of Machines and Computability Now input symbol b for state {q 2, q } Since {q 2 } is already present. We have completed all of our states except state {q 2 }. Now let us choose state {q 2 } and input symbol a. Now taking input symbol b for state {q 2 } We have completed our dfa. Now mark the final states of dfa. All the states of dfa are final states if they are labeled by a set which contains a state which is a final state of given nfa.

12 Finite Automata 29 Final states of NFA = q 2 So, final states of DFA are {q 2, q 3 }, {q 2, q }, {q 2 }, {q 2, q 4, q 5, q 6 } This is final dfa, equivalent to given nfa. Example 2.2 Convert the given nfa to its equivalent dfa. First of all we will find the start state of our dfa Now we will find transitions for input symbol on state {q } Now considering input symbol for state {q }.

13 Finite Automata 3 Here, a new state {q, q 3, q 2 } is introduced. { q } { q, q 2 }, { q, q 4 } { q, q3, q2} { q 3 }, f, t For symbol State {q 3 } is already present in DFA. { q } { q, q 2 }, { q, q 4 } { q, q3, q2} { q 3 }, f, t We have completed all state transitions except state {q, q 3, q 2 }. Now let us find its transitions. State {q, q 3, q 2 } for input symbol {q, q 4 } is already present in our dfa, so no need to create new state. { q } { q, q 2 }, { q, q } 4 { q, q3, q2} { q 3 } f t,,

14 32 Automata Theory, Language of Machines and Computability For input symbol q q 4 ΠΠq 3 q 2 q 4 q q { q } { q, q 2 }, { q, q } 4 { q, q3, q2}, { q 3 } f t,, Now, find all the final states of our dfa. Final state(s) of our nfa is q 4, so all those states of dfa which contain q 4 are final states of dfa. { q } { q, q 2 }, { q, q } 4 { q, q3, q2}, { q 3 } f t,, Example 2.22 Find equivalent dfa for given nfa. q q 2 q 3 ΠΠΠq 4 q 5 q 6 Equivalent dfa: { q, q 4 } { q 2, q 4 }, f t { q 3, q 5 } { q 3 } { q 2, q, q, q, q }

15 34 Automata Theory, Language of Machines and Computability To make it clear we introduce a new column with name final state. If the state is the final state we mark it with a yes tag else a no tag. Æ {q } {q, q } {q, q 2 } {q, q, q 3 {q, q 2, q 3 } Final state {q, q } {q, q, q 3 } {q, q } {q, q, q 3 } {q, q, q 3 } {q, q 2 } {q, q 2 } {q, q 2, q 3 } q, q 2, q 3 } q, q 2, q 3 } No No No Yes Yes This is transition table of our equivalent dfa. Now let us draw its state transition diagram, as follows: Equivalent dfa for the given nfa is: Example 2.24 Convert the given non-deterministic automata to its equivalent deterministic state transition graph. Equivalent dfa

16 Finite Automata EQUIVALENT OF NFA WITH Œ-TRANSITIONS AND NFA WITHOUT Œ-TRANSITIONS We can convert any nfa (with Œ-transitions) to its equivalent nfa that have no Œ-transitions. Note that nfa without Œ-transitions may or may not dfa because it may hold other properties of nfa like missing transitions and multiple transitions. It is a simple method. It says that we can remove Œ-transitions from some state q by copying the transitions from each successor state which can be reached from q by Œ-transition. Let us understand this concept in a more simpler way, suppose there is a state q and it has an epsilon transition to a state q s, then for a while think q is q s, edges (transitions) which are associated to q s also add them to q. Just like they are connected to q s and remove Œ-edge between q and q s. For more abstraction of concept see Examples 2.25 and Example 2.25 Find equivalent nfa for the given nfa without Œ-transitions. First of all consider Œ-transition between q and q. Now think as if q is q and find all transitions of q d(q, a) Æ q 2 d(q, b) Æ q 3 Now add these edges (transitions) to q and remove Œ-labeled edge between q and q d(q, a) Æ q 2 d(q, b) Æ q 3 We successfully eliminated Œ-transition between q and q. Now let us now consider Œ-transition between q 2 and q 4

17 Finite Automata 37 Example 2.26 Remove Œ-transitions from the given nfa. First of all consider Œ-transition between q and q 2. Find all the transitions of q 2 : d(q 2, b) Æ q 3 Copy transitions of q 2 to q and remove Œ-link between q and q 2. d(q, b) Æ q 3 Now, consider Œ-transition between states q and q 4. Find all transitons of q 4 : d(q, a) Æ q 3 d(q, b) Æ q 4 q a q b q 4 b a a a b q 2 b q 3 This nfa is without Œ-transitions. 2.6 REMOVING Œ-CYCLES FROM NFA Œ-cycle means when we start from any state and get back to the same state after successive Œ-transitions (without taking any input). See example 2.27 q, q 2, q 3, q 4 form an Œ-cycle. If we want to remove Œ-cycle then replace the states forming Œ-cycle by a new state say q new. If any of the states removed was the first or say the start state then make q new the start state and same is the case of final states. Any transition which was in/out of removed states will be now in/out in new state q new.

18 38 Automata Theory, Language of Machines and Computability Example 2.27 Remove Œ-cycle from given nfa. Removing Œ-cycles. 2.7 MINIMIZATION OF DFA For a given language, there are many dfa s that accept it, and they have distinct number of states in them. Theoretically, all solutions are acceptable but for storage efficiency dfa with minimum number of states is preferred. So, we are interested in minimization of dfa or reduction of states of any dfa. Before we proceed for minimization of dfa we have to understand a basic concept. and Two states p and q of a dfa are called distinguishable if d*(p, w) ŒF implies d*(q, w) ŒF, d*(p, w) ŒF implies d*(q, w) ŒF, For all w Œ S*, if, on the other hand, there exists some string w Œ S* such that or d*(p, w) ŒF and d*(q, w) ŒF d*(p, w) ŒF and d*(q, w) ŒF Then the states p and q are said to be distinguishable by a string w. Steps for minimization of DFA are as follows: First of all see the procedure for finding pairs of distinguishable states:. Remove all inaccessible states, any state which can t be reached from the start state after one or more transitions is an inaccessible state. 2. Consider all pairs of states (p, q). If p ŒF and q œf or vice versa, mark the pair (p, q) as distinguishable. 3. For all pairs (p, q) and all a ŒS, calculate d(p, a) = p a and d(q, a) = q a. If the pair (p a, q a ) is marked as distinguishable, mark (p, q) as distinguishable.

19 4 Automata Theory, Language of Machines and Computability Now we have four sets {q 2 }, {q 4 }, {q } and {q, q 3 } Since {q 2 }, {q 4 } and {q } do not exist in pairs so they all are considered non-distinguishable. Now checking for set {q, q 3 } q q3 q 2 q 4 q 2 q 4 d(q, ) Æ q 2 ŒF d(, ) Æ q 4 ŒF d(q 3, ) Æ q 2 ŒF d(q 3, ) Æ q 4 ŒF Pair is non-distinguishable. Finally, we have four sets {q 2 }, {q 4 }, {q }, {q, q 3 } Start state of the given DFA is q so, start state of minimized dfa is {q } Final state of given DFA is q 2 and q 4 so, final states of minimized dfa are {q 2 }, {q 4 }. State transition graph for minimized dfa is as follows: {q 2 } {q 4 } {q } {q, q 3 } {q, q 3 } {q 4 } {q, q 3 } q 2 {q 4 } {q 4 } {q, q 3 } q 4 Example 2.29 Minimize the state in the dfa depicted in the following diagram. First of all, select two sets:. Set of all final states: {q 3, q 5 } 2. Set of all non-final states: {q, q, q 2, q 4 }

20 Finite Automata 4 q 3 q 5 q 5 q 5 q 5 q 5 This pair is non-distinguishable q q q 2 q 4 q q q q 3 d (q 3, ) Æ q 5 ŒF d(q 3, ) Æ q 5 ŒF d(q 5, ) Æ q 5 ŒF d(q 5, ) Æ q 5 ŒF q 3 q 3 q 4 q 3 d(q, ) Æ q œf d(q, ) Æ q 3 ŒF d(q, ) Æ q œf d(q, ) Æ q 3 ŒF Splitting the set {q, q, q 2, q 4 } into three sets {q, q }, {q 2 }, {q 4 } Now we have four sets {q 3, q 5 }, {q, q }, {q 2 }, {q 4 } d(q 2, ) Æ q œf d(q 2, ) Æ q 4 œf d(q 4, ) Æ q 3 ŒF d(q 4, ) Æ q 3 ŒF Set {q 3, q 5 } is non-distinguishable, now checking for sets {q, q }, {q 2 }, {q 4 }. q q q 3 q q q 3 d(q, ) Æ q œf d(q, ) Æ q 3 ŒF d(q, ) Æ q œf d(q, ) Æ q 3 ŒF Since states {q 2 }, {q 4 } are not in pairs so they are considered non-distinguishable. Finally, we have four states: {q 3, q 5 }, {q, q }, {q 2 }, {q 4 } Minimized dfa is: {q 3, q 5 } {q, q } {q 2 } {q 4 } {q 3, q 5 } {q, q } {q, q } {q 3, q 5 } {q 3, q 5 } {q 3, q 5 } {q 4 } {q 3, q 5 } Start state of the minimized dfa is {q, q } because q is the start state of the given dfa. Final states of dfa are q 3 and q 5, so final states of minimized dfa is {q 3, q 5 }. { q, q } { q 3, q 5 },, { q 2 } { } q 4

21 6. Construct a dfa for all strings that do not contain the substring. Finite Automata 43 (HPTU, Himachal Pradesh, 24) 7. Design a dfa which accepts even number of s and odd number of s. 8. Design an nfa which accepts any binary string that contains or as a substring. 9. Give an nfa for the set of all binary strings that have either the number of s odd, or the number of s not a multiples of 3 or both. 2. Design an nfa to accept the set of strings of s and s that either (a) ends in and has somewhere preceding, or (b) ends in and has somewhere preceding. 2. Convert the following nfa to its equivalent dfa. 22. Construct a dfa equivalent to the ndfa whose transition diagram is given below. (RTU, Rajasthan, 22) 23. Construct a deterministic finite automata equivalent to the following ndfa. (RTU, Rajasthan, 23) 24. Convert the following nfa to dfa. (GTU, Gujarat, 24)

22 44 Automata Theory, Language of Machines and Computability 25. Convert the following nfa to equivalent dfa. (DTU, Delhi, 22) 26. Convert the following nfa to dfa. (MU, Mumbai, 25) 27. Convert the given nfa to dfa. 28. Convert the given nfa to its equivalent dfa. 29. Convert the following nfa into an equivalent dfa. 3. Remove all empty moves from this nfa. (DTU, Delhi, 23)

23 Finite Automata Write an algorithm to minimize dfa using the subset construction method. (UPTU, Uttar Pradesh, 22-3) 32. Construct a minimum state dfa equivalent to finite automata given: (CSVTU, Chhattisgarh, 25) 33. Minimize the given dfa. GATE AND UGC-NET QUESTIONS. Consider the dfa given. Which of the following are FALSE?. Complement of L(A) is context free. 2. L(A) = L(* + ) ( + ) ***) 3. For the language accepted by A, A is minimal dfa. 4. A accepts all strings over {, } of length at least 2. (A) and 3 only (B) 2 and 4 only (C) 2 and 3 only (D) 3 and 4 only (GATE, 23) 2. What is the complement of the language accepted by the nfa shown below?

24 Finite Automata 47 (D) q (A) A (B) B (C) C (D) D (GATE, 22) 4. A DFA with alphabet {a, b} is given below: Which of the following finite state machines is a valid minimal dfa which accepts the same language as D? (A) (B) (C) (D) (A) A (B) B (C) C (D) D (GATE, 2) 5. Match the following nfa s with the regular expressions they correspond to:. Π+ (* + )** 2. Π+ (* + )** 3. Π+ (* + )* 4. Π+ (* + )**

25 48 Automata Theory, Language of Machines and Computability (A) P-2, Q-, R-3, S-4 (B) P-, Q-3, R-2, S-4 (C) P-, Q-2, R-3, S-4 (D) P-3, Q-2, R-, S-4 (GATE, 28) 6. A minimum state deterministic finite automaton accepting the language L = {w wœ{, }*, number of s and s in w are divisible by 3 and 5, respectively} has (A) 5 states (B) states (C) states (D) 9 states (GATE, 27) 7. Consider the finite automaton in the following figure: 8. What is the set of reachable states for input string? (A) {q, q, q 2 } (B) {q, q } (C) {q, q, q 2, q 3 } (D) {q 3 } (GATE, 24) M: Consider a machine M: The language recognized by M is: (A) {w Œ{a, b}* every a in w is followed by exactly two b s} (B) {w Œ{a, b}* every a in w is followed by at least two b} (C) {w Œ{a, b}* w contains the substring abb} (D) {w Œ{a, b}* w does not contain aa as a substring} (GATE 25)

26 5 Automata Theory, Language of Machines and Computability The minimum number of states required in deterministic finite automaton (dfa) equivalent to nfa is (A) 5 (B) 4 (C) 3 (D) 2 (UGC-NET, Paper II, June 23) 3. The transition function for the language L = {w n a (w) and n b (w) are both odd } is given by: d(q, a) = q ; d(q, b) = (q 2 ) d(q, a) = q ; d(q, b) = q 3 d (q 2, a) = q 3 ; d(q 2, b) = q d (q 3, a) = q 2 ; d(q 3, b) = q The initial and final state of an automaton are: (A) q and q respectively. (B) q and q respectively. (C) q and q 2 respectively. (D) q and q 3 respectively. (UGC-NET, Paper III, June 25)

Let us first give some intuitive idea about a state of a system and state transitions before describing finite automata.

Let us first give some intuitive idea about a state of a system and state transitions before describing finite automata. Finite Automata Automata (singular: automation) are a particularly simple, but useful, model of computation. They were initially proposed as a simple model for the behavior of neurons. The concept of a

More information

Finite Automata. Seungjin Choi

Finite Automata. Seungjin Choi Finite Automata Seungjin Choi Department of Computer Science and Engineering Pohang University of Science and Technology 77 Cheongam-ro, Nam-gu, Pohang 37673, Korea seungjin@postech.ac.kr 1 / 28 Outline

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 5 CHAPTER 2 FINITE AUTOMATA 1. Deterministic Finite Automata DFA 2. Nondeterministic Finite Automata NDFA 3. Finite Automata

More information

(Refer Slide Time: 0:21)

(Refer Slide Time: 0:21) Theory of Computation Prof. Somenath Biswas Department of Computer Science and Engineering Indian Institute of Technology Kanpur Lecture 7 A generalisation of pumping lemma, Non-deterministic finite automata

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 6a REVIEW for Q2 Q2 covers Lecture 5 and Lecture 6 Chapter 2 - Deterministic Finite Automata DFA Chapter 2 - Nondeterministic

More information

Finite Automata. Finite Automata

Finite Automata. Finite Automata Finite Automata Finite Automata Formal Specification of Languages Generators Grammars Context-free Regular Regular Expressions Recognizers Parsers, Push-down Automata Context Free Grammar Finite State

More information

CS 154, Lecture 3: DFA NFA, Regular Expressions

CS 154, Lecture 3: DFA NFA, Regular Expressions CS 154, Lecture 3: DFA NFA, Regular Expressions Homework 1 is coming out Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and

More information

Finite Automata. BİL405 - Automata Theory and Formal Languages 1

Finite Automata. BİL405 - Automata Theory and Formal Languages 1 Finite Automata BİL405 - Automata Theory and Formal Languages 1 Deterministic Finite Automata (DFA) A Deterministic Finite Automata (DFA) is a quintuple A = (Q,,, q 0, F) 1. Q is a finite set of states

More information

Chapter 5. Finite Automata

Chapter 5. Finite Automata Chapter 5 Finite Automata 5.1 Finite State Automata Capable of recognizing numerous symbol patterns, the class of regular languages Suitable for pattern-recognition type applications, such as the lexical

More information

Finite Automata. Mahesh Viswanathan

Finite Automata. Mahesh Viswanathan Finite Automata Mahesh Viswanathan In this lecture, we will consider different models of finite state machines and study their relative power. These notes assume that the reader is familiar with DFAs,

More information

Finite Automata. Wen-Guey Tzeng Computer Science Department National Chiao Tung University

Finite Automata. Wen-Guey Tzeng Computer Science Department National Chiao Tung University Finite Automata Wen-Guey Tzeng Computer Science Department National Chiao Tung University Syllabus Deterministic finite acceptor Nondeterministic finite acceptor Equivalence of DFA and NFA Reduction of

More information

Automata: a short introduction

Automata: a short introduction ILIAS, University of Luxembourg Discrete Mathematics II May 2012 What is a computer? Real computers are complicated; We abstract up to an essential model of computation; We begin with the simplest possible

More information

Nondeterminism. September 7, Nondeterminism

Nondeterminism. September 7, Nondeterminism September 7, 204 Introduction is a useful concept that has a great impact on the theory of computation Introduction is a useful concept that has a great impact on the theory of computation So far in our

More information

UNIT-I. Strings, Alphabets, Language and Operations

UNIT-I. Strings, Alphabets, Language and Operations UNIT-I Strings, Alphabets, Language and Operations Strings of characters are fundamental building blocks in computer science. Alphabet is defined as a non empty finite set or nonempty set of symbols. The

More information

Uses of finite automata

Uses of finite automata Chapter 2 :Finite Automata 2.1 Finite Automata Automata are computational devices to solve language recognition problems. Language recognition problem is to determine whether a word belongs to a language.

More information

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA) Deterministic Finite Automata Non deterministic finite automata Automata we ve been dealing with have been deterministic For every state and every alphabet symbol there is exactly one move that the machine

More information

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs) CS/ECE 374: Algorithms & Models of Computation, Fall 28 Deterministic Finite Automata (DFAs) Lecture 3 September 4, 28 Chandra Chekuri (UIUC) CS/ECE 374 Fall 28 / 33 Part I DFA Introduction Chandra Chekuri

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.1 Design an automaton that recognizes a given language. Specify each of

More information

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs) Algorithms & Models of Computation CS/ECE 374, Fall 27 Deterministic Finite Automata (DFAs) Lecture 3 Tuesday, September 5, 27 Sariel Har-Peled (UIUC) CS374 Fall 27 / 36 Part I DFA Introduction Sariel

More information

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata. CMSC 330: Organization of Programming Languages Last Lecture Languages Sets of strings Operations on languages Finite Automata Regular expressions Constants Operators Precedence CMSC 330 2 Clarifications

More information

Deterministic Finite Automata

Deterministic Finite Automata Deterministic Finite Automata COMP2600 Formal Methods for Software Engineering Ranald Clouston Australian National University Semester 2, 2013 COMP 2600 Deterministic Finite Automata 1 Pop quiz What is

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Mahesh Viswanathan Introducing Nondeterminism Consider the machine shown in Figure. Like a DFA it has finitely many states and transitions labeled by symbols from an input

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 6 CHAPTER 2 FINITE AUTOMATA 2. Nondeterministic Finite Automata NFA 3. Finite Automata and Regular Expressions 4. Languages

More information

CSE 311 Lecture 23: Finite State Machines. Emina Torlak and Kevin Zatloukal

CSE 311 Lecture 23: Finite State Machines. Emina Torlak and Kevin Zatloukal CSE 3 Lecture 3: Finite State Machines Emina Torlak and Kevin Zatloukal Topics Finite state machines (FSMs) Definition and examples. Finite state machines with output Definition and examples. Finite state

More information

Computer Sciences Department

Computer Sciences Department 1 Reference Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER 3 objectives Finite automaton Infinite automaton Formal definition State diagram Regular and Non-regular

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata COMP2600 Formal Methods for Software Engineering Katya Lebedeva Australian National University Semester 2, 206 Slides by Katya Lebedeva. COMP 2600 Nondeterministic Finite

More information

Nondeterministic Finite Automata

Nondeterministic Finite Automata Nondeterministic Finite Automata Not A DFA Does not have exactly one transition from every state on every symbol: Two transitions from q 0 on a No transition from q 1 (on either a or b) Though not a DFA,

More information

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism, CS 54, Lecture 2: Finite Automata, Closure Properties Nondeterminism, Why so Many Models? Streaming Algorithms 0 42 Deterministic Finite Automata Anatomy of Deterministic Finite Automata transition: for

More information

Decision, Computation and Language

Decision, Computation and Language Decision, Computation and Language Non-Deterministic Finite Automata (NFA) Dr. Muhammad S Khan (mskhan@liv.ac.uk) Ashton Building, Room G22 http://www.csc.liv.ac.uk/~khan/comp218 Finite State Automata

More information

Languages, regular languages, finite automata

Languages, regular languages, finite automata Notes on Computer Theory Last updated: January, 2018 Languages, regular languages, finite automata Content largely taken from Richards [1] and Sipser [2] 1 Languages An alphabet is a finite set of characters,

More information

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata : Organization of Programming Languages Theory of Regular Expressions Finite Automata Previous Course Review {s s defined} means the set of string s such that s is chosen or defined as given s A means

More information

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CS 154. Finite Automata, Nondeterminism, Regular Expressions CS 54 Finite Automata, Nondeterminism, Regular Expressions Read string left to right The DFA accepts a string if the process ends in a double circle A DFA is a 5-tuple M = (Q, Σ, δ, q, F) Q is the set

More information

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is

Theory of Computation p.1/?? Theory of Computation p.2/?? Unknown: Implicitly a Boolean variable: true if a word is Abstraction of Problems Data: abstracted as a word in a given alphabet. Σ: alphabet, a finite, non-empty set of symbols. Σ : all the words of finite length built up using Σ: Conditions: abstracted as a

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY NON-DETERMINISM and REGULAR OPERATIONS THURSDAY JAN 6 UNION THEOREM The union of two regular languages is also a regular language Regular Languages Are

More information

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA)

Languages. Non deterministic finite automata with ε transitions. First there was the DFA. Finite Automata. Non-Deterministic Finite Automata (NFA) Languages Non deterministic finite automata with ε transitions Recall What is a language? What is a class of languages? Finite Automata Consists of A set of states (Q) A start state (q o ) A set of accepting

More information

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs) Algorithms & Models of Computation CS/ECE 374, Spring 29 Deterministic Finite Automata (DFAs) Lecture 3 Tuesday, January 22, 29 L A TEXed: December 27, 28 8:25 Chan, Har-Peled, Hassanieh (UIUC) CS374 Spring

More information

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 CMPSCI 250: Introduction to Computation Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013 λ-nfa s to NFA s to DFA s Reviewing the Three Models and Kleene s Theorem The Subset

More information

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2 BIJU PATNAIK UNIVERSITY OF TECHNOLOGY, ODISHA Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2 Prepared by, Dr. Subhendu Kumar Rath, BPUT, Odisha. UNIT 2 Structure NON-DETERMINISTIC FINITE AUTOMATA

More information

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I

GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I GEETANJALI INSTITUTE OF TECHNICAL STUDIES, UDAIPUR I Internal Examination 2017-18 B.Tech III Year VI Semester Sub: Theory of Computation (6CS3A) Time: 1 Hour 30 min. Max Marks: 40 Note: Attempt all three

More information

Chapter 2: Finite Automata

Chapter 2: Finite Automata Chapter 2: Finite Automata 2.1 States, State Diagrams, and Transitions Finite automaton is the simplest acceptor or recognizer for language specification. It is also the simplest model of a computer. A

More information

CS 154. Finite Automata vs Regular Expressions, Non-Regular Languages

CS 154. Finite Automata vs Regular Expressions, Non-Regular Languages CS 154 Finite Automata vs Regular Expressions, Non-Regular Languages Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and guessing

More information

Lecture 17: Language Recognition

Lecture 17: Language Recognition Lecture 17: Language Recognition Finite State Automata Deterministic and Non-Deterministic Finite Automata Regular Expressions Push-Down Automata Turing Machines Modeling Computation When attempting to

More information

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs CSE : Foundations of Computing Lecture : Finite State Machine Minimization & NFAs State Minimization Many different FSMs (DFAs) for the same problem Take a given FSM and try to reduce its state set by

More information

CS243, Logic and Computation Nondeterministic finite automata

CS243, Logic and Computation Nondeterministic finite automata CS243, Prof. Alvarez NONDETERMINISTIC FINITE AUTOMATA (NFA) Prof. Sergio A. Alvarez http://www.cs.bc.edu/ alvarez/ Maloney Hall, room 569 alvarez@cs.bc.edu Computer Science Department voice: (67) 552-4333

More information

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT. Recap DFA,NFA, DTM Slides by Prof. Debasis Mitra, FIT. 1 Formal Language Finite set of alphabets Σ: e.g., {0, 1}, {a, b, c}, { {, } } Language L is a subset of strings on Σ, e.g., {00, 110, 01} a finite

More information

CPSC 421: Tutorial #1

CPSC 421: Tutorial #1 CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only

More information

Deterministic Finite Automaton (DFA)

Deterministic Finite Automaton (DFA) 1 Lecture Overview Deterministic Finite Automata (DFA) o accepting a string o defining a language Nondeterministic Finite Automata (NFA) o converting to DFA (subset construction) o constructed from a regular

More information

ECS 120 Lesson 15 Turing Machines, Pt. 1

ECS 120 Lesson 15 Turing Machines, Pt. 1 ECS 120 Lesson 15 Turing Machines, Pt. 1 Oliver Kreylos Wednesday, May 2nd, 2001 Before we can start investigating the really interesting problems in theoretical computer science, we have to introduce

More information

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is, Recall A deterministic finite automaton is a five-tuple where S is a finite set of states, M = (S, Σ, T, s 0, F ) Σ is an alphabet the input alphabet, T : S Σ S is the transition function, s 0 S is the

More information

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY No part of this publication may be reproduced or distributed in any form or any means, electronic, mechanical, photocopying, or otherwise without the prior permission of the author. GATE SOLVED PAPER Computer

More information

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS Automata Theory Lecture on Discussion Course of CS2 This Lecture is about Mathematical Models of Computation. Why Should I Care? - Ways of thinking. - Theory can drive practice. - Don t be an Instrumentalist.

More information

UNIT-III REGULAR LANGUAGES

UNIT-III REGULAR LANGUAGES Syllabus R9 Regulation REGULAR EXPRESSIONS UNIT-III REGULAR LANGUAGES Regular expressions are useful for representing certain sets of strings in an algebraic fashion. In arithmetic we can use the operations

More information

CSE 105 Theory of Computation

CSE 105 Theory of Computation CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Today s agenda Formal definition of DFA DFA design Regular languages Closure properties of the regular languages

More information

Automata Theory, Computability and Complexity

Automata Theory, Computability and Complexity Automata Theory, Computability and Complexity Mridul Aanjaneya Stanford University June 26, 22 Mridul Aanjaneya Automata Theory / 64 Course Staff Instructor: Mridul Aanjaneya Office Hours: 2:PM - 4:PM,

More information

Inf2A: Converting from NFAs to DFAs and Closure Properties

Inf2A: Converting from NFAs to DFAs and Closure Properties 1/43 Inf2A: Converting from NFAs to DFAs and Stuart Anderson School of Informatics University of Edinburgh October 13, 2009 Starter Questions 2/43 1 Can you devise a way of testing for any FSM M whether

More information

FINITE STATE MACHINES (AUTOMATA)

FINITE STATE MACHINES (AUTOMATA) FINITE STATE MACHINES (AUTOMATA) Switch Example Think about the On/Off button Switch Example The corresponding Automaton Off Push On Push Input: Push Push Push Push Vending Machine Example 2 Vending machine

More information

CSC236 Week 11. Larry Zhang

CSC236 Week 11. Larry Zhang CSC236 Week 11 Larry Zhang 1 Announcements Next week s lecture: Final exam review This week s tutorial: Exercises with DFAs PS9 will be out later this week s. 2 Recap Last week we learned about Deterministic

More information

Deterministic Finite Automata (DFAs)

Deterministic Finite Automata (DFAs) Algorithms & Models of Computation CS/ECE 374, Fall 27 Deterministic Finite Automata (DFAs) Lecture 3 Tuesday, September 5, 27 Part I DFA Introduction Sariel Har-Peled (UIUC) CS374 Fall 27 / 36 Sariel

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.1 Determine if a language is regular Apply closure properties to conclude

More information

Nondeterminism and Epsilon Transitions

Nondeterminism and Epsilon Transitions Nondeterminism and Epsilon Transitions Mridul Aanjaneya Stanford University June 28, 22 Mridul Aanjaneya Automata Theory / 3 Challenge Problem Question Prove that any square with side length a power of

More information

Finite Automata and Languages

Finite Automata and Languages CS62, IIT BOMBAY Finite Automata and Languages Ashutosh Trivedi Department of Computer Science and Engineering, IIT Bombay CS62: New Trends in IT: Modeling and Verification of Cyber-Physical Systems (2

More information

Closure under the Regular Operations

Closure under the Regular Operations Closure under the Regular Operations Application of NFA Now we use the NFA to show that collection of regular languages is closed under regular operations union, concatenation, and star Earlier we have

More information

Constructions on Finite Automata

Constructions on Finite Automata Constructions on Finite Automata Informatics 2A: Lecture 4 Mary Cryan School of Informatics University of Edinburgh mcryan@inf.ed.ac.uk 24 September 2018 1 / 33 Determinization The subset construction

More information

Course 4 Finite Automata/Finite State Machines

Course 4 Finite Automata/Finite State Machines Course 4 Finite Automata/Finite State Machines The structure and the content of the lecture is based on (1) http://www.eecs.wsu.edu/~ananth/cpts317/lectures/index.htm, (2) W. Schreiner Computability and

More information

Chapter Two: Finite Automata

Chapter Two: Finite Automata Chapter Two: Finite Automata In theoretical computer science, automata theory is the study of abstract machines (or more appropriately, abstract 'mathematical' machines or systems) and the computational

More information

CISC 4090 Theory of Computation

CISC 4090 Theory of Computation 9/2/28 Stereotypical computer CISC 49 Theory of Computation Finite state machines & Regular languages Professor Daniel Leeds dleeds@fordham.edu JMH 332 Central processing unit (CPU) performs all the instructions

More information

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata CISC 4090: Theory of Computation Chapter Regular Languages Xiaolan Zhang, adapted from slides by Prof. Werschulz Section.: Finite Automata Fordham University Department of Computer and Information Sciences

More information

Author: Vivek Kulkarni ( )

Author: Vivek Kulkarni ( ) Author: Vivek Kulkarni ( vivek_kulkarni@yahoo.com ) Chapter-2: Finite State Machines Solutions for Review Questions @ Oxford University Press 2013. All rights reserved. 1 Q.1 Construct Mealy and Moore

More information

1 Showing Recognizability

1 Showing Recognizability CSCC63 Worksheet Recognizability and Decidability 1 1 Showing Recognizability 1.1 An Example - take 1 Let Σ be an alphabet. L = { M M is a T M and L(M) }, i.e., that M accepts some string from Σ. Prove

More information

Name: Student ID: Instructions:

Name: Student ID: Instructions: Instructions: Name: CSE 322 Autumn 2001: Midterm Exam (closed book, closed notes except for 1-page summary) Total: 100 points, 5 questions, 20 points each. Time: 50 minutes 1. Write your name and student

More information

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed HKN CS/ECE 374 Midterm 1 Review Nathan Bleier and Mahir Morshed For the most part, all about strings! String induction (to some extent) Regular languages Regular expressions (regexps) Deterministic finite

More information

Before we show how languages can be proven not regular, first, how would we show a language is regular?

Before we show how languages can be proven not regular, first, how would we show a language is regular? CS35 Proving Languages not to be Regular Before we show how languages can be proven not regular, first, how would we show a language is regular? Although regular languages and automata are quite powerful

More information

Announcements. Problem Set Four due Thursday at 7:00PM (right before the midterm).

Announcements. Problem Set Four due Thursday at 7:00PM (right before the midterm). Finite Automata Announcements Problem Set Four due Thursday at 7:PM (right before the midterm). Stop by OH with questions! Email cs3@cs.stanford.edu with questions! Review session tonight, 7PM until whenever

More information

Automata and Languages

Automata and Languages Automata and Languages Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan FINITE STATE MACHINES (AUTOMATA) Switch Example Think about the On/Off button Switch Example The corresponding

More information

Theory of computation: initial remarks (Chapter 11)

Theory of computation: initial remarks (Chapter 11) Theory of computation: initial remarks (Chapter 11) For many purposes, computation is elegantly modeled with simple mathematical objects: Turing machines, finite automata, pushdown automata, and such.

More information

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission. CSE 5 Homework Due: Monday October 9, 7 Instructions Upload a single file to Gradescope for each group. should be on each page of the submission. All group members names and PIDs Your assignments in this

More information

Lecture 3: Finite Automata. Finite Automata. Deterministic Finite Automata. Summary. Dr Kieran T. Herley

Lecture 3: Finite Automata. Finite Automata. Deterministic Finite Automata. Summary. Dr Kieran T. Herley Lecture 3: Finite Automata Dr Kieran T. Herley Department of Computer Science University College Cork Summary Deterministic finite automata (DFA). Definition and operation of same. DFAs as string classifiers

More information

Chap. 1.2 NonDeterministic Finite Automata (NFA)

Chap. 1.2 NonDeterministic Finite Automata (NFA) Chap. 1.2 NonDeterministic Finite Automata (NFA) DFAs: exactly 1 new state for any state & next char NFA: machine may not work same each time More than 1 transition rule for same state & input Any one

More information

Theory Bridge Exam Example Questions

Theory Bridge Exam Example Questions Theory Bridge Exam Example Questions Annotated version with some (sometimes rather sketchy) answers and notes. This is a collection of sample theory bridge exam questions. This is just to get some idea

More information

Theory of Computation Lecture 1. Dr. Nahla Belal

Theory of Computation Lecture 1. Dr. Nahla Belal Theory of Computation Lecture 1 Dr. Nahla Belal Book The primary textbook is: Introduction to the Theory of Computation by Michael Sipser. Grading 10%: Weekly Homework. 30%: Two quizzes and one exam. 20%:

More information

Finite Automata Part Two

Finite Automata Part Two Finite Automata Part Two Recap from Last Time Old MacDonald Had a Symbol, Σ-eye-ε-ey, Oh! You may have noticed that we have several letter- E-ish symbols in CS103, which can get confusing! Here s a quick

More information

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1)

CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) CS 530: Theory of Computation Based on Sipser (second edition): Notes on regular languages(version 1.1) Definition 1 (Alphabet) A alphabet is a finite set of objects called symbols. Definition 2 (String)

More information

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) September,

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever.  ETH Zürich (D-ITET) September, Automata & languages A primer on the Theory of Computation Laurent Vanbever www.vanbever.eu ETH Zürich (D-ITET) September, 24 2015 Last week was all about Deterministic Finite Automaton We saw three main

More information

Introduction: Computer Science is a cluster of related scientific and engineering disciplines concerned with the study and application of computations. These disciplines range from the pure and basic scientific

More information

Computational Models #1

Computational Models #1 Computational Models #1 Handout Mode Nachum Dershowitz & Yishay Mansour March 13-15, 2017 Nachum Dershowitz & Yishay Mansour Computational Models #1 March 13-15, 2017 1 / 41 Lecture Outline I Motivation

More information

Optimizing Finite Automata

Optimizing Finite Automata Optimizing Finite Automata We can improve the DFA created by MakeDeterministic. Sometimes a DFA will have more states than necessary. For every DFA there is a unique smallest equivalent DFA (fewest states

More information

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement

More information

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010 University of Virginia - cs3102: Theory of Computation Spring 2010 PS2 - Comments Average: 77.4 (full credit for each question is 100 points) Distribution (of 54 submissions): 90, 12; 80 89, 11; 70-79,

More information

CS 322 D: Formal languages and automata theory

CS 322 D: Formal languages and automata theory CS 322 D: Formal languages and automata theory Tutorial NFA DFA Regular Expression T. Najla Arfawi 2 nd Term - 26 Finite Automata Finite Automata. Q - States 2. S - Alphabets 3. d - Transitions 4. q -

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

More information

Exam Computability and Complexity

Exam Computability and Complexity Total number of points:... Number of extra sheets of paper:... Exam Computability and Complexity by Jiri Srba, January 2009 Student s full name CPR number Study number Before you start, fill in the three

More information

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F)

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F) Outline Nondeterminism Regular expressions Elementary reductions http://www.cs.caltech.edu/~cs20/a October 8, 2002 1 Determistic Finite Automata A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F) Q is a finite

More information

Finite-state machines (FSMs)

Finite-state machines (FSMs) Finite-state machines (FSMs) Dr. C. Constantinides Department of Computer Science and Software Engineering Concordia University Montreal, Canada January 10, 2017 1/19 Finite-state machines (FSMs) and state

More information

3515ICT: Theory of Computation. Regular languages

3515ICT: Theory of Computation. Regular languages 3515ICT: Theory of Computation Regular languages Notation and concepts concerning alphabets, strings and languages, and identification of languages with problems (H, 1.5). Regular expressions (H, 3.1,

More information

CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont )

CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont ) CSE 135: Introduction to Theory of Computation Nondeterministic Finite Automata (cont ) Sungjin Im University of California, Merced 2-3-214 Example II A ɛ B ɛ D F C E Example II A ɛ B ɛ D F C E NFA accepting

More information

Two Way Deterministic Finite Automata

Two Way Deterministic Finite Automata Two Way Deterministic Finite Automata Jagvir Singh and Pavan Kumar Akulakrishna Indian Institute of Science November 29, 2013 Jagvir Singh and Pavan Kumar Akulakrishna (IISC) 2DFA November 29, 2013 1 /

More information

Automata Theory (2A) Young Won Lim 5/31/18

Automata Theory (2A) Young Won Lim 5/31/18 Automata Theory (2A) Copyright (c) 2018 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later

More information

CS 121, Section 2. Week of September 16, 2013

CS 121, Section 2. Week of September 16, 2013 CS 121, Section 2 Week of September 16, 2013 1 Concept Review 1.1 Overview In the past weeks, we have examined the finite automaton, a simple computational model with limited memory. We proved that DFAs,

More information

Theory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable

Theory of Computation p.1/?? Theory of Computation p.2/?? We develop examples of languages that are decidable Decidable Languages We use languages to represent various computational problems because we have a terminology for dealing with languages Definition: A language is decidable if there is an algorithm (i.e.

More information

Finite Automata Part Two

Finite Automata Part Two Finite Automata Part Two DFAs A DFA is a Deterministic Finite Automaton A DFA is defined relative to some alphabet Σ. For each state in the DFA, there must be exactly one transition defined for each symbol

More information