Which of the following grammars is/are ambiguous?
A grammar is ambiguous if some string in its language has two or more distinct parse trees (equivalently, two distinct leftmost derivations).
Step 1: Check Option A - \(S \to aSb \mid \epsilon\). This generates \(\{a^n b^n \mid n \ge 0\}\). Every string has exactly one derivation, since at each step there is only one way to expand \(S\) (terminate with \(\epsilon\), or wrap another \(a \ldots b\) pair). Unambiguous.
Step 2: Check Option B - \(E \to E+E \mid E*E \mid id\). Consider the string \(id + id * id\). It can be parsed as \((id + id) * id\) (applying \(+\) first) or as \(id + (id * id)\) (applying \(*\) first). Since the grammar defines no precedence or associativity, both are valid derivations, giving two distinct parse trees for the same string. Ambiguous.
Step 3: Check Option C - \(S \to aS \mid Sa \mid \epsilon\). This generates \(\{a^n \mid n \ge 0\}\), but because both left recursion (\(Sa\)) and right recursion (\(aS\)) are available simultaneously, a string like \(aa\) can be built in more than one structurally distinct way (attaching the two symbols in different orders via \(aS\) versus \(Sa\)), producing multiple parse trees for the same string. Ambiguous.
Step 4: Check Option D - \(S \to aS \mid \epsilon\). A simple right-linear grammar generating \(\{a^n \mid n \ge 0\}\), with only one production choice at each step. Every string has a unique derivation. Unambiguous.
Final Answer: \(\boxed{\text{Options B and C are ambiguous}}\)
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?

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?
Consider the following grammar where π is the start symbol, and π and π are
terminal symbols.
π βππππ β£ ππ β£ Ο΅
Which of the following statements is/are true?
Let \(\Sigma=\{a,b,c,d\}\) and \(L=\{a^i b^j c^k d^{\ell}\mid i,j,k,\ell\geq0\}\).
Which of the following constraints ensure(s) that the language \(L\) is context-free?