Universal Turing machine
AnswerA universal Turing machine U receives an encoding of a machine M and input w. It simulates M by maintaining its state,…
Read more →AnswerA universal Turing machine U receives an encoding of a machine M and input w. It simulates M by maintaining its state,…
Read more →AnswerA Petri net has places, transitions, directed arcs and a marking assigning token counts to places. A transition is enabled when each…
Read more →AnswerUse states q0,q1,q2,q3 representing the number of a symbols seen, capped at three. Start at q0; only q3 accepts. On a move…
Read more →AnswerRead the fixed-width binary word from right to left. In initial state C copy zeros (0/0 loop); on the first 1 output…
Read more →AnswerUse states r0,r1,r2 with outputs 0,1,2 respectively; start r0. Reading most significant bit first, update r to (2r+b) mod 3. Transitions on…
Read more →AnswerInitial partition: {q1,q2,q4}, {q3,q5}. The accepting states q3,q5 have equivalent transitions, and q2,q4 also do. q1 differs from q2 on 0, so…
Read more →AnswerStart q0; q0—0→q1—1→q2. Branch q2—1→q3—1→q5 or q2—0→q4—0→q5. Add q5—0→q5 and q5—1→q6, the only final state. All unspecified transitions are empty. The two…
Read more →AnswerLet R1,R2,R3 denote suffix languages leading to acceptance. R1=ε+0R1+1R2; R2=1R2+0R3; R3=0R1+1R2. Substitution gives R2=(1+01)*00R1. Hence R1=(0+1(1+01)*00)* by Arden’s theorem. The expression includes…
Read more →AnswerAn ambiguous grammar permits two distinct parse trees for one word. Here A generates bcd or cd, and B generates c or…
Read more →AnswerA is the only nullable variable. Add S→a and A→aa when eliminating ε. The resulting rules are S→aA|aBB|a; A→Aaa|aa; B→bB|bbC; C→b. All…
Read more →Ask a study question in English or Hindi. I will find relevant passages from our notes.