Computer Science, asked by bansalradhika1213, 1 day ago

(a*b*+b*)aa convert
into nfa

Answers

Answered by rameshwarpanda3007
0

This structure is for a+ which means there must be at least one a” in the expression. It is preceded by epsilon and also succeeded by one. There is epsilon feedback from state q2 to q1 so that there can be more than one a” in the expression.

This structure is for a* which means there can be any number of ‘a’ in the expression, even 0. The previous structure is just modified a bit so that even if there is no input symbol, i.e if the input symbol is null, then also the expression is valid.

∈-NFA for a+b :

" style="max-width: 100%; display: block !important;">

For concatenation, a must be followed by b. Only then it can reach the final state. Both structures are allowed here but as it is ∈-NFA so the second structure is recommended.

∈-NFA for L = {ab, ba} :

Following the above-mentioned rules, ∈-NFA of Regular Language L ={ab, ba} is to be constructed.

The language consists of ab or ba, which can also be written as (ab + ba). Following the rule of constructing an addition or (a+b), we have to construct the main structure. However, here, ‘a’ in a+b is actually the expression ‘ab’ and ‘b’ in a+b is actually the expression ‘ba’. So, we just replace their structures in place of a and b respectively. So the final ∈-NFA will have two paths, one for ab and another for ba both of which lead to the final state.

Following the rule of constructing concatenation or ab, we can individually construct the structures for ab and ba. For concatenation, any one of the two above-mentioned structures, i.e, with epsilon or without epsilon, can be chosen but we choose the one with the epsilon because it is an ∈-NFA.

The Final ∈-NFA will be :

" style="max-width: 100%; display: block !important;">

Attachments:
Similar questions