Awesome q2a theme
0 votes
11 views
Consider the Language:
L = {$a^{n}b^{n}c^{k}$, n,k ≥ 1} ⋃ {$a^{n}b^{k}c^{k}$, n,k≥ 1}
Which is True?
(a) All the Grammars generating L will be ambiguous.
(b) There exists a G which is unambiguous.
(c) Language L is unambiguous
(d) None of the above
in Theory of Computation by (341 points)
reshown by | 11 views
0
is this question your self doubt ? i seen somewhere it

1 Answer

0 votes
A context free language is called ambiguous if there is no unambiguous grammar to define that language

L = L1 union L2

L1 = {a^n b^n c^k, n,k ≥ 1} = { abc,aabbc,aabbcc, aaabbbcc, ………….}

L2 = { a^nb^kc^k , n,k > =1} = { abc,abbcc, aabbcc, aabbbccc ……. }

L = { abc, aabbc, abbcc, aabbcc, aaabbbcc, aabbbccc …………… }

U can generate aabbc only by L1 or abbcc only by L2. Thus there exist :
Let there exist a grammar G1 that generates aabbc :
G1 :
S → aSbA | ab
A → cA | c


Let there be another grammar G2 that generates abbcc :
G2 :
S → AbSc | bc

A → aA | a

But u can see that both G1 and G2 generate aabbcc.

So, there are 2 parse trees for the same string. So, both the grammars are ambiguous.

So, it is option A.
by (1.6k points)
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Welcome to GATE CSE Doubts, where you can ask questions and receive answers from other members of the community.
Top Users Jan 2020
  1. shashin

    1262 Points

  2. Deepakk Poonia (Dee)

    346 Points

  3. Vimal Patel

    343 Points

  4. Debapaul

    265 Points

  5. Satbir

    194 Points

  6. Pratyush Priyam Kuan

    158 Points

  7. tp21

    151 Points

  8. SuvasishDutta

    151 Points

  9. pranay562

    142 Points

  10. DukeThunders

    97 Points

Monthly Top User and those within 60% of his/her points will get a share of monthly revenue of GO subject to a minimum payout of Rs. 500. Current monthly budget for Top Users is Rs. 75.
3,085 questions
1,538 answers
9,232 comments
89,827 users