Question 5. Let Σ = {a, b}, and consider the language
L = {a^n : n is even} ∪ {b^n : n is odd}.
Draw a graph representing a DFA (not NFA) that accepts this language.
Given language is
L = { a^n : n is even } U { b^n : n is odd }
Consider the given Language L = L1 U L2 where
L1 = { a^n : n is even } and
L2 = {b^n : n is odd}.
Strings in languages
L1 = {e,aa,aaaa,aaaaaa,..................} and
L2 = {b,bbb,bbbbb,bbbbbbb,...................}
L = L1 U L2
L = {e,b,aa,bbb,aaaa,bbbbb,aaaaaa,................} # e is empty string epsilon
DFA:
This DFA accepts L
Starting state(initial state) = A
Set of States = {A,B,C,D,DEAD(OPTIONAL)}
Set of final states = {A,C}
Transition Table:
States | a | b |
A | B | C |
B | A | Dead |
C | Dead | D |
D | Dead | C |
Dead | Dead | Dead |
DFA Graph:
If you have any doubts please leave a comment!!!!!!!!
Question 5. Let Σ = {a, b}, and consider the language L = {a^n : n...
Let Σ = { a, b } , and consider the language L = { a n : n is even } ∪ { b n : n is odd } . Draw a graph representing a DFA (not NFA) that accepts this language.
Question 5. Let Σ = {a, b}, and consider the language L = {a n : n is even} ∪ {b n : n is odd}. Draw a graph representing a DFA (not NFA) that accepts this language. Question 6. Give a brief description of the language generated by the following production rules. S → abc S → aXbc Xb → bX Xc → Ybcc bY → Yb aY → aa aY → aaX
Question 5. Let S = {a,b}, and consider the language L = {a" : n is even} U{b" : n is odd}. Draw a graph representing a DFA (not NFA) that accepts this language.
Question 1. Let Σ = {a, b}, and consider the language L = {w ∈ Σ ∗ : w contains at least one b and an even number of a’s}. Draw a graph representing a DFA (not NFA) that accepts this language.
. Let Σ = { a, b } , and consider the language L = { w ∈ Σ ∗ : w contains at least one b and an even number of a’s } . Draw a graph representing a DFA (not NFA) that accepts this language.
Question 1. Let Σ = {a, b}, and consider the language L = {w ∈ Σ ∗ : w contains at least one b and an even number of a’s}. Draw a graph representing a DFA (not NFA) that accepts this language. Question 2. Let L be the language given below. L = {a n b 2n : n ≥ 0} = {λ, abb, aabbbb, aaabbbbbb, . . .} Find production rules for a grammar that generates L.
Question 1. Let S = {a,b}, and consider the language L = {w E E* : w contains at least one b and an even number of a's}. Draw a graph representing a DFA (not NFA) that accepts this language. Question 2. Let L be the language given below. L = {a”62m : n > 0} = {1, abb, aabbbb, aaabbbbbb, ...} Find production rules for a grammar that generates L.
Question 7. Let Σ = {a}, and consider the language L = {a^n : n is a prime number} = {a 2 , a3 , a5 , a7 , a11 , . . .}. Is L a regular language? Why or why not? (Hint: L contains a 11 , a 17 , a 23 , a 29, but not a 77 since 77 is divisible by 11. . . )
Consider the language L below. (a) Is L a regular language? – Yes, or No. (b) If L is a regular language, design the DFA (using a State Table) to accept the language L, with the minimum number of states. Assume , (c) Suppose the input is “101100”. Is this input string in the language L? Σ = {0,1} L={w l w has both an even number of O's and an odd number of 1's}
Let Σ = { a } , and consider the language L = { a n : n is a prime number } = { a 2 , a 3 , a 5 , a 7 , a 11 , . . . } . Is L a regular language? Why or why not? (Hint: L contains a 11 , a 17 , a 23 , a 29 , but not a 77 since 77 is divisible by 11. ....