UNIT-I - TKRCET

13
UNIT-I Short Questions 1. Define Automata. 2. Distinguish between DFA and NFA 3. Define String 4. Describe transition function of DFA. 5. Define ε–transitions. 6. Explain power of an alphabet (∑*). 7. List the applications of finite automata. 8. Describe Null string. 9. Define Kleene Star? 10. Define NFA with example. 11. Describe transition diagram for DFA accepting string ending with 00 12. Construct DFA for a string accepting odd number of 0’s. 13. Illustrate transition diagram for DFA to accept exactly one ‘a’ defined. over an alphabet ∑= {a,b}.. 14. Construct DFA for odd number of 1’s. 15. Define ɛ - closure. 16. Describe FSM and its structure with an example. 17. State the Mathematical definition of Finite Automata 18. Construct DFA for even number of 1’s. 19. Define DFA mathematically. 20. Construct DFA for the language accepting strings which contains 001 as substring

Transcript of UNIT-I - TKRCET

UNIT-I

Short Questions

1. Define Automata.

2. Distinguish between DFA and NFA

3. Define String

4. Describe transition function of DFA.

5. Define ε–transitions.

6. Explain power of an alphabet (∑*).

7. List the applications of finite automata.

8. Describe Null string.

9. Define Kleene Star?

10. Define NFA with example.

11. Describe transition diagram for DFA accepting string ending with 00

12. Construct DFA for a string accepting odd number of 0’s.

13. Illustrate transition diagram for DFA to accept exactly one ‘a’ defined. over an alphabet

∑= {a,b}..

14. Construct DFA for odd number of 1’s.

15. Define ɛ - closure.

16. Describe FSM and its structure with an example.

17. State the Mathematical definition of Finite Automata

18. Construct DFA for even number of 1’s.

19. Define DFA mathematically.

20. Construct DFA for the language accepting strings which contains 001 as substring

Long Questions

1. Construct a DFA to accept set of all strings ending with 010.

2. Convert NFA with ɛ– a*b* to NFA.

3. Discuss various Differences between DFA and NFA.

4. Describe NFA with ɛ to NFA conversion with an example.

5. Construct a DFA, the language recognized by the Automaton being L={w/ w does not

contain the substring ab}.Draw the transition table.

6. Construct NFA for (0 + 1)*(00 + 11)(0 + 1)* and Convert to DFA.

7. Design DFA for the following languages shown below ∑ = { a,b} a) L={w/ w is any

string that doesn’t contain exactly two a} b) L={w/ w is any string except a and b}

8. Construct a DFA, the language recognized by the Automaton being L={w/ w contains

neither the substring ab nor ba}.Draw the transition table.

9. Construct a NFA over {a,b} which accepts string starts with ‘a’ and ends with ‘b’.

10. Define DFA?

Construct a DFA W{a,b}* where

na (w)≅0mod2 nb (w) ≅ 0 mod2

11. Differentiate DFA & NFA with example?

12. Construct a moore machine that takes set of all strings over{0,1} and produces ‘A’ as

output if input ends with’10’ and produces ‘B’ as output if input ends with’11’ otherwise

produces ‘C’.

13. Construct a DFA equivqlent to M=({q0,q1, q2,q3} , {0,1}, 8,q0,{q3})

14. Construct a moore machine that takes set of all strings over {a,b} as input and

prints”1”as output for every occurance of “a,b” as a substring.

15. Convert ∈-NFA to NFA

16. Design a mealy machine accepting the language consisting of strings from 휀* where

휀 ={a,b} and the strings should end with either aa (or)bb.

17. Construct a minimal DFA for L = {anb

m/n, m≥1}

18.Compare the DFA where

a. Strings starts with ‘a’

b. Strings end with ‘a’

c. Strings containing ‘a’.

19.Construct DFA for the regular expression (a+b)*abb.

20.Construct DFA which accepts multiples of 5.

UNIT-II

Short Questions

1. Define Regular Languages.

2. List any two applications of regular expression.

3. Define Pumping Lemma for Regular Languages.

4. Construct the Regular Expression for the empty string.

5. Describe regular expression for denoting language containing empty.

6. Construct the Regular Expression for the set of binary strings.

7. Define Regular Language ,Regular set.

8. Prove or disprove (p+q)*=(p*q*)*

9. List the advantages of regular expressions.

10. State regular expressions for the Set of strings over {0, 1} whose last two symbols are

the same.

11. Describe the regular language generated by regular expression (0+1)*001(0+1)*.

12. Describe the Regular Expression to generate at least one b over Σ ={a,b}

Long Questions

1. Convert Regular Expression (11+0)*(00+1)* to Finite Automata.

2. Show that following languages are not regular L={anbm | n, m andn<m } L={ anbm

cmdn | n, m } L={an | n is a perfect square }

