Consider the following grammar where π is the start symbol, and π and π are
terminal symbols.
π βππππ β£ ππ β£ Ο΅
Which of the following statements is/are true?
The grammar is \(S \to aSbS \mid bS \mid \epsilon\), with S as the start symbol. We must check ambiguity and the derivations of specific strings.
Step 1: Show the grammar is ambiguous (Option A) by finding a string with two distinct parse trees.
Consider the string 'abb'. Since it starts with 'a', the only applicable production is \(S \to aSbS\). After the leading 'a', we need \(S_1\) then a literal 'b' then \(S_2\) to spell out 'bb'. This means the strings derived by \(S_1\) and \(S_2\) together must total just one character, since one 'b' is already accounted for by the production.
Step 2: Find the two ways to split this single extra 'b'.
Way 1: \(S_1 \to \epsilon\) and \(S_2\) must derive 'b', which it does uniquely via \(S_2 \to bS \to b\epsilon\).
Way 2: \(S_1\) must derive 'b' via \(S_1 \to bS \to b\epsilon\), and \(S_2 \to \epsilon\).
Both ways produce the string 'abb' but via different parse trees (the extra 'b' either belongs to the left S or the right S in \(aSbS\)). Hence 'abb' has two distinct derivations, proving both that the grammar is ambiguous (Option A true) and that option B is directly true.
Step 3: Check option (C), whether 'abab' has only one rightmost derivation.
'abab' also starts with 'a', so again \(S \to aSbS\) applies, and after removing the leading 'a' we must generate 'bab' as \(S_1\), then a literal 'b', then \(S_2\). We look for positions where this literal 'b' can split 'bab': either at position 0 (giving \(S_1 \to \epsilon\), and \(S_2\) derives 'ab'), or at position 2 (giving \(S_1\) derives 'ba', and \(S_2 \to \epsilon\)).
For the second split, \(S_1\) would need to derive 'ba', which requires \(S_1 \to bS\) followed by S deriving 'a' alone. But no derivation of S can ever produce a lone 'a' with no accompanying 'b', because every nonempty production either starts with 'b' (from \(bS\)) or is forced to contain a literal 'b' internally (from \(aSbS\)). So this second split is impossible, leaving only the first split as valid: \(S_1 \to \epsilon\), and \(S_2\) derives 'ab' via the unique chain \(S_2 \to aSbS \to a\epsilon b\epsilon\).
Since only one valid split exists, 'abab' has exactly one parse tree and therefore only one rightmost derivation. Option C is true.
Step 4: Check option (D), whether the language is undecidable.
The grammar is a simple context-free grammar. Every context-free language has a decidable membership problem (using, for example, the CYK algorithm), so this language is certainly decidable, not undecidable. Option D is false.
Step 5: Conclude.
Options A, B, and C are true; option D is false.
\[ \boxed{\text{Options A, B and C}} \]A schedule of three database transactions \(T_1\), \(T_2\), and \(T_3\) is shown. \(R_i(A)\) and \(W_i(A)\) denote read and write of data item A by transaction \(T_i\), \(i = 1, 2, 3\). The transaction \(T_1\) aborts at the end. Which other transaction(s) will be required to be rolled back?

Which of the following grammars is/are ambiguous?
Let πΏ1 and πΏ2 be two languages over a finite alphabet, such that πΏ1 β©πΏ2 and πΏ2 are
regular languages.
Which of the following statements is/are always true?
Consider the following context-free grammar πΊ.
πβππππ΄π΅π΄πππ
π΄βπππ΅π΅π΄π | ππ΅ππππ
π΅βππ΅π | ππ
In the above grammar, π is the start symbol, π and π are terminal symbols, and π΄ and
π΅ are non-terminal symbols.
Let πΏ(πΊ) be the language generated by the grammar πΊ. For a string π βπΏ(πΊ), let
π1(π ) be the number of πβs in π and π2(π ) be the number of πβs in π .
Which of the following statements is/are true?
Let Ξ£ = {π, π, π, π} and let πΏ= {πππππππββ£π, π, π, ββ₯0}.
Which of the following constraints ensure(s) that the language πΏ is context-free?