regular Languages
Question 1 |
Which of the following definitions below generates the same language as L, where L = {xnyn such that n >= 1}?
I. E → xEy|xy II. xy|(x+xyy+) III. x+y+
I only | |
I and II | |
II and III | |
II only |
Question 1 Explanation:
(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.
Question 2 |
Let Σ = {0,1}, L = Σ* and R = {0n1n such that n >0} then the languages L ∪ R and R are respectively
regular, regular | |
not regular, regular | |
regular, not regular | |
not regular, no regular |
Question 2 Explanation:
L∪R is nothing but L itself. Because R is subset of L and hence regular. R is deterministic context free but not regular as we require a stack to keep the count of 0's to make that of 1's.