$\[ \sum_{k=0}^{n} \binom{n}{k} = 2^n\] $
Do I need a special package, or is something else wrong with this?
It seems you are struggling with some very basic tasks of LaTeX. Please consider consulting an introductory text. You can find an exhaustive list here:
You are trying to nest displayed math inside inline math. This cannot work. You can only use one of the two at a time.
Display math is introduced by \[ ... \] whereas inline math is delimited by $ ... $. Without context it's hard to say which one is more appropriate here, but I guess it is display math (i.e. centered horizontally and on a separate line).
\documentclass{article}
\usepackage{amsmath}
\begin{document}
[ \sum_{k=0}^{n} \binom{n}{k} = 2^n ]
\end{document}
$\sum\limits_{k=0}^{n} \binom{n}{k} = 2^n$.
– Henri Menke
Apr 02 '22 at 18:22
You can use the command \displaystyle in an inline expression (with $...$) to have equations displayed as in isolated math mode (the one you obtain with \[...\]).
In your example, it would be:
$\displaystyle\sum_{k=0}^n \binom{n}{k} = 2^n$.
\[...\] and $...$.
Though it is not proper typography, it can prove useful in some context, and it is the author decision to make.
– pandamoniark
Apr 06 '22 at 11:56
\[ \sum_{k=0}^{n} \binom{n}{k} = 2^n\]. – Zarko Mar 31 '22 at 15:22\[inside$use$for inline math or\[for display math, not both. – David Carlisle Mar 31 '22 at 15:22\binomis not defined by default, (comes fromamsmath) – David Carlisle Mar 31 '22 at 15:23$ $$ \sum_{k=0}^n ... $$ $which seems to be over complicated. – wipet Mar 31 '22 at 19:31