10

I want to display the following

$p_N= \frac{{200 \choose 11}{ 200 \choose {N-189}}}{200 \choose N}$

However, texmaker gives me this error:

enter image description here

Does anybody know why is that? I have tried replacing the combinatorial expressions with random letters or numbers such as

$p_N= \frac{{123}{ yellow {green}}}{pink}$

and it works. Does anybody know how to fix it so it works with combinatorials as well?

Mico
  • 506,678

2 Answers2

19

This is one of the reasons why using the \choose method is not the best.

What happens? When \frac is expanded, it looks for two arguments, which in your case are determined to be

{200 \choose 11}{ 200 \choose {N-189}}

and

200 \choose N

Then TeX will transform this into the primitive call

{\begingroup<first argument>\endgroup\over<second argument>}

which in your case is

{\begingroup{200 \choose 11}{ 200 \choose {N-189}}\endgroup\over 200 \choose N}

which is indeed ambiguous as the error message says: it's like

a \over b \over c

which is of course invalid.

Do yourself a favor and use

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$p_N=\frac{\binom{200}{11} \binom{200}{N-189}}{\binom{200}{N}}$

\end{document}

which is clearer and doesn't require extra braces like

$p_N= \frac{{200 \choose 11}{ 200 \choose {N-189}}}{{200 \choose N}}$

By the way, the braces around N-189 are redundant. But, really, use the amsmath method that automatically supplies the internal braces when expanding things to the primitive calls.

egreg
  • 1,121,712
8

I have seen often \choose in MathJaX and if I not remember not good also in Open Office or LibreOffice. For my humble opinion are important to have a full minimal working example to see the mistakes. I use often $\binom{n}{k}$.

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb,xcolor}

\begin{document} [p_N= \frac{\binom{200}{11}\binom{200}{N}}{\binom{200}{N-189}}] \end{document}


enter image description here

Sebastiano
  • 54,118
  • 1
    Hi, thanks for the answer. I am aiming for having two combinatorials on the top and one on the bottom. Nevertheless, this works. Why do you think it doesn't work with \choose ? – Maths Wizzard Sep 06 '20 at 20:48
  • 1
    @KanyeWest I have put as package xcolor, but I have not understood the question of the colors. Sorry. – Sebastiano Sep 06 '20 at 20:53
  • 1
    No worries! All good. I will just use \binom from now on as it doesn't seem to have the same issues. – Maths Wizzard Sep 06 '20 at 20:55
  • 2
    @KanyeWest See this old question. All the best. https://tex.stackexchange.com/questions/127707/displaying-the-binomial-coefficient-symbol-in-math-mode. After can you give, please, to the user egreg the green check mark? My explanation is very poor. Thank you very much for this favour. – Sebastiano Sep 06 '20 at 20:56
  • 1
    No worries, I should be thank you for the effort that you put in my issue. – Maths Wizzard Sep 06 '20 at 21:02