PYQs

Formal language & automata theory

2 papers · 105503

2022105503

End Semester Examination - 2022

03 Hours70 marks

Instructions

  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option of the following (Any seven question only):

Ask AI
  1. Q1.1

    The language $ \{a^m b^n c^{m+n} / m, n \ge 1\} $ is

    a)

    regular

    b)

    context-free but not regular

    c)

    Context-sensitive but not context free

    d)

    type-0 but not context sensitive

    Ask AI
  2. Q1.2

    Which of the following pairs have DIFFERENT expressive powers?

    a)

    Deterministic finite automata (DFA) and non-deterministic finite automata (NDFA)

    b)

    Deterministic push-down automata (DPDA) and non-deterministic push-down automata (NDPDA)

    c)

    Deterministic single-tape Turing machine and non-deterministic single-tape Turing machine

    d)

    Single-tape Turing machine and multi-tape Turing machine

    Ask AI
  3. Q1.3

    The logic of pumping lemma is a good example of

    a)

    pigeon-hole principle

    b)

    divide-and-conquer technique

    c)

    recursion

    d)

    iteration

    Ask AI
  4. Q1.4

    If $ L_1 $ and $ L_2 $ are context free languages, $ L_1 - L_2 $ is

    a)

    always context-free.

    b)

    sometimes

    c)

    never

    d)

    None of these

    Ask AI
  5. Q1.5

    _____ is the acyclic graphical representation of a grammer.

    a)

    Binary tree

    b)

    Octtree

    c)

    Parse tree

    d)

    None of the above

    Ask AI
  6. Q1.6

    Which of the following pairs of regular expressions are equivalent?

    a)

    x∗x^* and x∗xx^*x

    b)

    1(01)1(01) and (10)∗1(10)^*1

    c)

    x(xx)∗x(xx)^* and (xx)∗x(xx)^*x

    d)

    All of the above

    Ask AI
  7. Q1.7

    The maximum number of states of a DFA converted from an NFA with $ n $ states is

    a)

    nn

    b)

    n2n^2

    c)

    2n2^n

    d)

    None of these

    Ask AI
  8. Q1.8

    Definition of a language L with alphabet {a} is given as $ L = \{a^{nk} / k > 0 \}, $ and n is a positive integer constant. What is the minimum number of states needed in a DFA to recognize L?

    a)

    k+1k + 1

    b)

    n+1n + 1

    c)

    2n+12n + 1

    d)

    2k+12k + 1

    Ask AI
  9. Q1.9

    A _____ is context free grammar with atmost one non-terminal in the right handside of the production.

    a)

    linear grammar

    b)

    linear bounded grammar

    c)

    regular grammar

    d)

    None of the above

    Ask AI
  10. Q1.10

    Let N be an NFA with $ n $ states and let M be the minimized DFA with $ m $ states recognizing the same language. Which of the following is necessarily true?

    a)

    m≤2nm \le 2^n

    b)

    n≤mn \le m

    c)

    M has one accept state

    d)

    m=2nm = 2^n

    Ask AI

Q.2 Solve both questions :

Ask AI
  1. Q2.1

    Tabulate Chomsky hierarchy of grammars with an example for each.

    Ask AI
  2. Q2.2

    Construct the regular grammar accepting the following language: $ L = \{w \in \{a,b\}^* / w \text{ is a string over } \{a, b\} \text{ such that the number of b's is } 3 \mod 4\} $

    Ask AI

Q.3 Solve both questions :

Ask AI
  1. Q3.1

    Minimize the DFA.

    Question Diagram
    Ask AI
  2. Q3.2

    Define recursively enumerable languages. Let $ L_1 $ be recursive and $ L_2 $ recursively enumerable. Show that $ L_2 - L_1 $ is necessarily recursively enumerable.

    Ask AI

Q.4 Solve this question :

Ask AI
  1. Q4.1

    Begin with the grammar: $ S \rightarrow ASB/\epsilon $, $ A \rightarrow aAS/a $, $ B \rightarrow SbS/A/bb $
    (i) Eliminate $ \epsilon $-productions.
    (ii) Eliminate unit productions in the resulting grammar.
    (iii) Eliminate any useless symbol in the resulting grammar.
    (iv) Put the resulting grammar into CNF.

    Ask AI

Q.5 Solve both questions :

Ask AI
  1. Q5.1

    Design a pushdown automata to accept the following language by empty stack: $ \{0^n 1^n / n \ge 1\} $.

    Ask AI
  2. Q5.2

    Define deterministic pushdown automata. Explain with an example.

    Ask AI

Q.6 Solve both questions :

Ask AI
  1. Q6.1

    Prove using pumping lemma for regular languages that the language $ \{0^n / n \text{ is a perfect square}\} $ is not regular.

    Ask AI
  2. Q6.2

    Convert the following DFA to regular expression using the state elimination technique.

    State / input 0 1
    → *p s p
    q p s
    r r q
    s q r
    Ask AI

Q.7 Solve both questions :

Ask AI
  1. Q7.1

    Convert the following NFA to DFA and informally describe the language it accepts.

    State / input 0 1
    p {p, q} {p}
    q {r, s} {t}
    r {p, r} {t}
    s ∅ ∅
    *t ∅ ∅
    Ask AI
  2. Q7.2

    When a CFG is called ambiguous? Show that $ S \rightarrow aS / aSbS / \epsilon $ is ambiguous.

    Ask AI

Q.8 Solve both questions :

Ask AI
  1. Q8.1

    Define Turing machine. Design a Turing machine M to recognize the language $ \{1^n 2^n 3^n / n \ge 1\} $.

    Ask AI
  2. Q8.2

    Construct DFA equivalent to the regular expression: $ (0+1)^*(00+11)(0+1)^* $

    Ask AI

Q.9 Write short notes on any two of the following:

Ask AI
  1. Q9.1

    a)

    Pumping lemma for CFL

    b)

    GNF

    c)

    Multistack Turing Machine

    d)

    NP-hard problem

    Ask AI

2022V4105503

End Semester Examination - 2022

03 Hours70 marks

Instructions

  • The marks are indicated in the right-hand margin.
  • There are NINE questions in this paper.
  • Attempt FIVE questions in all.
  • Question No. 1 is compulsory.

Q.1 Choose the correct option of the following (Any seven question only):

Ask AI
  1. Q1.1

    The language $ \\{a^m b^n c^{m+n} / m, n \ge 1\\} $ is

    a)

    regular

    b)

    context-free but not regular

    c)

    Context-sensitive but not context free

    d)

    type-0 but not context sensitive

    Ask AI
  2. Q1.2

    Which of the following pairs have DIFFERENT expressive powers?

    a)

    Deterministic finite automata (DFA) and non-deterministic finite automata (NDFA)

    b)

    Deterministic push-down automata (DPDA) and non-deterministic push-down automata (NDPDA)

    c)

    Deterministic single-tape Turing machine and non-deterministic single-tape Turing machine

    d)

    Single-tape Turing machine and multi-tape Turing machine

    Ask AI
  3. Q1.3

    The logic of pumping lemma is a good example of

    a)

    pigeon-hole principle

    b)

    divide-and-conquer technique

    c)

    recursion

    d)

    iteration

    Ask AI
  4. Q1.4

    If $ L_1 $ and $ L_2 $ are context free languages, $ L_1 - L_2 $ is

    a)

    always context-free.

    b)

    sometimes

    c)

    never

    d)

    None of these

    Ask AI
  5. Q1.5

    _____ is the acyclic graphical representation of a grammer.

    a)

    Binary tree

    b)

    Octtree

    c)

    Parse tree

    d)

    None of the above

    Ask AI
  6. Q1.6

    Which of the following pairs of regular expressions are equivalent?

    a)

    x∗x^* and x∗xx^*x

    b)

    1(01)1(01) and (10)∗1(10)^*1

    c)

    x(xx)∗x(xx)^* and (xx)∗x(xx)^*x

    d)

    All of the above

    Ask AI
  7. Q1.7

    The maximum number of states of a DFA converted from an NFA with $ n $ states is

    a)

    nn

    b)

    n2n^2

    c)

    2n2^n

    d)

    None of these

    Ask AI
  8. Q1.8

    Definition of a language L with alphabet {a} is given as $ L = \\{a^{nk} / k > 0 \\}, $ and n is a positive integer constant. What is the minimum number of states needed in a DFA to recognize L?

    a)

    k+1k + 1

    b)

    n+1n + 1

    c)

    2n+12n + 1

    d)

    2k+12k + 1

    Ask AI
  9. Q1.9

    A _____ is context free grammar with atmost one non-terminal in the right handside of the production.

    a)

    linear grammar

    b)

    linear bounded grammar

    c)

    regular grammar

    d)

    None of the above

    Ask AI
  10. Q1.10

    Let N be an NFA with $ n $ states and let M be the minimized DFA with $ m $ states recognizing the same language. Which of the following is necessarily true?

    a)

    m≤2nm \le 2^n

    b)

    n≤mn \le m

    c)

    M has one accept state

    d)

    m=2nm = 2^n

    Ask AI

