retagged by
559 views
2 votes
2 votes

Consider the following grammar:
$$
\begin{aligned}
& S \rightarrow a S^{\prime} \\
& S^{\prime} \rightarrow b S^{\prime} \mid \epsilon
\end{aligned}
$$
Which of the following is/are CORRECT right sentential form of the given grammar?

  1. $a b S^{\prime}$
  2. $bS'$
  3. $a S^{\prime} b$
  4. $bbS$
retagged by

1 Answer

3 votes
3 votes

To keep in mind, Ques is asking right sentential form, not viable prefix.

Just expand S and check if it can be derived or not

       A . S→ aS’ → abS’

  1. S → aS’ → a | abS’  So bS’ cant be derived
  2. S → aS’ → abS’ | a So aS’b cant be derived
  3. bbS can’t be derives
Answer:

Related questions

695
views
1 answers
5 votes
GO Classes asked Jan 21
695 views
Consider the following grammar- ... .$\operatorname{First}(\mathrm{A})$ and $\operatorname{First}(\mathrm{T})$ are same.
543
views
1 answers
5 votes
GO Classes asked Jan 21
543 views
$\begin{aligned}& S \rightarrow S1 \;T \\& S 1 \rightarrow a \mid(S S) \\& T \rightarrow \varepsilon \mid b \;T\end{aligned}$In the $\text{LL(1)}$ ... \{T \rightarrow \varepsilon\}$\{S 1 \rightarrow a\}$ and $\{T \rightarrow \varepsilon\}$
455
views
1 answers
4 votes
GO Classes asked Jan 21
455 views
Consider the following context-free grammar, with start symbol $S$ and terminals $a, ; , \lt , \gt .$ ... many different parse trees are there for the string $\lt \lt a \gt ;a\gt ?$
1.0k
views
1 answers
6 votes
GO Classes asked Jan 21
1,000 views
Let $A, B, C$ be events such that $P(A)=P(B)=P(C)=0.5, P(A \cap B)=0.3, P(A \cap C)=0$.Which of the following is/are true?$P(A \cup B)=0.75$P(A \cup C)=1$P(B \cap C)=0.23$P(B \cup C)=0.9$