3. Convert Regular Expression 01* + 1 to Finite Automata.

4. Discuss Identity rules. Simplify the Regular Expression - Є + 1*(011)*(1*(011)*)*.

5. Construct Regular grammar for the given Finite Automata.(a+b)*ab*.

6. Construct Regular grammar for the given Finite Automata 0*11(0+1)*

7. Explain about the closure properties of regular sets.

8. Construct Regular grammar for the given Finite Automata (0+1)*00(0+1)*

9. Convert Regular Expression (b+aa)*a* to Finite Automata.

10. State Pumping Lemma for Regular Languages with a suitable example.

11. Prove that (1+00*1)+(1+00*1)(0+10*1)*(0+10*1)is equal to 0*1 (0+10*1)

12. Find the regular expression for the following NFA

13. Illustrate briefly about Arden’s Theorem?

14. Define regular expression? Find out the regular expression whose length is at least 2

where 휀 ={a,b}

15. Minimize the given DFA

16. Find the regular expression for the follows DFA (When there are multiple final states)

17. What are the steps involved to perform equivalence of two finite automata. With an

example.

18.Convert the given regular expression to finite automata 10+(0+11)0*1.

19. Find out whether the following automata are equivalent or not

UNIT-III

Short Questions

1. Define CFG.

2. Discuss about parse tree with example.

3. Define Rightmost derivation with example.

4. Write a short notes about leftmost derivation with example.

5. Mention any two applications of Context Free Grammar.

6. What is sentential form?

7. What are different ways to derive a string from a CFG.

8. What is the language generated by CFG or G?

9. What is parse tree?

10. What is subtree.

11. If S->aSb | aAb , A->bAa , A->ba. Find out the CFL

12. What is ambiguous grammar?

13. Define nullable Variable

14. Explain the elimination of UNIT production.

15. Explain the elimination of useless symbols in productions

16. Write the minimization of CFG – S a S/A ,A a / B

17. Define the ambiguity in CFG.

18. Write the minimization of CFG - S aS1b, S1aS1b/ɛ.

19. Write the minimization of CFG – SAbA AAa/ ɛ.

20. Write the minimization of CFG – SaSa ,SbSb ,Sa/b/ ɛ.

21. Define PDA.

22. Define NPDA.

23. Differentiate between deterministic and nondeterministic PDA.

24. Explain acceptance of PDF by final state.

25. Explain acceptance of PDF by empty stack.

Long Questions

1. Construct Leftmost Derivation. , Rightmost Derivation, Derivation Tree for the

following grammar with respect to the string aaabbabbba.

S aB | bA

AaS| bAA|a

B bS | aBB | b

2. Construct leftmost and rightmost derivations for the strings, if the language

is given as SAS| ɛ

Aaa|ab|ba|bb

Strings: a) aabbba b) baabab c) aaabbb

3. Show that the following CFG ambiguous. SiCtS | iCtSeS | a, Cb.

4. Write the simplified CFG productions in S a S1b , S1 a S1b/ Є

5. Explain unit production? Explain the procedure to eliminate unit production.

6. Explain the procedure to eliminate ϵ-productions in grammar.

7.What is an ambiguous grammar? Prove that the Grammar

G =( { S }, {a.b }, S,S →aSb |bSa | SS |∈} is ambiguous.

8. Eliminate the unit productions from the given Grammar:

S → AB

A→a

B→ C|b

C→ D

D→ E|bc

E → d |Ab

9. Find CFG with no useless symbols equivalent to

S →AB | CA

A →a

B → BC| AB

C →aB| b &

Eliminate the ∈ production from the CFG given below

A → OB|1B|l ∈

B → OB|1B| ∈

10. Distinguish Between DPDA and NDPDA.

11. Design a PDA for 𝐿 = {w wR| w∈ {a,b}*}.

12. Construct CFG from PDA

Where A= ( { q0, q1 }, {a,b} , [z0,z}, 𝛿, q0, z0, ∅}

𝛿 ∶ 𝛿 (q0, b, z0) = (q0, zz0)

𝛿 (q0, b, z) = (q0, zz)

𝛿 (q1, b, z) = (q1, ∈)

𝛿 (q0, ∈, z0) = (q0, ∈)

𝛿 (q0, 𝑎, z) = (q1, 𝑧)

𝛿 (q1, 𝑎, z0) = (q0, z0)

13. Construct the PDA from the CFG S → asa

S → bsb

S → ∈

and test for the given string “abbcbba”.*

14.Design a PDA for L={WCWR

|Wε(a,b)+}

15.Design a PDA where L={anb

n |n>=1}U{a

nb

2n|n>=1}

UNIT-IV

Short Questions

1. What is the use of normalization?

2. What is the use of CNF and GNF.

3. Convert the grammar to CNF – SaSa/aa , SbSb/bb , S a/b.

4. Convert the grammar to CNF – SaAbB , AaA/a, BbB/a./ /.

5. Define Pumping Lemma for CFG.

6. What are the Closeure properties for CFG.

7. What are the Decision Properties of CFG.

8. Define Turing Machine.

9. Define Chomsky hierarchy of languages.

10. Define Context sensitive language.

11. Define Type 0 grammars

12. Define Type 1 grammars .

13. Define Type 2 grammars

14. Define Type 3 grammars .

15. List the types of grammars

16. Explain the moves in Turing Machine

17. Define an Instantaneous Description of a Turing Machine.

18. Define the Language of Turing Machine.

19. List types of TM.

20. Distinguish the difference between Pushdown Automata and Turing

21. Define multi head Turing Machine

22. Define multi dimensional Turing Machine

23. Define multiple tapes Turing Machine

24. Define Two way infinite Turing Machine

25. Define Non deterministic Turing Machine

26. Construct Turing Machine for 1’s complement for binary numbers

27. Construct Turing Machine for 2’s complement for binary numbers.

Long Questions

1. What is Normalization of CFG? What is the use of Normalization? Explain different

types of normal forms.

2. Write short notes on Chomsky Normal Form and Greibach Normal Form.

3. Discuss the Pumping lemma for Context Free Languages concept with example

a. {anb

nc

n where n>=0}.

4. Convert the following CFG into GNF.

i. SAA/a , A SS/b

5. Convert the following grammar into GNF G=({A1,A2,A3},{a,b},P,A)

a. A1A2A3 ,A2A3A1/b, A3A1A2/a.

6. Convert the following grammar into GNF

i. SABA/AB/BA/AA/B ,AaA/a, BbB/b

7. Define Chomsky’s normal form? Convert following grammar G into CNF where

a. G = ( { S,A,B,D}, {a,b,d} , P,S})

b. P: S→ aAD

1. A→ aB | bAB

2. B → b

ii. D → d

8. Prove L = { ai b

i c

i | i ≥ 1} is not context free language.

9. Design a CFG for the language 𝐿 ={ a4n

| n ≥1} and convert the CFG into CNF form.

10. Define closeure properties of context free grammar with proofs?

11. Define Greibach Normal form? Convert the following grammar into GNF where

i. P: S → AA|a

ii. A → SS|B

12. Prove that 𝐿 = { W W | w ∈ { 0,1} *} is not an context free language .

13. Prove L = { ai b

i c

i | i ≥ 1} is not context free language

14. Design a Turing machine for unary multiplication.

15. Design a Turing machine for 𝐿 = { an b

n |n≥ 1}

16. Explain Programming Techniques for Turing Machine?

17. Design a Turing machine for Unary addition.

18. Define a Turing Machine. With a neat diagram explain the working of a Turing

Machine.

19. Differentiate Turing Machine with other automata.

20. Construct a Transition diagram for Turing Machine to accept the language L= { w#wR |

w ϵ ( a + b ) *}

21. Construct a Transition diagram for Turing Machine to accept the language L= { wwR | w

ϵ ( a + b ) *}

22. Construct Transition table for TM L={anb

nc

n/n>=1}

23. Explain the power and limitations of Turing machine.

24. Construct Transition diagram for Turing Machine - L={anb

nc

n/n>=1}

25. Explain the power and limitations of Turing machine.

26. Explain the types of Turing machines.

27. Construct Transition diagram for Turing Machine that accepts the language L = {0n1n |

n ≥1}. Give the transition diagram for the Turing Machine obtained and also show the

moves made by the Turing machine for the string 000111.

28. Design a TM for Unary Subtraction.

29. Design a TM for Unary Division.

30. Design a TM for finding the half of the number.

UNIT-V

Short Questions

1. Define Recursive languages.

2. Define Recursively enumerable languages.

3. Differentiate Recursive languages and Recursively enumerable languages.

4. Explain Church’s Hypothesis.

5. Define Undecidability?

6. Define Decidability.

7. Define PCP.

8. Define P class.

9. Define NP class.

10. Define NP-Hard class.

11. Define NP-Complete class.

12. Define Context Sensitive Language..

Long Questions

1. Explain the Chomsky Hierarchy with a neat diagram.

2. Explain in detail the Universal Turing Machine.

3. Explain the following

a) Decidability

b) Post Correspondence Problem

c) Turing Reducibility

4. Explain P and NP Classes

5. Define NP-Complete and NP-Hard Problems

6. Explain some NP-Complete Problems in detail.

7. Write short notes on Recursive and Recursively Enumerable languages.

8. Write the properties of recursive and recursively enumerable languages

9. Define PCP problem? Does the PCP problem P={(10,101)(011,11)(101,011)} has a

solution If so, give the solution.

10. What is Turing Reducible Problem? Give an example.