Q.2 Solve both questions :

Ask AI
  1. Q2.1

    Tabulate Chomsky hierarchy of grammars with an example for each.

    Ask AI
  2. Q2.2

    Construct the regular grammar accepting the following language: $ L = \\{w \in \\{a,b\\}^* / w \text{ is a string over } \\{a, b\\} \text{ such that the number of b's is } 3 \mod 4\\} $

    Ask AI

Q.3 Solve both questions :

Ask AI
  1. Q3.1

    Minimize the DFA.

    Question Diagram
    Ask AI
  2. Q3.2

    Define recursively enumerable languages. Let $ L_1 $ be recursive and $ L_2 $ recursively enumerable. Show that $ L_2 - L_1 $ is necessarily recursively enumerable.

    Ask AI

Q.4 Solve this question :

Ask AI
  1. Q4.1

    Begin with the grammar: $ S \rightarrow ASB/\epsilon $, $ A \rightarrow aAS/a $, $ B \rightarrow SbS/A/bb $
    (i) Eliminate $ \epsilon $-productions.
    (ii) Eliminate unit productions in the resulting grammar.
    (iii) Eliminate any useless symbol in the resulting grammar.
    (iv) Put the resulting grammar into CNF.

    Ask AI

Q.5 Solve both questions :

Ask AI
  1. Q5.1

    Design a pushdown automata to accept the following language by empty stack: $ \\{0^n 1^n / n \ge 1\\} $.

    Ask AI
  2. Q5.2

    Define deterministic pushdown automata. Explain with an example.

    Ask AI

Q.6 Solve both questions :

Ask AI
  1. Q6.1

    Prove using pumping lemma for regular languages that the language $ \\{0^n / n \text{ is a perfect square}\\} $ is not regular.

    Ask AI
  2. Q6.2

    Convert the following DFA to regular expression using the state elimination technique.

    State / input 0 1
    → *p s p
    q p s
    r r q
    s q r
    Ask AI

Q.7 Solve both questions :

Ask AI
  1. Q7.1

    Convert the following NFA to DFA and informally describe the language it accepts.

    State / input 0 1
    p {p, q} {p}
    q {r, s} {t}
    r {p, r} {t}
    s ∅ ∅
    *t ∅ ∅
    Ask AI
  2. Q7.2

    When a CFG is called ambiguous? Show that $ S \rightarrow aS / aSbS / \epsilon $ is ambiguous.

    Ask AI

Q.8 Solve both questions :

Ask AI
  1. Q8.1

    Define Turing machine. Design a Turing machine M to recognize the language $ \\{1^n 2^n 3^n / n \ge 1\\} $.

    Ask AI
  2. Q8.2

    Construct DFA equivalent to the regular expression: $ (0+1)^*(00+11)(0+1)^* $

    Ask AI

Q.9 Write short notes on any two of the following:

Ask AI

Support BEUConnect

Contributions cover the domain and hosting.

UPI QR code for pritkr@cnrb
pritkr@cnrb

Add to home screen

  1. Tap Share in Safari.
  2. Choose Add to Home Screen.