1 / 13

More YES-NO machines

δ. More YES-NO machines. (i) The operators δ and (ii) How to “combine” two machines into one (iii) Languages DFAs cannot recognize. current state. symbol. δ :. q. ?. a. δ. jump. ?. δ ( q , a ). state. symbol. next state. The “jump” operator δ.

cadee
Download Presentation

More YES-NO machines

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. δ More YES-NO machines (i) The operators δ and (ii) How to “combine” two machines into one (iii) Languages DFAs cannot recognize

  2. current state symbol δ: q ? a δ jump ? δ(q, a) state symbol next state The “jump” operator δ Simply put, given the current state of a DFA and an input symbol, the “delta operator” tells you the next state the machine will “jump” to.

  3. current state string w2 w1 wn ? δ δ(q,w1) journey ? (q, w) δ( δ(q, w1), w2 ) δ δ δ destination state state string The “journey” operator q Simply put, given the current state of a DFA and an input string, the “delta-bar operator” tells you the next state the machine will “journey” to.

  4. w2 w1 wn start final A DFA M = (Q, Σ,δ, s, F )accepts wєΣ* iff (s, w) = f where f єF. δ Defining accept / reject using the new operators Now, we can define “acceptance” of an input string w by a DFA in a simple, concise manner.

  5. “Combining” two machines into one . . . 1A 1B 1C 4C 4D Q1x Q2 a a b b 1 2 3 4 Q1  a a b b A B C D Q2 a a b b

  6. “Combining” two machines into one M = ( Q, Σ , δ, s, F ) M1 = ( Q1, Σ , δ1, s1, F1) M2 = ( Q2, Σ , δ2, s2, F2) L(M) = L( M1) U L(M2) Q = Q1 x Q2 = { (q1, q2) | q1єQ1 and q2єQ2} δ( (q1, q2), a ) = ( δ1(q1, a), δ2(q2, a) ), q1єQ1, q2єQ2 and a єΣ s = ( s1 , s2 ) F = { ( f1 , f2 ) | f1єF1 orf2єF2 }

  7. a b b b a b a L1 = {ax b | xєΣ*} a a a a a b b b b b b a L2 = {ax | xєΣ*} b a a L1 = L1 U L2 “Combining” two machines into one: an example final states

  8. Q final states non-final states How to transform a machine to do the “opposite” of what it has been doing? It should be extremely hard to “transform” a machine (or a human being!) to do the “opposite*” of what it has been doing. Shouldn’t it? But, contrary to what one might expect, it isn’t. HOW come? The set of states (and everything else) in the “transformed machine” remains the same. Just “rename” the final-states as non-final states and vice-versa. *The “transformed machine” should accept those strings it has been rejectingand vice versa; in other words, it should now recognize the complement of the language recognized by it earlier.

  9. How to transform a machine to do the “opposite” of what it has been doing? δ (w) єF’ (by definition)  δ δ  (w) єQ\F(F’ = Q\F, the change we introduced)  (w) є Set of non-final states of M   M = ( Q, Σ , δ, s, F ) M ’ = ( Q, Σ , δ, s, F’ ) L(M’) = Σ* \ L( M) F’ = Q\F PROOF w is accepted by M’ w is rejected by M wєΣ* \ L( M) ----End of proof----

  10. a 1 aa 2 M . . . . . . aaa … (n times) n aaa … (n + 1times) . . What YES-NO machines can’t do We give an example of a language that cannot be recognized by any DFA. Consider L = { anbn | n >= 0 } We give a “proof by contradiction” for the fact that no DFA can recognize L. Suppose a DFA M (of course, having finite number of states) recognizes L. Now consider the set of strings { a, aa, aaa, aaaa, …..} i.e. the set {an | n >=0} which is infinite. Clearly, the number of strings in this set (which is infinitely many) would outnumber the number of states in the machine (whatever the exact number is!). See illustration (1). (1)

  11. HOLES Pigeons In other words, there will be two strings ai and aj such that (s, ai) = (s, aj), where s is the start state of the machine. a i start some state a a j 1 aa (3) 2 M . . . . . . δ δ aaa … (n times) n aaa … (n + 1times) . . What YES-NO machines can’t do Now, according to the Pigeon-Hole principle (see illustration (2)), there will be two strings ai and aj (i ≠ j) that “land” onto the same state when inputted to the machine (see illustration (3)). (2)

  12. start a i bi Final/ Non-final some state a j (4) What YES-NO machines can’t do Now consider the strings aibi and ajbi. (Note that these strings have an extra “piece” bi glued to them.) Imagine feeding them (one by one) as inputs to the machine. What states will the machine reach? Since we already realized that ai and aj (the prefixes of the two new strings) would take the machine to the same state, the machine should end up in the same state (a final or non-final state) for both the inputs aibi (which is in L) and ajbi (which is NOT in L). See illustration (4).

  13. What YES-NO machines can’t do Thus, the DFA shows the same behaviour for both the inputs (one “valid”, and the other “invalid”), i.e. it either accepts or rejects both—a contradiction. Thus our supposed DFA cannot exist! ----End of proof----

More Related