Question
Question
o A) S -> aS | ε
o C) S -> aaS | ε
2. Which of the following is the first step in converting a regular grammar into a
regular expression?
o A) ab*
o B) a+b
o C) a*b
o D) a*bb
4. Which of the following is the regular expression for the grammar S -> aA ,
A->bS | ε?
o A) ab*
o B) (ab)*
o C) (a|b)*
o D) a*b*
5. What is the equivalent regular expression for the regular grammar S -> aS |
bA, A -> a | b?
o A) (a|b)*
o B) a*b
o C) ab*
o D) (a|b)(a|b)
o A) a*b*
o B) ab*
o C) a+b+
o D) (ab)*
7. To convert the regular expression a*b into a regular grammar, which of the
following production rules is correct?
o A) S -> aS | b
o A) a*b
o B) b*a
o C) ab*
o D) b*a
9. Given the regular expression (a|b)*, which set of production rules best
describes the equivalent regular grammar?
o A) S -> aS | bS | ε
o C) S -> abS | aS
o D) S -> aS | Bs
10. Which of the following is the correct grammar for the regular expression
(ab)*?
o A) S -> aA, A -> bS | ε
o B) S -> aS | b
o C) S -> abS | ε
o D) S -> ab | ba
11. How does the concept of nullable symbols a ect the conversion of a regular
expression into a regular grammar?
12. Which regular expression corresponds to the following grammar: S -> aA, A -
> bS | ε?
o A) ab*
o B) (ab)*
o C) (a|b)*
o D) a*b
13. Converting the regular expression (a|b)b into a regular grammar would result
in which of the following?
o B) S -> aS | bS
o D) S -> b | aS
14. For the regular expression a+, what is the correct regular grammar?
o A) S -> aS | a
o B) S -> aS | ε
o C) S -> aS | b
o D) S -> a | ε
15. For the grammar S -> aA |b , A -> aS, which regular expression is correct?
o A) (a^n)b
o B) (aa)*
o C) (ab)*
o D) (a|b)*
o A) Type 3
o B) Type 2
o C) Type 1
o D) Type 0
o A) S -> 1B
o B) A -> 000
o C) S -> C
o D) B -> 11
18. After removing the unit production S -> C, what new production is added to
S?
o A) S -> 0A
o B) S -> 01
o C) S -> 1B
o D) S -> 000
19. What happens to the production B -> A when unit productions are removed?
o B) B -> 11|A.
o C) B -> 11 | 0S | 000.
o D) B -> 000.
20. Which of the following is the correct form of the grammar after eliminating
unit productions?
21. What does the final grammar without unit productions ensure?
C) Implementing LR parsers
B) It must be deterministic.
Q27. The relation between recursively enumerable sets and recursive sets is such that:
A) Regular languages.
B) Context-free languages.
C) Context-sensitive languages.
A) Recursive.
B) Recursively enumerable.
C) Context-free.
D) Regular.
_________________________________________________________________________________
_________________________________________________________________________________
Questions:
o B) The set of strings derivable from the start symbol using production
rules.
2. Which of the following is the most general class in the Chomsky hierarchy?
o A) Regular languages
o B) Context-free languages
o C) Context-sensitive languages
o D) Recursively enumerable languages
o A) Context-sensitive languages
o B) Context-free languages
o C) Regular languages
o D) Recursive languages
o C) Implementing LR parsers.
o B) It must be deterministic.
13. The relation between recursively enumerable sets and recursive sets is such
that:
o A) Recursive
o B) Recursively enumerable
o C) Context-free
o D) Regular
15. Which of the following operations is not closed for context-free languages?
o A) Union
o B) Intersection
o C) Concatenation
o D) Kleene star
o A) Always context-free
o C) Never context-free
o D) Context-sensitive
17. Which of the following statements is true for languages in the Chomsky
hierarchy?
o A) Ambiguity
o C) Context-sensitive rules
o A) The right-hand side of any production can have at most two non-
terminals.
21-25. Consider the Grammar G: S -> ABCd, A -> bC, B -> bb | ε, C -> c | ε. Find all of
the nullable variables & remove null productions.
o A) B -> bb
o B) B -> ε
o C) B -> bb | ε
o D) B -> b
o A) C -> c
o B) C -> ε
o C) C -> c | ε
o D) C -> c | b
o A) S -> ABCd
o C) S -> ABCd | Ad | Bd
o D) None of these
24. After that what are productions associated with A?
o A) A -> bC
o B) A -> bC | b
o C) A -> bC | B | C
o D) A -> bC | ε
25. Which of the following variables are nullable in the given grammar?
o A) Only B
o B) Only C
o C) Both B and C
o D) A, B, and C
26. Which of the following regular grammars generates the regular expression a*?
o A) S -> aS | ε
27. Which of the following is the first step in converting a regular grammar into a
regular expression?
28. The regular grammar S -> aS | bA, A -> b corresponds to which regular
expression?
o A) ab*
o B) a*b
o C) a*b
o D) a*bb
29. Which of the following is the regular expression for the grammar S -> aA, A -> b |
ε?
o A) ab*
o B) (ab)*
o C) (a|b)*
o D) a*b*
30) What is the equivalent regular expression for the regular grammar S -> aS |
bA, A -> a | b?
A) (a|b)*
B) a*b
C) ab*
D) a|b)(a|b)