Convert this language to a NFA
L(ab(a+b)*(a+aa))
Answer: the graph is as follows:
Question: How do you know when to insert lambda? Will give thumbs up :)
Hey,
denotes an
empty string to NFA.
Then language contains (a + b) *, that could an empty string as
or it could be
'a' (i-e '
a') or 'b' (i-e
'
b') or 'aa' (i-e
'
a
a
').
so as we know that ( a + b ) * can be the repetition of (a + b) in range of 0 to n.
hence
Case 1: when (a + b) * is empty we can move to state 6 by
passing as empty
string.
case 2: when (a + b )is there it will reach to state 6 but again
we have ( a + b)* as 'a' (i-e 'a') or 'b' (i-e
'
b') or 'aa' (i-e
'
a
a
'). then we need
to come back on state 2. so with a
will be back to
state 2 from 6.
and similarly it could be 'a' (i-e 'a') so we
need
between state 2
to 4 as state 3.
so we can see that to control effect of '*' we need loops and
empty string to construct
our NFA. So This is known as NFA with
transition and
denoted as (NFA-
).
Hope I could have explain you, why and where to use
in NFA.
Thanks.
Convert this language to a NFA L(ab(a+b)*(a+aa)) Answer: the graph is as follows: Question: How do...
Find an NFA that accepts the language L (aa* (ab + b))
QUESTION 8 For the following equation, solve for the language L. {a, aa, ab} L = {ab,aab,abb, aa aaa, aba} O L = {bb,aa,a} O L = {b,a} O L = {b,aa} L = {4,b,a} QUESTION 9 Consider the regular expression (a+ab)*(b+ab)* Which of the followings
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
Please answer any 7 of them
ТОС Answer any 7 from the followings: 1. Regular expression to NFA: i) ab(aUb)* ii) (aba U a)*ab 2. Explain and construct a generalized NFA, 3. NFA to regular expression 0 3 91 93 8 a 4. DFA to regular expression 011 5. Explain the rules of pumping lemma briefly with an example. 6. Give an example of right linear grammar and left linear grammar. 7. L(G) = {1*20 m >= 1 and >=1}....
I need help with that
5. Let Σ-ta, b). Write the δ function for the following (1) dfa (δου'Qu Σ-Q) and (2) nfa (5,ra : Q x (BU {λ)) → P(D) respectively. 92 92 6. Give the languages accepted by the dfa and nfa in the above 6 (1) and 6(2), respectively 7. (1) When is a language L called as regular? (2) (i) Prove language L = {а"wb: we {a, b) *,n2 O} įs regular by design an nfa...
Please Answer Question#02 Solution of Question 1 is
attached.
Solution of Questions #01
Please do Questions #01 As soon as
possible.
= {a, b} will be used for all of the following exercises. The alphabet 1. Give regular expressions which exactly define the following languages. [7 marks] (a) L1 which has exactly one b but any number of as. (b) L2 which has an even number of as and an even number of bs. [7 marks] (c) L3 which contains...
Question 8, please.
2. Prove: (a) the set of even numbers is countable. (b i=1 3. The binary relation on pair integers - given by (a,b) - (c,d) iff a.d=cbis an equivalence relation. 4. Given a graph G = (V, E) and two vertices s,t EV, give the algorithm from class to determine a path from s to t in G if it exists. 5. (a) Draw a DFA for the language: ( w w has 010 as a substring)....
Question 1: Every language is regular T/F Question 2: There exists a DFA that has only one final state T/F Question 3: Let M be a DFA, and define flip(M) as the DFA which is identical to M except you flip that final state. Then for every M, the language L(M)^c (complement) = L( flip (M)). T/F Question 4: Let G be a right linear grammar, and reverse(G)=reverse of G, i.e. if G has a rule A -> w B...
UueSLIORS! 1. Find the error in logic in the following statement: We know that a b' is a context-free, not regular language. The class of context-free languages are not closed under complement, so its complement is not context free. But we know that its complement is context-free. 2. We have proved that the regular languages are closed under string reversal. Prove here that the context-free languages are closed under string reversal. 3. Part 1: Find an NFA with 3 states...
OLIVA, ULTIULUI 13. Additional Problem 5-13 42 Figure 11 Answer all of the following You do NOT need to spe f the following questions for the NFA for the NFA shown in Figure 11 above ance of states that you visit O O Does it accept the string A Does it accept the string a Does it accept the string b Does it accept the string c De Does it accept the string aa Does it accept the string ab...