• retagged by
31,574 views
61 61 votes

Consider the language $L = \{a^{n}\mid n \geq 0\} \cup \{a^{n}b^{n}\mid n \geq 0\}$ and the following statements.

  1. $L$ is deterministic context-free.
  2. $L$ is context-free but not deterministic context-free.
  3. $L$ is not $LL(k)$ for any $k$.

 Which of the above statements is/are TRUE?

  1. Ⅰ only
  2. Ⅱ only 
  3. Ⅰ and Ⅲ only
  4. Ⅲ only

8 Answers

0 0 votes

Correct Option is (C).

1. L1 is Regular and L2 is DCFL , and as we know DCFL is closed under union operation with regular set hence L is  DCFL. 

2. so option b is eliminated.

3. LL(K)  parser needs to determine the next grammar production by seeing the next  input symbols. but here parser is not able to find whether a^n or a^n b^n is to be accepted.

 

0 0 votes
for opt 3,

A -> a1/a2

then,

first (a1) intersection first (a2)  not equals phi

then only not LL(k)
Answer:
Position:
Show:

Related questions

60 60 votes
4 answers 4 answers
25.2k
25.2k views
Arjun asked Feb 12, 2020
25,176 views
Consider a double hashing scheme in which the primary hash function is $h_1(k)= k \text{ mod } 23$, and the secondary hash function is $h_2(k)=1+(k \text{ mod } 19)$. Ass...
73 73 votes
5 answers 5 answers
32.8k
32.8k views
Arjun asked Feb 12, 2020
32,772 views
Consider the following languages.$$\begin{array}{ll} L_1= \{ wxyx \mid w,x,y \in (0+1)^{+} \} \\ L_2= \{xy \mid x,y \in (a+b)^{*}, \mid x \mid=\mid y \mid, x \neq y \} \e...
30 30 votes
4 answers 4 answers
14.4k
14.4k views
Arjun asked Feb 12, 2020
14,389 views
The total revenue of a company during $2014-2018$ is shown in the bar graph. If the total expenditure of the company in each year is $500$ million rupees, then the aggreg...
56 56 votes
3 answers 3 answers
39.1k
39.1k views
Arjun asked Feb 12, 2020
39,082 views
Which one of the following regular expressions represents the set of all binary strings with an odd number of $1’$s?$((0+1)^*1(0+1)^*1)^*10^*$$(0^*10^*10^*)^*0^*1$$10^*(0...