100% found this document useful (1 vote)
222 views19 pages

MCQs - CSE322

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
222 views19 pages

MCQs - CSE322

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

MCQs - CSE322

UNIT - 1
MCQs: Finite Automata
1. Which of the following automata is used to determine whether a given string
belongs to a regular language?
A. Pushdown Automata
B. Turing Machine
C. Finite Automaton
D. Linear Bounded Automaton
Answer: C. Finite Automaton
2. How does a DFA differ from an NDFA in terms of state transitions?
A. DFA allows multiple transitions for a single input symbol.
B. DFA allows epsilon transitions.
C. NDFA can have multiple transitions for a single input symbol.
D. NDFA cannot process alphabets.
Answer: C. NDFA can have multiple transitions for a single input symbol.
3. What does the term “closure” mean in the context of finite automata?
A. The automaton stops processing input.
B. A set of states reachable by epsilon moves.
C. All transitions lead to a single state.
D. The language accepted by the automaton is finite.
Answer: B. A set of states reachable by epsilon moves.
4. Which of the following statements is correct about equivalence of DFA and
NDFA?
A. Every DFA can be converted into an NDFA, but not vice versa.
B. DFA and NDFA are not equivalent in expressive power.
C. NDFA can always be converted into an equivalent DFA.
D. DFA has more computational power than NDFA.
Answer: C. NDFA can always be converted into an equivalent DFA.
5. In a transition graph of a finite automaton, what does a node represent?
A. An input symbol
B. A state of the automaton
C. A transition function
D. An accept state
Answer: B. A state of the automaton
6. What is the purpose of the minimization of finite automata?
A. To increase computational power
B. To reduce the size of the transition table
C. To make the automaton faster
D. To accept more languages
Answer: B. To reduce the size of the transition table
7. Which of the following properties is always true for a deterministic finite
automaton?
A. It can accept multiple languages simultaneously.
B. Every state must have a unique transition for each input symbol.
C. It must include epsilon transitions.
D. It can process context-sensitive languages.
Answer: B. Every state must have a unique transition for each input symbol.
8. Which machine includes both input and output but differs in the way output is
produced?
A. Mealy and Moore machines
B. DFA and NDFA
C. Turing machine and DFA
D. Pushdown automaton
Answer: A. Mealy and Moore machines
9. If a DFA has nn states, how many states can the equivalent NDFA have?
A. At least n2n^2
B. Exactly nn
C. At most nn
D. Unlimited
Answer: C. At most nn
10. In a Mealy machine, the output is produced based on:
A. The current state only
B. The input symbol only
C. The current state and input symbol
D. None of the above
Answer: C. The current state and input symbol
11. What is the significance of the alphabet in finite automata?
A. It defines the set of states.
B. It specifies the inputs that the automaton can process.
C. It controls the number of transitions.
D. It determines the type of automaton.
Answer: B. It specifies the inputs that the automaton can process.
12. Which property makes DFA equivalent to NDFA in terms of language recognition?
A. Deterministic state transitions
B. Null transitions
C. Accepting the same class of languages
D. Epsilon closures
Answer: C. Accepting the same class of languages
13. The process of combining equivalent states in a DFA is known as:
A. Transition mapping
B. Determinization
C. Minimization
D. State merging
Answer: C. Minimization
14. Which type of machine is preferred for generating outputs in real-time systems?
A. Moore Machine
B. Mealy Machine
C. Turing Machine
D. Pushdown Automaton
Answer: B. Mealy Machine
15. How are the languages accepted by a DFA represented?
A. Using regular expressions
B. Using context-free grammar
C. Using a pushdown automaton
D. Using Turing machines
Answer: A. Using regular expressions
16. Which of the following is NOT true for an NDFA?
A. It can have multiple initial states.
B. It can include epsilon transitions.
C. It can have multiple transitions for the same input symbol.
D. It accepts regular languages.
Answer: A. It can have multiple initial states.
17. Transition functions in DFA must:
A. Allow multiple outputs per state
B. Map every state and input symbol to a unique state
C. Use epsilon transitions
D. Include null states
Answer: B. Map every state and input symbol to a unique state
18. Which of the following is a necessary property of a regular language?
A. It must be finite.
B. It can be accepted by a finite automaton.
C. It can only be defined using context-free grammar.
D. It requires memory for processing.
Answer: B. It can be accepted by a finite automaton.
19. What is the role of the start state in finite automata?
A. It indicates where to stop processing.
B. It serves as the initial point for processing input strings.
C. It determines the number of input symbols.
D. It combines states into a single automaton.
Answer: B. It serves as the initial point for processing input strings.
20. What is the result of minimizing a finite automaton?
A. A new automaton with additional states
B. A smaller automaton with fewer states
C. An automaton that can accept more strings
D. A non-deterministic automaton
Answer: B. A smaller automaton with fewer states

