recategorized by
16,218 views
45 45 votes

Which of the following definitions below generate the same language as $L$, where $L=\{x^ny^n \text{ such that } n\geq 1 \}$?

  1. $E \rightarrow xEy\mid xy$

  2. $x y \mid (x^+xyy^+$)

  3. $x^+y^+$

    1. I only

    2. I and II

    3. II and III

    4. II only

10 Answers

5 5 votes
A is the answer B is wrong because xxyyy is there same apply for C also
5 5 votes
The language $L=\{x^ny^n \text{such that }n\geq 1\}$ has following set of strings:

$L=(xy,xxyy,xxxyyy…….\infty)$

1) $E\rightarrow xEy \mid xy$: This grammar can generate all possible string which is generated by language $L.$

 Following strings can be generated by the above grammar: $xy,xxyy,xxxyyy….\infty$  

so this option is correct.

​​​​​​​2) $xy\mid x^+xyy^+$: the minimum length of the string that can be generated by this regular expression is $xy$. it can generate all the string which is generated by language $L$ but it can also generate additional string which is not generated by language $L$ such as $xxxyy,xxyyy$. these are invalid strings for language $L.$

so this option is wrong here.

​​​​​​​3) $x^+y^+$: this regular expression generate strings like $xy,xxy,xyy,xxxy,xyyy….\infty$ which is not generated by language $L.$

so this option is also wrong.

$\therefore \text{Option A is correct.}$
1 1 vote

given language L is CFL , so we can not write a regular expression for this. but in option ii,iii it is written in regular expression so it is clearlly false.  so option a is true

0 0 votes
from the very easy eye We can say that i and iii are correct as n>=1 but as there is no opt so 1 is correct A
2 flags:
✌ Low quality (RahulVerma3 “wrong”)
✌ Low quality (manas_pant “Kuch bhii!!”)
0 0 votes

(I) is the correct definition and the other two is wrong because the other two can have any no. of x and y. There is no such restriction over the number of both being equal.

Answer:
Position:
Show:

Related questions

32 32 votes
6 answers 6 answers
20.7k
20.7k views
Kathleen asked Oct 8, 2014
20,660 views
Let $\Sigma=\left\{0,1\right\}, L = \Sigma^*$ and $R=\left\{0^n1^n \mid n 0\right\} $ then the languages $L \cup R$ and $R$ are respectivelyregular, regularnot regular, ...
42 42 votes
9 answers 9 answers
19.5k
19.5k views
Kathleen asked Oct 8, 2014
19,453 views
In some programming language, an identifier is permitted to be a letter followed by any number of letters or digits. If $L$ and $D$ denote the sets of letters and digits ...
63 63 votes
8 answers 8 answers
49.3k
49.3k views
Kathleen asked Oct 8, 2014
49,347 views
The postfix expression for the infix expression $A+B*(C+D)/F+D*E$ is:$AB + CD + *F/D +E*$$ABCD + *F/DE* ++$$A * B + CD/F *DE ++$$A + *BCD/F* DE ++$
39 39 votes
6 answers 6 answers
11.6k
11.6k views
Kathleen asked Oct 8, 2014
11,618 views
What values of $A, B, C$ and $D$ satisfy the following simultaneous Boolean equations?$\overline{A} + AB =0, AB=AC, AB+A\overline{C}+CD=\overline{C}D$$A=1, B=0, C=0, D=1$...