please send screenshot of code and the results. 3 Run this program to create a p
ID: 3813701 • Letter: P
Question
please send screenshot of code and the results.
Explanation / Answer
Let money supply = < Q2 , , q2,0 , 2 , A2 > be Associate in Nursing NFA that acknowledges a language L. Then the DFA M = < Q, , q0 , , A > that satisfies the subsequent conditions acknowledges L:
Q = 2Q2 , that's the set of all subsets of Q2 ,
q0 = ,
( q, a ) = for every state Q in Q and every image a in and
A = { Q Q | Q A2 }
To obtain a DFA M = < Q, , q0 , , A > that accepts identical language because the given NFA money supply = < Q2 , , q2,0 , 2 , A2 > will, you'll proceed as follows:
Initially Q = .
First place into Q. is that the initial state of the DFA M.
Then for every state Q in Q do the following:
add the set , wherever here is that of NFA money supply, as a state to Q if it's not already in Q for every image a in .
For this new state, add ( q, a ) = to , wherever the on the proper hand aspect is that of NFA money supply.
When no additional new states may be additional to Q, the method terminates. All the states of Q that contain acceptive states of money supply square measure acceptive states of M.
Note: The states that don't seem to be reached from the initial state don't seem to be enclosed in Q obtained by this procedure. so the set of states Q so obtained isn't essentially adequate 2Q2 .
Example 1: allow us to convert the subsequent NFA to DFA.
Initially Q is empty. Then since the initial state of the DFA is , is additional to Q.
Since 2( 0 , a ) = , two } is additional to Q and ( zero } , a ) = .
Since 2( 0 , b ) = , is additional to Q and ( zero } , b ) = .
At this time Q = { , , } .
Then since one , a pair of } is currently in Q, the transitions from one , a pair of } on symbols a and b square measure computed. Since 2( one , a ) = , and 2( 2 , a ) = , ( , a ) = . equally ( one , 2 } , b ) = . Thus three } is additional to Q .
Similarly ( one , 3 } , a ) = two } and ( one , 3 } , b ) = . so no new states square measure additional to Q . Since the transitions from all states of Q are computed and no additional states square measure additional to Q, the conversion method stops here.
Note that there are not any states of Q2 in . thus there are not any states that money supply will head to from . Hence ( , a ) = ( , b ) = .
For the acceptive states of M, since states zero and one square measure the acceptive states of the NFA, all the states of Q that contain zero and/or one square measure acceptive states. thus zero }, two } and one , three } square measure the acceptive states of M.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.