UNIT - 2
MCQs: Regular Expressions and Regular Sets
1. What does a regular expression primarily describe?
A. Context-free languages
B. Pushdown automata
C. Regular languages
D. Recursive languages
Answer: C. Regular languages
2. Which of the following is NOT a component of a regular expression?
A. Union (|)
B. Concatenation (.)
C. Exponentiation
D. Kleene star (*)
Answer: C. Exponentiation
3. The language described by the regular expression (ab)∗ (ab)^* is:
A. Strings with alternating 'a' and 'b'
B. Strings starting with 'ab'
C. Strings that are multiples of "ab"
D. Strings containing 'a' or 'b'
Answer: C. Strings that are multiples of "ab"
4. The equivalence between regular expressions and finite automata is established
by:
A. Kleene’s theorem
B. Pumping lemma
C. Myhill-Nerode theorem
D. Arden’s theorem
Answer: A. Kleene’s theorem
5. What is the result of applying Kleene star (*) to a regular expression RR?
A. All strings of even length generated by RR
B. Only the empty string
C. All strings generated by RR including the empty string
D. Only strings of infinite length
Answer: C. All strings generated by RR including the empty string
6. What is the role of null moves (epsilon transitions) in finite automata?
A. To simplify state transitions
B. To add ambiguity to the automaton
C. To enable state transitions without consuming input symbols
D. To represent concatenation
Answer: C. To enable state transitions without consuming input symbols
7. The process of converting an NDFA with null moves to a DFA involves:
A. Removing all input symbols
B. Computing the epsilon-closure of each state
C. Adding more null transitions
D. Increasing the number of states arbitrarily
Answer: B. Computing the epsilon-closure of each state
8. What is Arden's theorem used for in the context of finite automata?
A. To minimize finite automata
B. To prove equivalence of DFA and NDFA
C. To solve equations involving regular expressions
D. To convert regular expressions into grammars
Answer: C. To solve equations involving regular expressions
9. What is the closure property of regular languages?
A. They are closed under context-sensitive operations.
B. They are closed under union, concatenation, and Kleene star.
C. They cannot be represented using regular expressions.
D. They are closed under infinite concatenation.
Answer: B. They are closed under union, concatenation, and Kleene star.
10. Which of the following is true about the pumping lemma for regular languages?
A. It can be used to prove a language is regular.
B. It can only prove a language is not regular.
C. It applies to context-free languages.
D. It guarantees regular languages are infinite.
Answer: B. It can only prove a language is not regular.
11. How are null moves (epsilon transitions) eliminated from an NDFA?
A. By converting the NDFA into a DFA
B. By merging states connected by null moves
C. By applying the pumping lemma
D. By creating equivalent regular expressions
Answer: A. By converting the NDFA into a DFA
12. What does the regular expression (a∣ b)∗ a(a|b)^*a represent?
A. Strings containing at least one 'a'
B. Strings ending in 'a'
C. Strings with 'a' and 'b' alternately
D. Strings starting with 'a'
Answer: B. Strings ending in 'a'
13. What is the purpose of the Myhill-Nerode theorem?
A. To minimize DFA
B. To prove that a language is not regular
C. To determine equivalence of states in an automaton
D. To convert regular expressions into DFA
Answer: C. To determine equivalence of states in an automaton
14. Which of the following operations can result in a non-regular language if applied
to regular languages?
A. Union
B. Concatenation
C. Intersection
D. Reversal
Answer: D. Reversal
15. What is the significance of regular expressions in finite automata?
A. They define the structure of a grammar.
B. They describe the language accepted by a finite automaton.
C. They minimize the states in finite automata.
D. They simplify null transitions.
Answer: B. They describe the language accepted by a finite automaton.
16. How is equivalence of two finite automata verified?
A. By comparing the number of states
B. By testing their acceptance of the same strings
C. By converting both to regular expressions
D. By using Arden's theorem
Answer: B. By testing their acceptance of the same strings
17. Which of the following is NOT true about regular expressions?
A. They are closed under union.
B. They cannot represent context-free languages.
C. They can describe infinite languages.
D. They cannot be converted into finite automata.
Answer: D. They cannot be converted into finite automata.
18. The transition system containing null moves is converted into:
A. A DFA with null moves
B. A regular grammar
C. An equivalent DFA without null moves
D. An NDFA without null moves
Answer: C. An equivalent DFA without null moves
19. Regular expressions are used to:
A. Describe context-sensitive grammars
B. Generate finite automata
C. Minimize DFA
D. Test the ambiguity of a grammar
Answer: B. Generate finite automata
20. Which language is generated by the regular expression 0∗ 1∗ 0^1^?
A. Strings with equal number of 0's and 1's
B. Strings where all 0's precede all 1's
C. Strings containing only 0's
D. Strings containing at least one 1
Answer: B. Strings where all 0's precede all 1's

UNIT - 3
MCQs: Formal Languages and Regular Grammars
1. What does the term "formal language" primarily refer to in computer science?
A. Natural languages used for communication
B. Precisely defined languages used for computational purposes
C. Ambiguous languages
D. Informal methods of representation
Answer: B. Precisely defined languages used for computational purposes
2. What does a grammar in formal language theory consist of?
A. A set of rules to derive sentences
B. A collection of state machines
C. A sequence of deterministic steps
D. A set of probabilistic outcomes
Answer: A. A set of rules to derive sentences
3. Which type of grammar generates regular languages?
A. Context-free grammar
B. Regular grammar
C. Context-sensitive grammar
D. Unrestricted grammar
Answer: B. Regular grammar
4. In the Chomsky hierarchy, where do context-free languages fall?
A. Type-0
B. Type-1
C. Type-2
D. Type-3
Answer: C. Type-2
5. Which of the following is true about left-linear and right-linear grammars?
A. Left-linear grammars can only generate finite languages.
B. Right-linear grammars can generate context-free languages.
C. Both describe regular languages.
D. Both describe context-sensitive languages.
Answer: C. Both describe regular languages.
6. What is the significance of Chomsky hierarchy?
A. To classify types of automata
B. To classify formal languages based on their generative power
C. To minimize state transitions in automata
D. To determine the computability of algorithms
Answer: B. To classify formal languages based on their generative power
7. Which type of grammar is most expressive in Chomsky hierarchy?
A. Regular grammar
B. Context-free grammar
C. Context-sensitive grammar
D. Unrestricted grammar
Answer: D. Unrestricted grammar
8. What is the relationship between recursive and recursively enumerable
languages?
A. Every recursive language is recursively enumerable.
B. Every recursively enumerable language is recursive.
C. They are equivalent.
D. They represent different formal language classes.
Answer: A. Every recursive language is recursively enumerable.
9. A grammar is considered ambiguous if:
A. It generates only one parse tree for a sentence.
B. It generates multiple parse trees for a sentence.
C. It cannot generate a parse tree.
D. It generates only finite languages.
Answer: B. It generates multiple parse trees for a sentence.
10. Which of the following represents a context-free grammar?
A. S→aSb∣ϵS \rightarrow aSb | \epsilon
B. S→aSbSS \rightarrow aSbS
C. S→aSS \rightarrow aS
D. S→aS \rightarrow a
Answer: A. S→aSb∣ϵS \rightarrow aSb | \epsilon
11. In a derivation tree, the root node represents:
A. The start symbol
B. A terminal symbol
C. A production rule
D. An intermediate symbol
Answer: A. The start symbol
12. Which operation is not closed in context-free languages?
A. Union
B. Intersection
C. Concatenation
D. Kleene star
Answer: B. Intersection
13. What does the term "language generated by a grammar" mean?
A. The set of all strings derivable from the start symbol
B. The set of all valid alphabets
C. The sequence of transitions in automata
D. The set of all terminals
Answer: A. The set of all strings derivable from the start symbol
14. What distinguishes regular grammars from context-free grammars?
A. Regular grammars can represent all recursive languages.
B. Context-free grammars allow more complex derivations.
C. Regular grammars are used for natural language processing.
D. Context-free grammars are less expressive than regular grammars.
Answer: B. Context-free grammars allow more complex derivations.
15. Which statement is true about converting regular expressions to regular
grammars?
A. Every regular expression can be converted into a regular grammar.
B. Only certain regular expressions can be converted into grammars.
C. Regular expressions and grammars are not related.
D. Regular expressions can represent context-free languages.
Answer: A. Every regular expression can be converted into a regular grammar.
16. The language of a grammar is finite if:
A. It has a finite number of rules.
B. It generates a finite number of strings.
C. It has a single terminal.
D. It is ambiguous.
Answer: B. It generates a finite number of strings.
17. Which of the following is a valid production rule in a context-free grammar?
A. A→BCA \rightarrow BC
B. AB→CAB \rightarrow C
C. A→aBbA \rightarrow aBb
D. a→ABa \rightarrow AB
Answer: C. A→aBbA \rightarrow aBb
18. Chomsky normal form requires production rules to be in the form:
A. A→BCA \rightarrow BC or A→aA \rightarrow a
B. A→B∣CA \rightarrow B | C
C. A→ABCA \rightarrow ABC
D. A→aBA \rightarrow aB
Answer: A. A→BCA \rightarrow BC or A→aA \rightarrow a
19. Which of the following is true about leftmost and rightmost derivations in a
context-free grammar?
A. They always yield different parse trees.
B. They describe different languages.
C. They may produce the same parse tree for the same string.
D. They cannot be used for ambiguous grammars.
Answer: C. They may produce the same parse tree for the same string.
20. What is the key distinction between recursive and recursively enumerable
languages?
A. Recursive languages are decidable, recursively enumerable languages are not.
B. Recursive languages are context-sensitive, recursively enumerable languages are
not.
C. Recursive languages include all context-free languages.
D. Recursive languages are less expressive than recursively enumerable languages.
Answer: A. Recursive languages are decidable, recursively enumerable languages are
not.

UNIT - 4
MCQs: Context-Free Languages and Grammar Simplification
1. What is a context-free language (CFL)?
A. A language defined by a regular grammar
B. A language accepted by a finite automaton
C. A language generated by a context-free grammar
D. A language accepted by a Turing machine
Answer: C. A language generated by a context-free grammar
2. In a context-free grammar, each production rule has the form:
A. A→BCA \rightarrow BC
B. A→aBA \rightarrow aB
C. A→αA \rightarrow \alpha, where α\alpha is a string of terminals and/or non-terminals
D. AB→CAB \rightarrow C
Answer: C. A→αA \rightarrow \alpha, where α\alpha is a string of terminals and/or non-
terminals
3. What is ambiguity in context-free grammars?
A. When the grammar generates no strings
B. When a string has multiple leftmost or rightmost derivations
C. When the grammar has more than one start symbol
D. When a grammar cannot produce an empty string
Answer: B. When a string has multiple leftmost or rightmost derivations
4. Which derivation starts with the start symbol and always replaces the leftmost
non-terminal first?
A. Rightmost derivation
B. Bottom-up derivation
C. Leftmost derivation
D. Ambiguous derivation
Answer: C. Leftmost derivation
5. Which normal form simplifies a context-free grammar by ensuring every
production is of the form A→BCA \rightarrow BC or A→aA \rightarrow a?
A. Chomsky Normal Form
B. Greibach Normal Form
C. Reduced Normal Form
D. Simplified Normal Form
Answer: A. Chomsky Normal Form
6. What does the Pumping Lemma for context-free languages help prove?
A. That a language is context-free
B. That a language is not context-free
C. That a grammar is ambiguous
D. That a language is recursive
Answer: B. That a language is not context-free
7. What is the primary purpose of grammar simplification?
A. To increase the number of production rules
B. To reduce ambiguity in the grammar
C. To convert the grammar to a deterministic one
D. To eliminate useless symbols, null productions, and unit productions
Answer: D. To eliminate useless symbols, null productions, and unit productions
8. A grammar is in Chomsky Normal Form if:
A. It contains only right-linear rules.
B. Every production is A→BCA \rightarrow BC or A→aA \rightarrow a.
C. It has no terminal symbols.
D. It contains only unit productions.
Answer: B. Every production is A→BCA \rightarrow BC or A→aA \rightarrow a.
9. Which type of derivation uses a parse tree to describe how a string is derived
from a grammar?
A. Leftmost derivation
B. Rightmost derivation
C. Tree-based derivation
D. Derivation tree
Answer: D. Derivation tree
10. What is the role of nullable symbols in grammar simplification?
A. They represent terminals in derivations.
B. They are symbols that can derive the empty string.
C. They create infinite derivations.
D. They simplify all productions.
Answer: B. They are symbols that can derive the empty string.
11. In Greibach Normal Form, every production rule is of the form:
A. A→BCA \rightarrow BC
B. A→aBA \rightarrow aB
C. A→aA \rightarrow a
D. A→aαA \rightarrow a\alpha, where α\alpha is a string of non-terminals
Answer: D. A→aαA \rightarrow a\alpha, where α\alpha is a string of non-terminals
12. Which of the following transformations is NOT a part of grammar simplification?
A. Removing null productions
B. Removing unit productions
C. Converting to Chomsky Normal Form
D. Adding new terminal symbols
Answer: D. Adding new terminal symbols
13. A context-free grammar is considered reduced if:
A. All productions are in Chomsky Normal Form
B. It has no useless symbols, no null productions, and no unit productions
C. It generates only one string
D. All derivations are leftmost
Answer: B. It has no useless symbols, no null productions, and no unit productions
14. Which of the following properties are context-free languages NOT closed under?
A. Union
B. Intersection
C. Concatenation
D. Kleene Star
Answer: B. Intersection
15. A grammar with no useless symbols ensures that:
A. Every non-terminal appears in some derivation.
B. Every terminal is used in all productions.
C. All rules are in Chomsky Normal Form.
D. The grammar is ambiguous.
Answer: A. Every non-terminal appears in some derivation.
16. What is a sentential form in context-free grammar?
A. A string containing only terminals
B. A string containing terminals and/or non-terminals derived from the start symbol
C. The final output of the grammar
D. A derivation tree
Answer: B. A string containing terminals and/or non-terminals derived from the start
symbol
17. What is the purpose of converting a CFG to Chomsky Normal Form?
A. To ensure ambiguity
B. To make parsing algorithms efficient
C. To simplify the derivations
D. To minimize the number of rules
Answer: B. To make parsing algorithms efficient
18. Which of the following cannot be eliminated during grammar simplification?
A. Useless symbols
B. Unit productions
C. Non-terminals
D. Nullable productions
Answer: C. Non-terminals
19. What does it mean for a CFG to be unambiguous?
A. It generates at most one parse tree for every string in the language.
B. It cannot generate the empty string.
C. It has no null productions.
D. It is equivalent to a regular grammar.
Answer: A. It generates at most one parse tree for every string in the language.
20. Why are unit productions removed during simplification?
A. To reduce the grammar to Chomsky Normal Form
B. To prevent infinite derivations
C. To avoid ambiguity
D. To simplify derivations and reduce redundancy
Answer: D. To simplify derivations and reduce redundancy

UNIT - 5
MCQs: Pushdown Automata and Parsing
1. What distinguishes a Pushdown Automaton (PDA) from a finite automaton?
A. PDA uses a stack for memory.
B. PDA processes regular languages.
C. PDA has no accepting states.
D. PDA does not use input symbols.
Answer: A. PDA uses a stack for memory.
2. What type of language is accepted by a PDA?
A. Regular languages
B. Context-free languages
C. Context-sensitive languages
D. Unrestricted languages
Answer: B. Context-free languages
3. A PDA is deterministic (DPDA) if:
A. It accepts regular languages only.
B. At most one move is possible for each input and stack symbol.
C. It cannot use epsilon transitions.
D. It requires more than one stack.
Answer: B. At most one move is possible for each input and stack symbol.
4. What is the significance of the stack in a PDA?
A. It limits the input length.
B. It provides additional memory for processing context-free languages.
C. It ensures the PDA is deterministic.
D. It accepts regular expressions.
Answer: B. It provides additional memory for processing context-free languages.
5. Which of the following languages cannot be accepted by a PDA?
A. L={anbn∣n≥0}L = {a^n b^n | n \geq 0}
B. L={anbmcn∣n,m≥0}L = {a^n b^m c^n | n, m \geq 0}
C. L={wwR∣w∈{a,b}∗}L = {w w^R | w \in {a, b}^}
D. L={anbncm∣n,m≥0}L = {a^n b^n c^m | n, m \geq 0}
Answer: C. L={wwR∣w∈{a,b}∗}L = {w w^R | w \in {a, b}^}
6. A PDA accepts a string by:
A. Reaching an accept state
B. Emptying its stack
C. Both A and B
D. None of the above
Answer: C. Both A and B
7. Which operation is not performed by a PDA stack?
A. Push
B. Pop
C. Peek
D. Append
Answer: D. Append
8. What is the difference between DPDA and NPDA in terms of computational
power?
A. DPDA can process more languages than NPDA.
B. NPDA can process more languages than DPDA.
C. DPDA and NPDA are computationally equivalent.
D. DPDA can process all context-sensitive languages.
Answer: B. NPDA can process more languages than DPDA.
9. Which of the following is true for a PDA?
A. It cannot have epsilon transitions.
B. It requires deterministic transitions.
C. It can have multiple transitions for the same input and stack symbol.
D. It does not use a stack.
Answer: C. It can have multiple transitions for the same input and stack symbol.
10. What is the purpose of parsing in the context of programming languages?
A. To convert high-level code into machine language
B. To analyze and derive the structure of a string based on a grammar
C. To optimize the code for better performance
D. To simplify the grammar of the language
Answer: B. To analyze and derive the structure of a string based on a grammar
11. What is a top-down parser?
A. A parser that starts from the leaves of the parse tree
B. A parser that begins with the start symbol and works downward
C. A parser that works without a stack
D. A parser that uses the Chomsky Normal Form
Answer: B. A parser that begins with the start symbol and works downward
12. Which type of parser uses a stack to derive strings from the grammar in a
bottom-up manner?
A. LL parser
B. LR parser
C. Recursive descent parser
D. Predictive parser
Answer: B. LR parser
13. Which property is true for context-free languages processed by PDAs?
A. They are closed under intersection.
B. They are closed under union.
C. They are closed under complement.
D. They are closed under concatenation.
Answer: B. They are closed under union.
14. An LL(1) grammar is used for:
A. Bottom-up parsing
B. Top-down parsing
C. Parsing ambiguous grammars
D. Deterministic PDA parsing
Answer: B. Top-down parsing
15. Which parser is more efficient for ambiguous grammars?
A. LL parser
B. LR parser
C. Recursive descent parser
D. Predictive parser
Answer: B. LR parser
16. How does a PDA differ from a Turing machine?
A. PDA uses finite memory, while Turing machines use infinite memory.
B. PDA can process all types of languages.
C. Turing machines cannot use a stack.
D. PDA does not have any transition rules.
Answer: A. PDA uses finite memory, while Turing machines use infinite memory.
17. What is the purpose of closure properties in context-free languages?
A. To simplify grammar rules
B. To determine whether a language is context-free
C. To describe operations under which context-free languages remain closed
D. To convert a context-free language to regular language
Answer: C. To describe operations under which context-free languages remain closed
18. What is the role of lookahead in LL(k) and LR(k) parsers?
A. To minimize stack usage
B. To determine the next parsing step based on the next kk input symbols
C. To eliminate ambiguity in grammars
D. To handle infinite grammars
Answer: B. To determine the next parsing step based on the next kk input symbols
19. Which of the following grammars can be processed by a deterministic PDA
(DPDA)?
A. Ambiguous grammars
B. All context-free grammars
C. Unambiguous context-free grammars
D. Regular grammars only
Answer: C. Unambiguous context-free grammars
20. What is the main limitation of a PDA?
A. It cannot handle regular languages.
B. It cannot process nested structures.
C. It cannot process context-sensitive languages.
D. It requires infinite states for context-free languages.
Answer: C. It cannot process context-sensitive languages.

