Question

Suppose that L = { a ^{n}b^{n} : n \geq 0}

a) show that L^{2} is a context free language

b) show that L^{k} for every k \geq 1 is also context free

0 0
Add a comment Improve this question Transcribed image text
Answer #1

CFG is a Formal Grammer is used to Generate Set of strings . It is also called as Type 2 Grammer

Syntax = G= {V,T,P,S}

Given L = anbn : n > = 0

It means for a derived string have  number of a's is equal to number of b's

if n=2 then L = {a2b2} String = aabb

=> aSb here  S = string(i.e Derive any number of a's and any number of b's)

=> aabb ( S-> ab)

Grammer G = { V.T,P,S}

V= { S }

T = { a,b,e} (here  e = epsilon)

P : S->aSb/ab/ e

S = Sta

a) Given that L2 is a CFG

as L = { anbn}

L2 is represented as L x L = { a2n b2n } if n = 1 ,

L2 = { a2 b2 } String = aabb ( in which derived string is same as L}

if n=0 L2 string derives (Epsilon e)

Therefore L2 is also a CFG.

b) Given Lk : k > = 1

Lk = {ak bk }

as L and L2 are CFG , Lk is also be CFG

ex : if k = 2

L2  derives the string aabb . It is also CFG

Add a comment
Know the answer?
Add Answer to:
Suppose that a) show that is a context free language b) show that for every is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT