Analysis Example of valid strings ab ababab abaaa abbbbb abaaabbb Example of

Analysis example of valid strings ab ababab abaaa

This preview shows page 16 - 31 out of 35 pages.

Analysis Example of valid strings : ab , ababab, abaaa, abbbbb, abaaabbb, … Example of invalid strings : baab, ba L = {ab(a|b)*} DFA (2.1) Example 2.3
Image of page 16
Figure 5: The answer is as follows: Note: q 3 is a trap state .
Image of page 17
Question: Show that the language L = { awa : w { a , b }* } is regular. Analysis To show this language or other language is regular, find a DFA for that language. Example of valid strings : aaaba, aaa Example of invalid strings : aabb, baba L = {a (a|b)*a} DFA (2.1) Example 2.5
Image of page 18
Figure 6: The answer is as follows:
Image of page 19
Question: Let the language L = { awa : w { a , b }* }. Show that L 2 is regular. Analysis: Means find a dfa for L 2 . What is L 2 ? L 2 = LL = { aw 1 aaw 2 a : w 1 ,w 2 { a , b }* Example of valid strings : ?? Example of invalid strings : ?? DFA (2.1) Example 2.6
Image of page 20
Figure 7: The answer is as follows:
Image of page 21
1. Draw DFA for L(M) = {a*baa*} 2. Construct DFA’s for . 3. For = {a,b}, construct DFA’s that accept the sets consisting of i. All strings with exactly one a ii. All strings with at least one a iii. All strings with no more than three a’s. Task 2
Image of page 22
Topics Deterministic Finite Accepters (DFA) Nondeterministic Finite Accepters (NFA)
Image of page 23
NFA (2.2) Nondeterministic Finite Acceptors Example NFAs Formal Definition of NFAs
Image of page 24
NFA (2.2) Nondeterministic Finite Acceptors Finite-state automaton can be nondeterministic in either or both of two ways: nfa with multiple arcs, with the same symbol. (Figure 2.8) nfa with empty transition, labeled with empty string. (Figure 2.9) Due to nondeterminism, the same string may cause an nfa to end up in one of several different states, some of which may be final while others are not. The string is accepted if any possible ending state is a final state.
Image of page 25
Figure 8: NFA: Multiple arcs with the same symbol (q 0 ,a)={q 1 ,q 4 } (q 1 ,a)={q 2 } (q 2 ,a)={q 3 } L = aaa
Image of page 26
Figure 9: NFA: Arcs with empty string (q 0 , )={q 2 } (q 0 ,0)={ } (q 0 ,1)={q 1 } (q 1 ,0)={q 0 ,q 2 } (q 1 ,1)={q 2 } (q 2 ,0)={ } (q 2 ,1)={ } 0 1 q 0 q 1 q 2 q 1 q 0, q 2 q 2 q 2 L = (10)* or L = {(10) n :n 0}
Image of page 27
Extended Transition Function * (q i , w) = Q j
Image of page 28
Figure 10: NFA (2.2) Example NFAs *(q 1 ,a)={q 0 , q 1 , q 2 } *(q 2 , )={q 0 , q 2 } L=aa*
Image of page 29
NFA (2.2)
Image of page 30
Image of page 31

You've reached the end of your free preview.

Want to read all 35 pages?

  • Fall '16
  • Jennifer Smith
  • Formal language, Regular expression, Regular language, Nondeterministic finite state machine, Automata theory

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes