I’m given a grammar:

```
R -> RUR | RR | R* | (R) | a | b
```

And the alphabet set is:

```
{a,b}
```

Now if I’m to remove the left recursion, is this solution correct:

```
R -> R* | (R) | a | b R' R''
R' -> e | URR'
R'' -> e | RR''
```

Theroy:

If `A->Aa|b`

then:

```
A -> bA'
A' -> e|aA'
```

So `R -> RUR | RR | R* | (R) | a | b`

becomes:

```
R -> RR | R* | (R) | a | b R'
R' -> e | URR'
```

Then `R -> RR | R* | (R) | a | b R'`

becomes:

```
R -> R* | (R) | a | b R' R''
R'' -> e | RR''
```

Here `e`

is *epsilon* and `U`

is union.