CS2303 TOC 2 MARKS.pdf

# 17 obtain the dfa equivalent to the following nfa

• Test Prep
• 20

This preview shows pages 5–8. Sign up to view the full content.

Design FA to accept the string that always ends with 00. 17. Obtain the DFA equivalent to the following NFA. Solution : The transition table for given NFA can be drawn as follows To construct equivalent DFA δ (q0, 0) = {q0, q1 } a new state - A δ {q0, 1} = {q0} δ {q1, 0} = - δ {q1, 1} = {q2} δ {q2, 0} = - The transition table for DFA δ {q2, 1} = - δ {{qo,q1},0} = {q0,q1} δ {{qo,q1},1} = {q0,q2} a new state - B δ {{qo,q2},0} = {q0,q1} δ {{qo,q2},0} = {q0} The transition diagram for DFA States Input 0 1 {q0} {q0}{q1} {q0} {q1} - {q2} {q2} - - States Input 0 1 {q0} {q0, q1} {q0} {q1} - {q2} {q2} - - {q0, q1} {q0, q1} {q0, q2} {q0, q2} {q0, q1} {q0} q 2 q 0 q 1 q 2 0 1 0, 1 1 0 q 2 q 0 A B 0 1 1 0 q 2 q 0 q 1 q 2 0 0 1 1 1 0

This preview has intentionally blurred sections. Sign up to view the full version.

III Year V Semester CSE CS2303 Theory of Computation Adhiparasakthi College of Engg., G.B. Nagar, Kalavai Page 6 of 20 18. Obtain the NFA without transition to the following NFA with transition. Solution : Remove transition from q0 to q1 Now remove transition from q0 to q2. As q0 to q2 is transition q0 will become start and final state both. 19. Obtain the closure of states q0 and q1 in the following NFA with transition. Solution: - CLOSURE {q0} = {q0, q1,q2} - CLOSURE {q1} = {q1,q2} 20. Obtain closure of each state in the following NFA with move. Solution: - CLOSURE {q0} = {q0, q1,q2} - CLOSURE {q1} = {q1,q2} - CLOSURE {q2} = {q2} q 0 q 1 q 2 a b c q 0 q 1 q 2 0 1 2 q 2 q 2 q 0 q 1 q 2 0 1 2 q 2 q 1 0,1 q 2 2 q 2 q 0 Start 0, 1, 2
III Year V Semester CSE CS2303 Theory of Computation Adhiparasakthi College of Engg., G.B. Nagar, Kalavai Page 7 of 20 21. Explain a transition diagram. It is a 5-tuple graph used state and edges represent the transitions from one state to other state. Eg.: 22. Explain a transition diagram. It is the tabular representation of the DFA. For a transition table the transition function is used. Eg.: 23. Explain the transition function. The mapping function or transition function denoted by δ. Two parameters are passed to this transition function : (i) current state and (ii) input symbol. The transition function returns a state which can be called as next state. Eg.: δ ( q0, a ) = q1 24. Differentiate DFA and NFA? Sl. No DFA NFA 1. DFA is Deterministic Finite Automata NFA is Non-Deterministic Finite Automata 2. For given state, on a given input we reach to deterministic and unique state. For given state, on a given input we reach to more than one state. 3. DFA is a subset of NFA Need to convert NFA to DFA in the design of complier. 25. Write short notes on Minimization of DFA? - Reducing the number of states from given FA - First find out which two states are equivalent we than replace those two states by one representative state. - For finding the equivalent states we will apply the following rule - The two states S1 & S2 are equivalent if and only if both the states are final or non-final states.

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.
• Spring '18
• isha mam

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern