47 views

Let $G$ be a grammar in CFG and let $W_1,W_2\in L(G)$ such that $\mid W_1\mid=\mid W_2\mid$ then which of the following statements is true?

1. Any derivation of $W_1$ has exactly the same number of steps as any derivation of $W_2$.
2. Different derivation have different length.
3. Some derivation of $W_1$ may be shorter than the derivation of $W_2$
4. None of the options

edited | 47 views

+1 vote
Given data,
W1 and W2 are 2 strings,
|W1|=|W2| means same length
Example CFG grammar:
S→ Cbb | cc
C→ a
W1=cc W2=Cbb
As per the grammar, W1 require only one derivation S→ cc
W2 requires two derivations S→ Cbb→ abb
It means W1 is smaller than W2.

Correct option- (C) Some derivation of W1 may be shorter the derivation of W2
by