Is this grammar ambiguous? I have the grammar: 

$\qquad \begin{align}
 S &amp;\to S = P \mid S \neq P \mid P  \\
 P &amp;\to NUM
\end{align}$

This grammar suffers from left recursion. To eliminate left recursion, I got: 

$\qquad \begin{align}
 S &amp;\to PS' \\
 S' &amp;\to\, = PS' \mid\, \neq PS' \mid \varepsilon \\
 P &amp;\to NUM
\end{align}$

However when constructing the LL(1) parsing table, it turns out the grammar is ambiguous. Is there a way to disambiguate the grammar without changing the generated language, or did I make a mistake somewhere?

This is my work so far: 

Non-terminal Nullable First            Follow
S            False    NUM              $
    S'           True     !=, ==, epsilon  $
P            False    NUM              $, ==, !=

Parse Table
     !=       ==    NUM      $
S                   -&gt;PS'
S'  -&gt;!=PS'  -&gt;==PS'        -&gt;epsilon
P                   -&gt;NUM
We can consider $NUM$ and therewith $P$ a terminal symbol. Furthermore, $S$ does only occur once in every derivation. Therefore, if there is any ambiguity, it has to stem from

$\qquad \displaystyle S' \to\, = PS' \mid\, \neq PS' \mid \varepsilon$

Now, that fragment is a right-regular grammar with only one non-terminal whose right-hand sides do not share any prefixes. So clearly every term has only derivation, given by its length and permutation of $=$ and $\neq$.

In total, your grammar is unambiguous. Above observations also suggest that the grammar can be parsed in one pass from left to right with one token lookahead (distinguish $=$ and $\neq$). In fact, the grammar is basically a deterministic (no shared prefixes) and right-regular (replace all $P$ with $NUM$) grammar, so it's certainly an LL(1) grammar.

So I suggest you revisit the construction of the parsing table (your favorite textbook or Wikipedia) -- you must have made a mistake.