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. An empty set ()
B. The start symbol
C. The set of all production rules
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. The process of converting an NFA to a DFA
C. The complement of a regular language
D. A graph showing the states of an automaton

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

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

6 What is a sentential form?

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

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

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

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

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

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.
B.
C. must be a single non-terminal
D. must be strictly empty

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. Any non-terminal can derive once
C. is allowed if is the last symbol of the string
D. There are absolutely no exceptions

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

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

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

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

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. cannot be empty
C. must strictly contain only terminals
D. There are absolutely no restrictions on either or

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

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

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

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

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

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

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

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

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

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

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

A. There exists a Turing Machine that halts and accepts if a string is in , but may loop indefinitely if the string is not in .
B. There exists a Turing Machine that always halts on all inputs.
C. It can be parsed using a regular expression.
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 always Recursive.
B. It is never Recursive.
C. It is Recursively Enumerable but not 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 not Recursively Enumerable.
B. It is always Recursive.
C. It is strictly Context-Free.
D. It is Regular.

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

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

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

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

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

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

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

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

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

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

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. or (where is a terminal string)
C.
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. Linear Grammar
B. Regular Grammar
C. Unrestricted Grammar strictly
D. Context-Sensitive Grammar strictly

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

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

31 Which operation are Regular Languages NOT necessarily closed under?

A. Infinite Union
B. Finite Union
C. Intersection
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. Converting a DFA or Regular Grammar into a Regular Expression
B. Minimizing the number of states in a DFA
C. Converting a Context-Free Grammar to Chomsky Normal Form
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. does not contain the empty string
C. and are disjoint sets
D. is a finite language

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, every Context-Free Language is Regular.
C. Yes, but only if it contains the empty string.
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. Linear Language
D. Finite 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 contain exactly the same set of strings ()
B. They are generated by the exact same grammar rules
C. They share at least one common string
D. They belong to the same Chomsky Hierarchy class

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

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

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 1 (Context-Sensitive Grammar)
C. Type 2 (Context-Free Grammar)
D. Type 3 (Regular 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. Linear Bounded Automaton only
D. Turing Machine only