Unit 3 - Practice Quiz

CSE322 50 Questions
0 Correct 0 Wrong 50 Left
0/50

1 What is the formal definition of a Grammar in Formal Language Theory?

A.
B.
C.
D.

2 In the grammar tuple , what does the intersection of and yield?

A. The set of all production rules
B. The start symbol
C. An empty set ()
D. The universal language

3 Which mathematical notation correctly denotes the language generated by a grammar ?

A.
B.
C.
D.

4 What is a 'derivation' in the context of formal grammars?

A. A sequence of production rule applications replacing non-terminals to generate a string
B. A graph showing the states of an automaton
C. The process of converting an NFA to a DFA
D. The complement of a regular language

5 In a leftmost derivation, which non-terminal is replaced at each step?

A. The rightmost non-terminal in the current sentential form
B. Any randomly chosen non-terminal
C. The leftmost non-terminal in the current sentential form
D. The start symbol only

6 What is a sentential form?

A. The final state of an accepting automaton
B. Any string in that can be derived from the start symbol
C. A string containing strictly terminal symbols
D. A production rule of the form

7 According to the Chomsky Hierarchy, Type 0 grammars generate which class of languages?

A. Recursively Enumerable Languages
B. Context-Sensitive Languages
C. Regular Languages
D. Context-Free Languages

8 Which type of grammar corresponds to Context-Free Languages in the Chomsky Hierarchy?

A. Type 3
B. Type 2
C. Type 1
D. Type 0

9 What is the proper subset relation defining the Chomsky hierarchy, where denotes Type languages?

A.
B.
C.
D.

10 What is the primary constraint on the production rules for a Type 1 (Context-Sensitive) grammar?

A. must be a single non-terminal
B.
C. must be strictly empty
D.

11 What is the only valid exception to the length-increasing rule () in a Context-Sensitive Grammar?

A. is allowed provided does not appear on the right side of any production
B. There are absolutely no exceptions
C. is allowed if is the last symbol of the string
D. Any non-terminal can derive once

12 What is the defining constraint on the production rules of a Type 2 (Context-Free) grammar?

A. The length of the left side must be less than the right side
B. The right-hand side must consist of exactly one terminal and one non-terminal
C. The left-hand side must consist of exactly one non-terminal
D. The left-hand side must contain at least one terminal

13 Which of the following describes the production rules for a Type 3 (Regular) grammar?

A. Rules must be of the form where
B. Rules must have exactly one non-terminal on the left and any string on the right
C. Rules can freely mix left-linear and right-linear forms in the same grammar
D. Rules must be strictly either right-linear or strictly left-linear

14 What is the only restriction on the production rules for a Type 0 (Unrestricted) grammar?

A. must contain at least one non-terminal
B. There are absolutely no restrictions on either or
C. cannot be empty
D. must strictly contain only terminals

15 Which computational model strictly corresponds to Recursively Enumerable (Type 0) languages?

A. Turing Machine
B. Finite Automaton
C. Pushdown Automaton
D. Linear Bounded Automaton

16 Which computational model strictly corresponds to Context-Sensitive (Type 1) languages?

A. Linear Bounded Automaton
B. Pushdown Automaton
C. Turing Machine
D. Finite Automaton

17 Which computational model strictly corresponds to Context-Free (Type 2) languages?

A. Pushdown Automaton
B. Linear Bounded Automaton
C. Finite Automaton
D. Turing Machine

18 Which computational model strictly corresponds to Regular (Type 3) languages?

A. Linear Bounded Automaton
B. Pushdown Automaton
C. Turing Machine
D. Finite Automaton

19 By definition, a language is called 'Recursive' if:

A. It requires infinite time to compute.
B. There exists a Turing Machine that halts on every input string, accepting if it is in and rejecting if it is not.
C. There exists a Turing Machine that accepts strings in but may loop forever on strings not in .
D. It can be recognized by a Finite Automaton.

20 By definition, a language is called 'Recursively Enumerable' (RE) if:

A. It can be parsed using a regular expression.
B. There exists a Turing Machine that halts and accepts if a string is in , but may loop indefinitely if the string is not in .
C. There exists a Turing Machine that always halts on all inputs.
D. It has a finite number of strings.

21 Which of the following is true regarding the complement of a Recursive language?

A. It is Recursively Enumerable but not Recursive.
B. It is never Recursive.
C. It is always Recursive.
D. It is always a Context-Free Language.

22 What can be said about the complement of a Recursively Enumerable (RE) language that is NOT Recursive?

A. It is always Recursive.
B. It is not Recursively Enumerable.
C. It is Regular.
D. It is strictly Context-Free.

23 What does Post's Theorem state regarding formal languages?

A. The intersection of two Context-Free languages is always Context-Free.
B. Every Regular language is Context-Free.
C. If a language is Context-Free, it must be Recursive.
D. If a language and its complement are both Recursively Enumerable, then is Recursive.

24 How is the Halting Problem classified in formal language theory?

A. It is a Regular Language.
B. It is Recursively Enumerable but not Recursive.
C. It is not even Recursively Enumerable.
D. It is Recursive.

25 The intersection of a Context-Free Language (CFL) and a Regular Language is always:

A. Regular
B. Context-Free
C. Context-Sensitive but not Context-Free
D. Recursively Enumerable only

26 Are Context-Free Languages (CFLs) closed under intersection?

A. No, the intersection is always Regular.
B. Yes, the intersection of two CFLs is always a CFL.
C. Yes, but only if they are ambiguous.
D. No, the intersection of two CFLs is not necessarily a CFL.

27 Which of the following describes the generic form of production rules in a Right-Linear Grammar?

A. only
B. or (where is a terminal string)
C.
D. or (where is a terminal string)

28 Which of the following describes the generic form of production rules in a Left-Linear Grammar?

A. or (where is a terminal string)
B.
C. or (where is a terminal string)
D. only

29 If a grammar freely mixes left-linear rules (e.g., ) and right-linear rules (e.g., ), what type of grammar is it?

A. Unrestricted Grammar strictly
B. Context-Sensitive Grammar strictly
C. Linear Grammar
D. Regular Grammar

30 Every valid Regular Grammar (either strictly right-linear or strictly left-linear) generates:

A. A strictly Finite Set
B. A Regular Set (Regular Language)
C. An undecidable language
D. A Context-Sensitive Language that is not Regular

31 Which operation are Regular Languages NOT necessarily closed under?

A. Intersection
B. Infinite Union
C. Finite Union
D. Complement

32 Which right-linear regular grammar correctly generates the regular expression ?

A.
B.
C.
D.

33 Which right-linear regular grammar correctly generates the regular expression ?

A.
B.
C.
D.

34 Which right-linear regular grammar correctly generates the regular expression ?

A.
B.
C.
D.

35 Arden's Theorem is primarily utilized for which of the following purposes in Formal Language Theory?

A. Minimizing the number of states in a DFA
B. Converting a Context-Free Grammar to Chomsky Normal Form
C. Converting a DFA or Regular Grammar into a Regular Expression
D. Proving that a language is not regular using the Pumping Lemma

36 Arden's Theorem states that for sets , and , the equation has a unique solution provided what condition is met?

A. does not contain the empty string
B. and are disjoint sets
C. is a finite language
D. does not contain the empty string

37 Under Arden's Theorem, if and does not contain , what is the unique solution for ?

A.
B.
C.
D.

38 For the language equation (which arises from right-linear grammars), if does not contain , what is the unique solution for ?

A.
B.
C.
D.

39 Convert the right-linear grammar into an equivalent Regular Expression.

A.
B.
C.
D.

40 Convert the left-linear grammar into an equivalent Regular Expression.

A.
B.
C.
D.

41 Find the regular expression for the right-linear grammar: , .

A.
B.
C.
D.

42 Find the regular expression for the grammar: , .

A.
B.
C.
D.

43 Is every Context-Free Language also a Regular Language?

A. No, Regular Languages are a strict subset of Context-Free Languages.
B. Yes, but only if it contains the empty string.
C. Yes, every Context-Free Language is Regular.
D. No, Context-Free Languages are a strict subset of Regular Languages.

44 Every Context-Free Language is also a:

A. Context-Sensitive Language
B. Regular Language
C. Finite Language
D. Linear Language

45 Which of the following languages is strictly Context-Free but NOT Regular?

A.
B.
C.
D.

46 Which of the following languages is Context-Sensitive but NOT Context-Free?

A.
B.
C.
D.

47 Two formal languages and are said to be equivalent if and only if:

A. They share at least one common string
B. They belong to the same Chomsky Hierarchy class
C. They contain exactly the same set of strings ()
D. They are generated by the exact same grammar rules

48 Which of the following statements about the union of Recursive and Recursively Enumerable languages is TRUE?

A. The union of a Recursive language and a Regular language is Context-Free.
B. The union of two Recursive languages is always Recursive.
C. The union of two Recursive languages is Recursively Enumerable but not Recursive.
D. The union of two RE languages is never RE.

49 What kind of grammar allows rules where the left-hand side can be any string containing at least one non-terminal, and the right-hand side can be shorter than the left-hand side?

A. Type 0 (Unrestricted Grammar)
B. Type 3 (Regular Grammar)
C. Type 2 (Context-Free Grammar)
D. Type 1 (Context-Sensitive Grammar)

50 Which automaton corresponds to a language formed by freely mixing left-linear and right-linear grammar rules (A Linear Grammar)?

A. Pushdown Automaton (specifically one-turn PDA)
B. Finite Automaton
C. Turing Machine only
D. Linear Bounded Automaton only