# Compilers: How to see "the number of grammars where there exists a string that has at least two different left-most derivations"?

Could someone tell why "G1 and G3 are ambiguous" and how to see whether a string has at least two different left-most derivations in general? • Don't use images as main content of your post. This makes your question impossible to search and inaccessible to the visually impaired; we don't like that. Please transcribe text and mathematics. You can use LaTeX.
– D.W.
May 20 at 5:05
• We require you to credit the original source of all copied material: cs.stackexchange.com/help/referencing. Please edit your question accordingly.
– D.W.
May 20 at 5:06

For example, $$G_1$$ has just three productions $$S\to a S b \mid S b \mid c$$, and none of them has more than one non-terminal on the right hand side. So there are only four derivations of three steps, and it's easy to see that two produce the same sentence.
\begin{align}S&\to a S b \to a a S b b \to a a c b b \; (P_1, P_1, P_3)\\ S&\to a S b \to a S b b \to a c b b\; (P_1, P_2, P_3) \\ S&\to S b \to a S b b \to a c b b\; (P_2, P_1, P_3) \\ S&\to S b \to S b b \to c b b\; (P_2, P_2, P_3)\\ \end{align}
$$G_3$$ does have a production which produces two non-terminals, so there are a lot more short derivations. Even so, it shouldn't take you very long to find two derivations for the same sentence.