MauryaHub PYQ Practice

cs3021_2026T2_Q2_NA.pdf

Theory of Computation · Quiz 2 · May 2026

← Course papers · Start practice / exam

Questions and published explanations below are available without starting a test. Some questions may not have a published solution yet.

Question 2 MCQ · 3.0 marks

Let [[IMAGE:b064f9a86b8421eb_2_2]] be recognized by a DFA [[IMAGE:b064f9a86b8421eb_2_3]] . A new DFA [[IMAGE:b064f9a86b8421eb_2_4]] is constructed from [[IMAGE:b064f9a86b8421eb_2_5]] by interchanging the accepting and non-accepting states. A student claims that [[IMAGE:b064f9a86b8421eb_2_6]] always recognizes [[IMAGE:b064f9a86b8421eb_2_7]] . Which of the following conditions is essential for the claim to be valid?
Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
  1. Every state of [[IMAGE:b064f9a86b8421eb_2_8]] must be reachable from the start state.
    Source diagram or notation
  2. [[IMAGE:b064f9a86b8421eb_2_9]] must have exactly one accepting state.
    Source diagram or notation
  3. The DFA must be complete (i.e., the transition function is defined for every state-symbol pair).
  4. [[IMAGE:b064f9a86b8421eb_2_10]] must not contain cycles.
    Source diagram or notation

A published solution is not available for this question yet.

Question 3 MCQ · 3.0 marks

Consider the language [[IMAGE:b064f9a86b8421eb_2_11]] A student proposes to prove that [[IMAGE:b064f9a86b8421eb_2_12]] is non-regular using the Pumping Lemma for regular languages. Which of the following best identifies the flaw in this approach?
Source diagram or notationSource diagram or notation
  1. The Pumping Lemma cannot be applied to languages containing two symbols.
  2. The language is regular because only the total length modulo [[IMAGE:b064f9a86b8421eb_3_13]] needs to be tracked, together with whether a [[IMAGE:b064f9a86b8421eb_3_14]] has already appeared.
    Source diagram or notationSource diagram or notation
  3. The language is context-free but not regular because [[IMAGE:b064f9a86b8421eb_3_15]] and [[IMAGE:b064f9a86b8421eb_3_16]] are unbounded.
    Source diagram or notationSource diagram or notation
  4. Pumping Lemma proofs require the selected string to contain equal numbers of 0s and 1s.

A published solution is not available for this question yet.

Question 4 MCQ · 3.0 marks

