$$
\left(
\begin{array}{c}
m+n\\
m
\end{array}
\right)
= \frac{(m+n)!}{m!n!}
= \frac{\overbrace{(m+n)(m+n-1)\cdots(n+1)}^\mbox{$m$ factors}}{\underbrace{m(m-1)\cdots 1}_\mbox{$m$ factors}}
$$
I am getting an error and cannot figure out the cause.
$$
\left(
\begin{array}{c}
m+n\\
m
\end{array}
\right)
= \frac{(m+n)!}{m!n!}
= \frac{\overbrace{(m+n)(m+n-1)\cdots(n+1)}^\mbox{$m$ factors}}{\underbrace{m(m-1)\cdots 1}_\mbox{$m$ factors}}
$$
I am getting an error and cannot figure out the cause.
I suggest you use \[ \] instead $$ $$ for display math formulas. Like @WillieWong say, with amsmath package You can get a result, perhaps, more appropriate:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\binom{m+n}{m}
= \frac{(m+n)!}{m!\,n!}
= \frac{\overbrace{(m+n)(m+n-1)\cdots(n+1)}^{m \text{ factors}}}{\underbrace{m(m-1)\cdots 1}_{m \text{ factors}}}
\]
\end{document}
This will do:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$
\left(
\begin{array}{c}
m+n\\
m
\end{array}
\right)
= \frac{(m+n)!}{m!n!}
= \frac{\overbrace{(m+n)(m+n-1)\cdots(n+1)}^{\mbox{$m$ factors}}}{\underbrace{m(m-1)\cdots 1}_{\mbox{$m$ factors}}}
$$
\end{document}
The ^\mbox{$m$ factors} was changed to ^{\mbox{$m$ factors}} in two cases (one for superscript and another for subscript), which should be grouped using curly braces.
amsmath, one might as well use \binom instead of doing it by hand in the left hand side. It may also make sense using \text instead of \mbox.
– Willie Wong
Jul 18 '16 at 03:29
\text instead of \mbox.
– Jagath
Jul 18 '16 at 04:23
documentclassetc that make this into a MWE, that would be even better. – Teepeemm Jul 18 '16 at 03:30^\mbox{...}and_\mbox{...}are the problems. Better:^{\mbox{...}}. Even better:^{\text{...}}. (Also please have a look at Why is\[ … \]preferable to$$ … $$?) – cgnieder Jul 18 '16 at 08:14