MCQ IN COMPUTER SCIENCE & ENGINEERING

COMPUTER SCIENCE AND ENGINEERING

THEORY OF COMPUTATION

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
In context to the process of removing useless symbols, which of the following is correct?
A
We remove the Nullable variables
B
We eliminate the unit productions
C
We eliminate products which yield no terminals
D
All of the mentioned
Explanation: 

Detailed explanation-1: -Step 1: To remove A → B, add production A → x to the grammar rule whenever B → x occurs in the grammar. Step 2: Delete A → B from the grammar. Step 3: Repeat the first and the second steps until all the unit productions are removed.

Detailed explanation-2: -Useless symbol is the one which does not derive any string. Q does not derive any string. So, production S → PQ does not have any meaning. Since S → PQ is removed, P → p is not reachable it is also useless.

There is 1 question to complete.