Consider the context-free grammar [[IMAGE:b064f9a86b8421eb_3_17]] . Which of the following best describes [[IMAGE:b064f9a86b8421eb_3_18]] ?
Source diagram or notationSource diagram or notation
  1. [[IMAGE:b064f9a86b8421eb_3_19]]
    Source diagram or notation
  2. [[IMAGE:b064f9a86b8421eb_3_20]]
    Source diagram or notation
  3. [[IMAGE:b064f9a86b8421eb_3_21]]
    Source diagram or notation
  4. [[IMAGE:b064f9a86b8421eb_3_22]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 5 MCQ · 3.0 marks

A PDA [[IMAGE:b064f9a86b8421eb_3_23]] recognizes a language [[IMAGE:b064f9a86b8421eb_3_24]] by final state. A new PDA [[IMAGE:b064f9a86b8421eb_3_25]] is obtained by declaring every non- final state of [[IMAGE:b064f9a86b8421eb_3_26]] to be final and every final state to be non-final. A student claims that [[IMAGE:b064f9a86b8421eb_4_27]] . Which of the following best explains why the claim is incorrect in general?
Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
  1. PDAs cannot have more than one final state.
  2. A string may have both accepting and rejecting computation paths in a nondeterministic PDA.
  3. Complementation changes the stack alphabet of a PDA.
  4. A PDA cannot recognize an infinite language after final states are interchanged.

A published solution is not available for this question yet.

Question 6 MCQ · 3.0 marks

A Turing Machine [[IMAGE:b064f9a86b8421eb_4_28]] has the following high-level behavior on input [[IMAGE:b064f9a86b8421eb_4_29]] : 1. Scan right and mark the leftmost unmarked symbol. 2. Move to the right end of the input. 3. Scan left to locate the rightmost unmarked symbol. 4. Reject if the two selected symbols are different. 5. Mark the rightmost symbol and return to the left end. 6. Repeat until no unmarked symbols remain. Which language is recognized by [[IMAGE:b064f9a86b8421eb_4_30]] ?
Source diagram or notationSource diagram or notationSource diagram or notation
  1. [[IMAGE:b064f9a86b8421eb_4_31]]
    Source diagram or notation
  2. [[IMAGE:b064f9a86b8421eb_4_32]]
    Source diagram or notation
  3. [[IMAGE:b064f9a86b8421eb_4_33]]
    Source diagram or notation
  4. [[IMAGE:b064f9a86b8421eb_4_34]]
    Source diagram or notation

A published solution is not available for this question yet.

Question 7 NAT · 3.0 marks

Consider the language [[IMAGE:b064f9a86b8421eb_5_35]] A DFA is constructed by independently tracking: • the length of the input modulo [[IMAGE:b064f9a86b8421eb_5_36]] , and • the parity of the number of 1s. After removing unreachable states, how many states are present in the DFA?
Source diagram or notationSource diagram or notation

    A published solution is not available for this question yet.

    Question 8 NAT · 3.0 marks

    Consider the regular expression [[IMAGE:b064f9a86b8421eb_5_37]] . Let [[IMAGE:b064f9a86b8421eb_5_38]] denote the number of distinct strings of length exactly [[IMAGE:b064f9a86b8421eb_5_39]] generated by [[IMAGE:b064f9a86b8421eb_5_40]] . What is the value of [[IMAGE:b064f9a86b8421eb_5_41]] ?
    Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation

      A published solution is not available for this question yet.

      Question 9 NAT · 3.0 marks

      Consider the context-free grammar [[IMAGE:b064f9a86b8421eb_6_42]] [[IMAGE:b064f9a86b8421eb_6_43]] [[IMAGE:b064f9a86b8421eb_6_44]] [[IMAGE:b064f9a86b8421eb_6_45]] [[IMAGE:b064f9a86b8421eb_6_46]] [[IMAGE:b064f9a86b8421eb_6_47]] . A variable is called useless if it does not participate in the derivation of any terminal string from the start variable [[IMAGE:b064f9a86b8421eb_6_48]] . How many useless variables are present in the grammar?
      Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation

        A published solution is not available for this question yet.

        Question 10 NAT · 3.0 marks

        A PDA begins with stack symbol [[IMAGE:b064f9a86b8421eb_6_49]] . While reading an input, it performs the following stack operations in order: 1. Replace [[IMAGE:b064f9a86b8421eb_6_50]] by [[IMAGE:b064f9a86b8421eb_6_51]] 2. Replace [[IMAGE:b064f9a86b8421eb_6_52]] by [[IMAGE:b064f9a86b8421eb_6_53]] 3. Replace [[IMAGE:b064f9a86b8421eb_6_54]] by [[IMAGE:b064f9a86b8421eb_6_55]] 4. Replace [[IMAGE:b064f9a86b8421eb_6_56]] by [[IMAGE:b064f9a86b8421eb_6_57]] 5. Replace [[IMAGE:b064f9a86b8421eb_6_58]] by [[IMAGE:b064f9a86b8421eb_6_59]] 6. Replace [[IMAGE:b064f9a86b8421eb_6_60]] by [[IMAGE:b064f9a86b8421eb_6_61]] Assume the leftmost symbol is the top of the stack. What is the height of the stack after all six operations, counting [[IMAGE:b064f9a86b8421eb_7_62]] ?
        Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation

          A published solution is not available for this question yet.

          Question 11 NAT · 3.0 marks

          A two-tape Turing Machine performs [[IMAGE:b064f9a86b8421eb_7_63]] computational steps. A single-tape simulation represents the contents of both tapes on one tape. To simulate the [[IMAGE:b064f9a86b8421eb_7_64]] -th step of the two-tape machine, the single-tape machine performs exactly [[IMAGE:b064f9a86b8421eb_7_65]] transitions. If the two-tape machine performs exactly [[IMAGE:b064f9a86b8421eb_7_66]] steps, how many transitions are performed by the single-tape simulation?
          Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation

            A published solution is not available for this question yet.

            Question 12 MSQ · 3.0 marks

            Let [[IMAGE:b064f9a86b8421eb_8_67]] and [[IMAGE:b064f9a86b8421eb_8_68]] be arbitrary regular languages over the same alphabet [[IMAGE:b064f9a86b8421eb_8_69]] . Define [[IMAGE:b064f9a86b8421eb_8_70]] . Which of the following statements are necessarily TRUE?
            Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
            1. [[IMAGE:b064f9a86b8421eb_8_71]] is regular.
              Source diagram or notation
            2. If [[IMAGE:b064f9a86b8421eb_8_72]] , then [[IMAGE:b064f9a86b8421eb_8_73]] .
              Source diagram or notationSource diagram or notation
            3. [[IMAGE:b064f9a86b8421eb_8_74]] can be recognized using a finite automaton.
              Source diagram or notation
            4. If [[IMAGE:b064f9a86b8421eb_8_75]] , then [[IMAGE:b064f9a86b8421eb_8_76]] .
              Source diagram or notationSource diagram or notation

            A published solution is not available for this question yet.

            Question 13 MSQ · 3.0 marks

            Let [[IMAGE:b064f9a86b8421eb_8_77]] . Suppose there exist infinitely many strings [[IMAGE:b064f9a86b8421eb_8_78]] such that for every [[IMAGE:b064f9a86b8421eb_8_79]] , there exists a string [[IMAGE:b064f9a86b8421eb_8_80]] satisfying exactly one of [[IMAGE:b064f9a86b8421eb_8_81]] and [[IMAGE:b064f9a86b8421eb_8_82]] belongs to [[IMAGE:b064f9a86b8421eb_8_83]] . Which of the following conclusions are valid?
            Source diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notationSource diagram or notation
            1. [[IMAGE:b064f9a86b8421eb_8_84]] is not regular.
              Source diagram or notation
            2. No finite-state deterministic automaton can recognize [[IMAGE:b064f9a86b8421eb_8_85]] .
              Source diagram or notation
            3. [[IMAGE:b064f9a86b8421eb_8_86]] has infinitely many Nerode equivalence classes.
              Source diagram or notation
            4. [[IMAGE:b064f9a86b8421eb_8_87]] cannot be context-free.
              Source diagram or notation

            A published solution is not available for this question yet.

            Question 14 MSQ · 3.0 marks

            Let [[IMAGE:b064f9a86b8421eb_9_88]] be an arbitrary context-free language and let [[IMAGE:b064f9a86b8421eb_9_89]] be an arbitrary regular language over the same alphabet [[IMAGE:b064f9a86b8421eb_9_90]] . Which of the following languages are necessarily context-free?
            Source diagram or notationSource diagram or notationSource diagram or notation
            1. [[IMAGE:b064f9a86b8421eb_9_91]]
              Source diagram or notation
            2. [[IMAGE:b064f9a86b8421eb_9_92]]
              Source diagram or notation
            3. [[IMAGE:b064f9a86b8421eb_9_93]]
              Source diagram or notation
            4. [[IMAGE:b064f9a86b8421eb_9_94]]
              Source diagram or notation

            A published solution is not available for this question yet.

            Question 15 MSQ · 3.0 marks

            Let [[IMAGE:b064f9a86b8421eb_9_95]] and [[IMAGE:b064f9a86b8421eb_9_96]] Which of the following statements are TRUE?
            Source diagram or notationSource diagram or notation
            1. [[IMAGE:b064f9a86b8421eb_9_97]] is Turing-recognizable.
              Source diagram or notation
            2. [[IMAGE:b064f9a86b8421eb_9_98]] is decidable.
              Source diagram or notation
            3. [[IMAGE:b064f9a86b8421eb_9_99]] is Turing-recognizable.
              Source diagram or notation
            4. If [[IMAGE:b064f9a86b8421eb_9_100]] were decidable, every Turing-recognizable language would be decidable.
              Source diagram or notation
            5. The complement of [[IMAGE:b064f9a86b8421eb_10_101]] is Turing-recognizable.
              Source diagram or notation

            A published solution is not available for this question yet.

            Question 16 MSQ · 4.0 marks

            Consider the language [[IMAGE:b064f9a86b8421eb_10_102]] . A student argues: "L is context-free because the condition [[IMAGE:b064f9a86b8421eb_10_103]] can be checked by one PDA and the condition [[IMAGE:b064f9a86b8421eb_10_104]] can be checked by another PDA. Therefore, a PDA can check both conditions." Which of the following statements correctly analyze the argument?
            Source diagram or notationSource diagram or notationSource diagram or notation
            1. The language is [[IMAGE:b064f9a86b8421eb_10_105]] .
              Source diagram or notation
            2. The student's argument incorrectly assumes that CFLs are closed under intersection.
            3. The language can be recognized by a Linear Bounded Automaton.
            4. The language is context-free because each equality can independently be checked using a stack.
            5. The language is context-sensitive.

            A published solution is not available for this question yet.

            Question 17 MSQ · 4.0 marks

            For a Turing Machine [[IMAGE:b064f9a86b8421eb_10_106]] , define [[IMAGE:b064f9a86b8421eb_10_107]] Also define [[IMAGE:b064f9a86b8421eb_10_108]] Which of the following statements are TRUE?
            Source diagram or notationSource diagram or notationSource diagram or notation
            1. Whether [[IMAGE:b064f9a86b8421eb_11_109]] is empty is a property of the language recognized by [[IMAGE:b064f9a86b8421eb_11_110]] .
              Source diagram or notationSource diagram or notation
            2. Rice's Theorem can be used to conclude that [[IMAGE:b064f9a86b8421eb_11_111]] is undecidable.
              Source diagram or notation
            3. [[IMAGE:b064f9a86b8421eb_11_112]] is Turing-recognizable.
              Source diagram or notation
            4. [[IMAGE:b064f9a86b8421eb_11_113]] is Turing-recognizable because a Turing Machine can simulate [[IMAGE:b064f9a86b8421eb_11_114]] on every possible input.
              Source diagram or notationSource diagram or notation
            5. If both [[IMAGE:b064f9a86b8421eb_11_115]] and [[IMAGE:b064f9a86b8421eb_11_116]] were Turing-recognizable, then [[IMAGE:b064f9a86b8421eb_11_117]] would be decidable.
              Source diagram or notationSource diagram or notationSource diagram or notation

            A published solution is not available for this question yet.