recategorized by
10,541 views
32 votes
32 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

recategorized by

8 Answers

0 votes
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.

0 votes
0 votes

In 2ND OPTION, least length string can be xxyy, but we can generate a string as xy according to question so rejected. 

In 3rd option, number of x and y can vary but here as per the grammar given in question we are getting equal nos. of x and y.

So only option 1 gives correct result.

0 votes
0 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.}$
0 votes
0 votes

Grammar 1 generates exact same language.

Grammar 2 & 3 CAN generate all the strings of the given language but it CAN also generate other strings that doesn't belongs to L. Hence Option A is correct.

Answer:

Related questions

26 votes
26 votes
5 answers
1
Kathleen asked Oct 8, 2014
15,885 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, ...
49 votes
49 votes
7 answers
3
Kathleen asked Oct 8, 2014
38,269 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 ++$
25 votes
25 votes
4 answers
4
Kathleen asked Oct 8, 2014
7,690 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$...