The Gateway to Computer Science Excellence

+1 vote

$S \rightarrow aAbB \ \ \ \ \ \ \ ..... 1 $

$S \rightarrow bAaB \ \ \ \ \ \ \ ..... 2 $

$S \rightarrow \epsilon \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ..... 3 $

$A \rightarrow S \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ..... 4 $

$B \rightarrow S \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ ..... 5 $

FIRST | FOLLOW | NON-TERMINAL | a | b | $ |

$\{ a, b, \epsilon \}$ | $\{ \$,b,a \}$ | S | 1 / 3 | 2 / 3 | 3 |

$\{ a, b, \epsilon \}$ | $\{b,a \}$ | A | 4 / 4 | 4 / 4 | |

$\{ a, b, \epsilon \}$ | $\{ \$,b,a \}$ | B | 5 / 5 | 5 / 5 | 5 |

$$\begin{array}{|l|l|l|l|l|}\hline \textbf{FIRST}&\textbf{FOLLOW}&\textbf{NON-TERMINAL}&\textbf{a}&\textbf{b}&\textbf{\$}\\\hline \{a,b,\epsilon\}&\{\$,b,a\}&\text{S}&1/3&2/3&3\\\hline \{a,b,\epsilon\}&\{b,a\}&\text{A}&4/4&4/4&\\\hline \{a,b,\epsilon\}&\{\$,b,a\}&\text{B}&5/5&5/5&5\\\hline\end{array}$$

There are 2 entries with multiple different productions which results in First/First conflict.

however there are 6 multiple entries in the table.

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.4k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.1k
- Non GATE 1.4k
- Others 1.7k
- Admissions 595
- Exam Queries 576
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 17

50,666 questions

56,167 answers

193,833 comments

93,993 users