• edited by
12,603 views
29 29 votes

Language $L_{1}$ is defined by the grammar: $S_{1} \rightarrow a S_{1} b \mid \varepsilon$

Language $L_{2}$ is defined by the grammar: $S_{2} \rightarrow a b S_{2} \mid \varepsilon$

Consider the following statements:

  • P: $L_{1}$ is regular
  • Q: $L_{2}$ is regular

Which one of the following is TRUE?

  1. Both $P$ and $Q$ are true.
  2. $P$ is true and $Q$ is false.
  3. $P$ is false and $Q$ is true.
  4. Both $P$ and $Q$ are false.

2 Answers

Best answer
82 82 votes

Answer is C.

$S_1\rightarrow aS_1b\mid \epsilon$

$L_1 = \{ a^nb^n \mid n\geq 0\}$ is CFL

$S_2\rightarrow abS_2\mid \epsilon$

$L_2 = \{ (ab)^n \mid n\geq 0\}$ is Regular having regular expression $(ab)^*$

• edited by
16 16 votes

L2 is Right  Linear Grammar L1 is neither right  or left linear grammar  , A regular language either should be Left or Right linear grammar , but not both  so solution is L2 is regular but L1 is not 

Answer:
Position:
Show:

Related questions

66 66 votes
4 answers 4 answers
21.1k
21.1k views
Akash Kanase asked Feb 12, 2016
21,087 views
Consider the following types of languages: $L_{1}$: Regular, $L_{2}$: Context-free, $L_{3}$: Recursive, $L_{4}$: Recursively enumerable. Which of the following is/are TRU...
47 47 votes
4 answers 4 answers
14.5k
14.5k views
Akash Kanase asked Feb 12, 2016
14,490 views
Which one of the following grammars is free from left recursion?$S \rightarrow AB$$A \rightarrow Aa \mid b$$B \rightarrow c$$S \rightarrow Ab \mid Bb \mid c$$A \rightarro...
32 32 votes
4 answers 4 answers
11.3k
11.3k views
Akash Kanase asked Feb 12, 2016
11,281 views
The Floyd-Warshall algorithm for all-pair shortest paths computation is based onGreedy paradigm.Divide-and-conquer paradigm.Dynamic Programming paradigm.Neither Greedy no...
25 25 votes
5 answers 5 answers
10.4k
10.4k views
Akash Kanase asked Feb 12, 2016
10,368 views
In which one of the following page replacement algorithms it is possible for the page fault rate to increase even when the number of allocated frames increases?LRU (Least...