UNIT - 6
MCQs: Turing Machines and Complexity
1. What is a Turing machine primarily used to model?
A. Regular languages
B. Context-free languages
C. Computational problems
D. Ambiguous grammars
Answer: C. Computational problems
2. Which component of a Turing machine serves as its memory?
A. The finite set of states
B. The input alphabet
C. The tape
D. The transition function
Answer: C. The tape
3. What is the halting problem in the context of Turing machines?
A. Determining whether a Turing machine will ever halt on a given input
B. Deciding whether a Turing machine is deterministic
C. Designing a Turing machine that does not halt
D. Optimizing the performance of a Turing machine
Answer: A. Determining whether a Turing machine will ever halt on a given input
4. What is the power of a linear bounded automaton compared to a Turing
machine?
A. Equal to Turing machines
B. Less powerful than Turing machines
C. More powerful than Turing machines
D. Equivalent to pushdown automata
Answer: B. Less powerful than Turing machines
5. Which type of Turing machine is equivalent in computational power to a standard
Turing machine?
A. Non-deterministic Turing machine
B. Multi-tape Turing machine
C. Universal Turing machine
D. All of the above
Answer: D. All of the above
6. A language is recursively enumerable if:
A. It is accepted by a deterministic Turing machine.
B. A Turing machine can list all valid strings in the language.
C. It is generated by a context-free grammar.
D. It is decidable.
Answer: B. A Turing machine can list all valid strings in the language.
7. What is the relationship between decidable and recursively enumerable
languages?
A. All decidable languages are recursively enumerable.
B. All recursively enumerable languages are decidable.
C. They are disjoint.
D. They are equivalent.
Answer: A. All decidable languages are recursively enumerable.
8. Which of the following problems is undecidable?
A. Membership problem for regular languages
B. Halting problem for Turing machines
C. Equivalence of finite automata
D. Emptiness of context-free languages
Answer: B. Halting problem for Turing machines
9. A variation of the Turing machine that uses multiple tapes is:
A. Deterministic Turing machine
B. Multi-tape Turing machine
C. Universal Turing machine
D. Non-deterministic Turing machine
Answer: B. Multi-tape Turing machine
10. What does the Post Correspondence Problem demonstrate?
A. The equivalence of pushdown automata and Turing machines
B. An example of an undecidable problem
C. The closure properties of context-free languages
D. An application of linear bounded automata
Answer: B. An example of an undecidable problem
11. The complexity class P refers to problems that:
A. Are solvable in polynomial time by a deterministic Turing machine
B. Are solvable in exponential time by a Turing machine
C. Require a non-deterministic Turing machine
D. Are undecidable
Answer: A. Are solvable in polynomial time by a deterministic Turing machine
12. What is the class NP in computational complexity?
A. Problems solvable in polynomial time by a deterministic Turing machine
B. Problems solvable in polynomial time by a non-deterministic Turing machine
C. Problems unsolvable by any Turing machine
D. Problems solvable in constant time
Answer: B. Problems solvable in polynomial time by a non-deterministic Turing
machine
13. Which of the following is true for NP-complete problems?
A. They are a subset of P problems.
B. They are the easiest problems in NP.
C. They are both in NP and as hard as any problem in NP.
D. They can be solved in logarithmic time.
Answer: C. They are both in NP and as hard as any problem in NP.
14. Which type of Turing machine can simulate any other Turing machine?
A. Multi-tape Turing machine
B. Universal Turing machine
C. Non-deterministic Turing machine
D. Deterministic Turing machine
Answer: B. Universal Turing machine
15. A recursively enumerable language is also recursive if:
A. It is undecidable.
B. It is accepted by a non-deterministic Turing machine.
C. The Turing machine always halts for every input.
D. The Turing machine uses multiple tapes.
Answer: C. The Turing machine always halts for every input.
16. What does the computational complexity measure?
A. The ambiguity of a grammar
B. The efficiency of an algorithm in terms of time and space
C. The number of states in an automaton
D. The size of the input alphabet
Answer: B. The efficiency of an algorithm in terms of time and space
17. The Church-Turing thesis states that:
A. Every problem can be solved by a Turing machine.
B. Every computational model is equivalent to the Turing machine.
C. Non-deterministic Turing machines are more powerful than deterministic ones.
D. Linear bounded automata are equivalent to Turing machines.
Answer: B. Every computational model is equivalent to the Turing machine.
18. Which of the following languages is undecidable?
A. Regular languages
B. Context-free languages
C. Recursive languages
D. Recursively enumerable languages that are not recursive
Answer: D. Recursively enumerable languages that are not recursive
19. What is the space complexity of an algorithm?
A. The amount of time required to execute the algorithm
B. The number of states in a Turing machine
C. The amount of memory required to solve a problem
D. The size of the input alphabet
Answer: C. The amount of memory required to solve a problem
20. What does it mean for a problem to be NP-hard?
A. It is in NP and P.
B. It is at least as hard as the hardest problems in NP.
C. It can be solved in polynomial time by a deterministic Turing machine.
D. It cannot be solved by any Turing machine.
Answer: B. It is at least as hard as the hardest problems in NP.

You might also like