Which one is correct probability formula for the same master secret value in identity-based encryption
Both are correct, you've just made an error calculating it.

Here is a simplification from my answer here:

$$\begin{eqnarray}
p(n) &amp; = &amp; 1 - \frac{q!}{q^n\left(q-n\right)!}\\
&amp; = &amp; 1 - \frac{\prod^q_{i=q-n+1}i}{q^n}\\
&amp; = &amp; 1 - \prod^q_{i=q-n+1}\frac{i}{q}
\end{eqnarray}$$

So, 

$$\begin{eqnarray}
p(2) &amp; = &amp; 1 - \prod^q_{i=q-2+1}\frac{i}{q} \\
 &amp; = &amp; 1 - \prod^q_{i=q-1}\frac{i}{q} \\
 &amp; = &amp; 1 - \frac{q-1}{q}\cdot \frac{q}{q} \\
 &amp; = &amp; 1 - \frac{q-1}{q} \\
 &amp; = &amp; 1 - (\frac{q}{q} - \frac{1}{q}) \\
 &amp; = &amp; \frac{1}{q} \approx 0.
\end{eqnarray}$$