Question #38651

The languge {0^1 1^j|gcd(i,j)=1} is
A. regular and not infinite
B. context-free but regular
C. context-sensitive but not context-free
D.recursive but not context-sensitive

Expert's answer

Answer on Question#38651 – Math - Other

Let pp be the pumping length guaranteed by the pumping lemma (for context free languages). Then we choose iji \neq j such that i,jpi, j \geq p and are both prime. Then clearly s=0i1jLs = 0^i 1^j \in L.

By the pumping lemma we can divide ss such that s=uvxyzs = uvxyz and

1. vxyp|vxy| \leq p

2. vy0|vy| \geq 0

3. s=uvkxykzLs' = uv^k xy^k z \in L for all kNk \in \mathbb{N}

For this language we get three similar cases, and one trivial case. The trivial case is where either vv or yy contains both 0s0's and 1s1's, in which case ss' doesn't have the correct ordering, and thus sLs' \notin L.

The nontrivial cases:

1. vv and yy are both strings of 0s0's, then when we pump ss we get s=0i+kn1is' = 0^{i + kn}1^i where n1n \geq 1. Then sLs' \in L if gcd(i+kn,j)=1\gcd(i + kn, j) = 1, however the modular equation i+kn0(j)i + kn \equiv 0(j) has the solution kin1(j)k \equiv in - 1(j), and as jj is prime we are guaranteed that n1n - 1 exists. Therefore any element of the residue class kin1(j)k \equiv in - 1(j) would give us gcd(i+kn,j)>1\gcd(i + kn, j) > 1. Ergo sLs' \notin L.

2. vv and yy are both strings of 1s1's, but this case is just the symmetric case to case 1, so we derive a contradiction in this case too.

3. v=0nv = 0^n and y=1hy = 1^h for some nn and hh with 1n+hp1 \leq n + h \leq p. Then when we pump we get s=0i+kn1j+khs' = 0^{i + kn}1^{j + kh}. Now sLs' \in L if i+knj+kh(j)i + kn \equiv j + kh(j) has no solution, but we can see from here, rearranging just gives i+k(n+h)0(j)i + k(n + h) \equiv 0(j), and as before this has solution ki(n+h)1(j)k \equiv i(n + h) - 1(j). So again we derive a contradiction.

Thus there is at least one string in LL that cannot be divided as per the pumping lemma and still have all pumping results remain in LL. Therefore LL is not context free.

Answer: C.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS