Remove left recursion from he following grammar

S-> Aa | b

A-> Ac | Sd | $

here $ denotes epsilon.

What will be the solution ?

Remove left recursion from he following grammar

S-> Aa | b

A-> Ac | Sd | $

here $ denotes epsilon.

What will be the solution ?

The answer is:

S->Aa | b

A-> SdA’

A’->CA’ | $

Because, for the form- A->Aà | ã , the solution is: A-> ãA’ and A’->àA’ | $

Here, à is alpha and ã is beta. $ is epsilon.