A-=>AaA/a then how can S1 will be true

Which of the following statements are true?

- Every left-recursive grammar can be converted to a right-recursive grammar and vice-versa
- All $\epsilon$-productions can be removed from any context-free grammar by suitable transformations
- The language generated by a context-free grammar all of whose productions are of the form $X \rightarrow w$ or $X \rightarrow wY$ (where, $w$ is a string of terminals and $Y$ is a non-terminal), is always regular
- The derivation trees of strings generated by a context-free grammar in Chomsky Normal Form are always binary trees

- I, II, III and IV
- II, III and IV only
- I, III and IV only
- I, II and IV only

## 4 Answers

Answer is C:

Statement $1$ is **true**: Using GNF we can convert Left recursive grammar to right recursive and by using reversal of CFG and GNF we can convert right recursive to left recursive.

Statement $2$ is **false**: because if $\epsilon$ is in the language then we can't remove $\epsilon$ production from Start symbol. (For example $L = a^*$)

Statement $3$ is **true** because right linear grammar generates regular set

Statement $4$ is **true**, only two non-terminals are there in each production in CNF. So it always form a binary tree.

### 5 Comments

@Shamim Ahmed option b says all epsilon can be removed. If language can generate epsilon, how can we remove it? start symbol will always have it to generate epsilon.

1.Every left recursive grammar can be converted to a right recursive grammar and vice versa

yes their is algo.

2. All ∈ production can be removed from any CFG by suitable transformation

NO when language itself contain null then u can't remove null.

3. The language generated by a CFG all whose production are to the form X→ w or X→ wY

yup their is formula for it X-> aT* then regular since right linear form

4.The derivation trees of strings generated by a CFG in CNF are alays binary trees.

yes b/c cfn in form of S->AB or S->a so max two child at a time.

Answer is (C)

Explanation for I.

- Reverse "LLG for L" to get "RLG for L
^{R}" by changing A → Ba to A → aB - Convert "RLG for L
^{R}" directly to "FA for L^{R}" - Reverse "FA for L
^{R}" to get "FA for L" by- Change starting state to final state
- Reverse direction of each transition
- Create a new start state with
*ϵ*transitions to all accepting states - Convert "FA for L" directly to "RLG for L"

Similar approach can be derived for converting "RLG for L" to "LLG of L".