ii and iv are true

i is false as a regular grammar can also be ambiguous

for clarification on iv, go through the explanations here https://gateoverflow.in/906/gate2003-16

The Gateway to Computer Science Excellence

0 votes

Consider the statements: (i) Every regular grammar is LL(1) (ii) Every LL(1) grammar is LALR(1) (iii) All LR(0) grammars are LL(k) (iv) A context-free grammar without left factoring and left recursion can be ambiguous Which of the above statement/s is/are TRUE?

(i) only

(i) and (iii) only

(ii) and (iv) only

(iv) only

(i) only

(i) and (iii) only

(ii) and (iv) only

(iv) only

+2

ii and iv are true

i is false as a regular grammar can also be ambiguous

for clarification on iv, go through the explanations here https://gateoverflow.in/906/gate2003-16

0

yes aambazinga your ans. is correct. but statement 3. All LR(0) grammars are LL(k) why this statement is false

and can you explain why statement 4 is correct.

0 votes

(i) Every regular grammar is LL(1)

- No, because regular grammar can be ambiguous/ left recursive/left factored.

(ii) Every LL(1) grammar is LALR(1)

- No, It's opposite.

(iii) All LR(0) grammars are LL(k)

- No, both are different types of parser. LR(0) just need to be unambiguous but LL(1) needs to be unambiguous + Not left recursive + not left factored.

(iv) A context-free grammar without left factoring and left recursion can be ambiguous

- True.

- No, because regular grammar can be ambiguous/ left recursive/left factored.

(ii) Every LL(1) grammar is LALR(1)

- No, It's opposite.

(iii) All LR(0) grammars are LL(k)

- No, both are different types of parser. LR(0) just need to be unambiguous but LL(1) needs to be unambiguous + Not left recursive + not left factored.

(iv) A context-free grammar without left factoring and left recursion can be ambiguous

- True.

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.3k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.5k
- Others 1.5k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,644 questions

56,516 answers

195,578 comments

101,132 users