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
Figure 5: The answer is as follows: Note: q 3 is a trap state .
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
Figure 6: The answer is as follows:
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
Figure 7: The answer is as follows:
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
Topics Deterministic Finite Accepters (DFA) Nondeterministic Finite Accepters (NFA)
NFA (2.2) Nondeterministic Finite Acceptors Example NFAs Formal Definition of NFAs
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.
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
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}
Extended Transition Function * (q i , w) = Q j
Figure 10: NFA (2.2) Example NFAs *(q 1 ,a)={q 0 , q 1 , q 2 } *(q 2 , )={q 0 , q 2 } L=aa*
NFA (2.2)

#### 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