edited by
12,209 views
48 votes
48 votes

Consider the context-free grammars over the alphabet $\left \{ a, b, c \right \}$ given below. $S$ and $T$ are non-terminals.

$G_{1}:S\rightarrow aSb \mid T, T \rightarrow cT \mid \epsilon$

$G_{2}:S\rightarrow bSa \mid T, T \rightarrow cT \mid \epsilon$

The language $L\left ( G_{1} \right )\cap L(G_{2})$ is

  1. Finite
  2. Not finite but regular
  3. Context-Free but not regular
  4. Recursive but not context-free
edited by

8 Answers

6 votes
6 votes

Answer: Option (B)

We can also solve this Question by observing the productions given.

Here there is common production 

G:   S -> T 
      T -> cT | 
ϵ

What that represents ! That geneates Language with Regular Expression

R.E.= c*. 

That is not Finite but Regular. 

6 votes
6 votes

no need to to think much straight forward question is given 

G1: starting with a and ending with b (compulsory conditon) or contains infinite c

G2: starting with b and ending with  a (compulsory condition) or contains infinite c

so both are intersection will give 0 strings because if string is starting from 'a' than how it can start form b 

and second half part where c is infinite and regular so option B

5 votes
5 votes
g1 intersection g2 = phi , here so it is regular

hence finite

but here t-> ct /epsilon which is comman in both so

it is not finite but regular

corret ans is B
Answer:

Related questions

44 votes
44 votes
6 answers
2
Arjun asked Feb 14, 2017
11,605 views
If $G$ is a grammar with productions$S\rightarrow SaS\mid aSb\mid bSa\mid SS\mid\epsilon$where $S$ is the start variable, then which one of the following strings is not g...
74 votes
74 votes
8 answers
3