CS2303 TOC 2 MARKS.pdf

A pda p q q z f to be deterministic iff 1 qax has at

• Test Prep
• 20

This preview shows pages 14–16. Sign up to view the full content.

A PDA P = (Q, ∑, , , q 0 , Z 0 , F) to be deterministic iff 1) (q,a,X) has at most one member for any q in Q, a in ∑ or a = ε and X in | --. 2) If (q,a,X) is not empty, for some a in ∑, then (q,ε,X) must be empty. 19. Is it true that NDPA is more powerful than that od DPDA? Justify your answer. No, NPDA is not powerful than DPDA. Because NPDA may produce ambiguous grammar by reaching its final state or by emptying its stack. But DPDA produces only unambiguous grammar. 20. What is the additional feature PDA has when compared with NFA? Is PDA superior over NFA in the sense L acceptance? Justify your answer. PDA is superior NFA by having the following additional features. Stack which is used to store the necessary tape symbols and use the state to remember the conditions. Two ways of L acceptances, one by reaching its final state and another by emptying its stack.

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 15 of 20 UNIT IV 1. What are the two major normal forms for context-free grammar? The two Normal forms are i. Chomsky Normal Form (CNF) ii. Greibach Normal Form (GNF) 2. What is a useless symbol? A symbol x is useful if there is a derivation S * α x β * w for some α, β, w ∑ T* or else , it is useful. 3. How do you simplify the context-free grammar? First eliminate useless symbols, where the variable or terminals that do not appear in any derivation of a terminal string from the start symbol. Next e liminate ε - productions which is of the form A ε for some variable A. Eliminate unit productions, which are of the form A B for variables A, B. Finally use any of the normal forms to get the simplified CFG. 4. Define Nullable Variable? Nullable variable in a CFG G =(V,T,P,S) can be defined as follows. Any variable A for which P contains the production A A, is nullable. If P contains the production A B1,B2, ……. Bn and B1, B2, ….Bn are nullable variables, then A is nullable. No other variables in V are nullable. 5. Define generating symbol? Let G = (V,T,P,S) is generating, if X * w for some terminal string w. e.g. A aAB / ε B b Then A is a generating symbol since A *ab 6. Let G = (V, T, P,S) with the productions given by S aSbS/ B / ε B abB Eliminate the useless production. Solution: Remove B is useless production because of Variable is not reachable. S aSbS / ε 7. What is substitution Rule? A production A x 1 Bx 2 can be eliminated from a grammar if B is replaced by all strings derived by B in one step, provided A and B are variables. 8. What is a useful production? Let G = (V,T,P,S) be a CFG. A variable A ∑ V is said to be useful iff there is atleast one w∑L(G) such that S * xAy * w with x,y in (VUT)*.
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