Language $A$ can also be represented as, $$A = \{ uvw \mid u,w \in \Sigma^*\text{ and, }v \in \Sigma^* 1 \Sigma^*\text{ and, }|u| = |w| \ge |v| \}$$
Language $B$ can also be represented as, $$B = \{ uvw \mid u,w \in \Sigma^*\text{ and, }v \in \Sigma^* 1 \Sigma^* 1 \Sigma^*\text{ and, }|u| = |w| \ge |v| \}$$
I have to prove that $A$ is CFL & $B$ is not a CFL.
To prove $A$ is CFL, I have to show that a CFG can be made. I made a CFG for this equation:
$$L = \{ uv \mid u \in \Sigma^*\text{ and, }v \in \Sigma^* 1 \Sigma^*\text{ and, }|u| \ge |v| \}$$ which is, $$ S \to XSX \mid T1 $$ $$ T \to XT \mid X $$ $$ X \to 0 \mid 1 $$
But I am not able to make a perfect CFG for $A$ after much trying although they seem both same ..
Can I prove $B$ is not a CFL maybe by using pumping lemma ?