Tuesday 26 November 2013

Sipser 2.42 Let E = {1,#} and Y = { w | w = t1#t2# ...... #tk for k ≥ 0, each ti ∈ 1*, and ti ≠ tj whenever i ≠ j}. Prove that Y is not context free.

2.42

Let E = {1,#} and Y = { w | w = t1#t2# ...... #tk for k ≥ 0, each ti ∈ 1*, and ti ≠ tj whenever i ≠ j}. Prove that Y is not context free.


Solution: 

consider  a string 1p#1p+1# ... #12p-1#12p#12p+1# ... #13p where p is pumping length. While pumping there can be three possibilities :
1. If either v or y has a #. If so, then pump string 3 times.
Let's say hash is in v s.t. v = 1m#1n, then v3 will be 1m#1n1m#1n1m#1n = 1m#1n+m#1n+m#1n. Otherwise # will be in y, which can be shown similarly.
2. If # lies in x,
     a. v lies in 1j such that j < 2p. if |v| = 1 then pump up it twice, else if |v| > 1 then pump up it once. We must get ti which will be equal to some tj.  I have considered to pump twice if |v| = 1 because it may happen that |y| ≠ 0. Think what am I talking.
     b. y lies in 1j such that j >= 2p. if |y| = 1 then pump down it twice, else if |y| > 1 then pump down it once.
     c. If one of the v and y is empty then pump other up or down once depending on where it lies i.e. 1j   j is greater than 2p or other way.
3. If both v and y lies in same 1j, and j ≤ 2p then pump up it once. Else if j > 2p then pump down it once.

I might not have explained properly, but think. You must get it.

No comments:

Post a Comment