Which of the following statements is/are TRUE?

(a) The grammar S → SS | a is ambiguous. (Where S is the start symbol)

(b) The grammar S → 0S1 | 01S |e is ambiguous. (The special symbol e represents the empty string) (Where S is the start symbol)

(c) The grammar (Where S is the start symbol)

S → T / U

T → x S y | xy | ϵ

U → yT

generates a language consisting of the string yxxyy.

This question was previously asked in
UGC NET Computer Science (Paper 2) Nov 2017 Official Paper
View all UGC NET Papers >
  1. Only (a) and (b) are TRUE.
  2. Only (a) and (c) are TRUE.
  3. Only (b) and (c) are TRUE.
  4. All of (a), (b) and (c) are TRUE.

Answer (Detailed Solution Below)

Option 4 : All of (a), (b) and (c) are TRUE.
Free
UGC NET Paper 1: Held on 21st August 2024 Shift 1
10.8 K Users
50 Questions 100 Marks 60 Mins

Detailed Solution

Download Solution PDF

The correct answer is option 4.

CONCEPT:

For grammar to be ambiguous, a string needs to have

More than one parse tree

More than two leftmost derivative

More than two rightmost derivative

Key Points

The grammar S → SS | a is ambiguous grammar. It generates two parse trees with string aaa. 

F1 Raju Shraddha 07.04.2020 D10

The grammar S → 0S1 | 01S |e is ambiguous. It generates two parse trees with string 01.

F1 Raju Shraddha 07.04.2020 D11 1

The grammar S → T / U, T → x S y | xy | ϵ, U → yT generates a language consisting of the string yxxyy.

F1 Raju Shraddha 07.04.2020 D12 1

∴ Hence the correct answer is All of (a), (b) and (c) are TRUE.

Latest UGC NET Updates

Last updated on Jun 12, 2025

-> The UGC NET June 2025 exam will be conducted from 25th to 29th June 2025.

-> The UGC-NET exam takes place for 85 subjects, to determine the eligibility for 'Junior Research Fellowship’ and ‘Assistant Professor’ posts, as well as for PhD. admissions.

-> The exam is conducted bi-annually - in June and December cycles.

-> The exam comprises two papers - Paper I and Paper II. Paper I consists of 50 questions and Paper II consists of 100 questions. 

-> The candidates who are preparing for the exam can check the UGC NET Previous Year Papers and UGC NET Test Series to boost their preparations.

More Context Free Languages and Pushdown Automata Questions

Get Free Access Now
Hot Links: teen patti apk download teen patti game paisa wala teen patti comfun card online teen patti cash teen patti flush