Here is my document and the problem:
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{float}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\graphicspath{ {./images/} }
\begin{document}
\section{The Binomial Distribution}
If $X \sim Bin(n,p)$ where $p = \frac{1}{2}$, hence $q = 1 - \frac{1}{2} = \frac{1}{2}$, then
\begin{align}
P(X=k) &= {n\choose k}p^k q^{n-k}\
&= {n\choose k}{\frac{1]{2}}^k \frac{1]{2}^{n-k}\
&= {n\choose k}{\frac{1]{2}}^n\
&= \frac{n\choose k}{2^n}
\end{align}
Note that $2^n$ is constant for fixed $n$. Therefore, $P(X=k)$ has symmetry matching the symmetry of Pascal's Triangle.
If $p < \frac{1}{2}$, the distribution is negatively skewed.
\begin{align}
P(X=k) &= {n\choose k}p^k q^{n-k}\
&= {n\choose k}{\frac{1]{6}}^k \frac{5]{6}^{n-k}\
&= \frac{n\choose k 5^{n-k}}{6^n}
\end{align}
\end{document}
So there seems to be problems from \section{The Binomial Distribution} onwards. Before when I typeset, it kept saying there was a "missing $ inserted" and I played around with it, unfortunately messing it up so much that now it only has "Undefined control sequence \document class{amsart}" as the error message. Please help!
Follow up question
Here is my entire code (excluding information which I think isn't contributing to an error):
\documentclass{amsart}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{float}
\usepackage{graphicx}
\usepackage[utf8]{inputenc}
\usepackage{amssymb}
\graphicspath{ {./images/} }
\begin{document}
- $\frac{(n\times p)!}{p!^n}$
\vspace{5mm}
- Want to borrow $1$ to $n$ books:\
There are $38$ numbers and only $26$ differences when maximised, so the ceiling function $\lceil \frac{38}{26} \rceil =2$.\
Therefore by PHP, there exists at least two numbers whose difference is at most $26$
\section{Statistics}
\subsection{Averages from grouped data}
\hfill\
\textbf{Estimating the mean:} An estimate for the mean can be obtained by assuming hat each of the raw data values takes the midpoint value of the interval in which it has been placed
$$\text{Mean estimate} =\frac{\sum{fx}}{\sum{f}}$$
\subsection{Pareto Charts}
\hfill\
The following table shows the 6 most common reasons for conditions failing their driving test.\
\hfill\
\begin{center}
\begin{tabular}{@{}lll@{}}
\toprule
Reason & Percentage of conditions & Cumulative frequency \ \midrule
Observations at junctions & 11.9 & 31 \
Use of mirrors & 8.2 & 52.4 \
Inappropriate speed & 5.1 & 65.7 \
Steering control & 4.7 & 77.9 \
Reversing around corner & 4.3 & 89.1 \
Incorrect positioning & 4.2 & 100 \ \bottomrule
Total &38.4 \
\end{tabular}
\end{center}
\hfill \
\begin{figure}[H]
\centering
\includegraphics[scale=0.15]{paretochart1}
\caption{Pareto chart}
\label{default}
\end{figure}
\newpage
\textbf{Note:}
\begin{itemize}
\item The Cumulative frequency graph is concave down and monotone increasing
\item Pareto Principle: 80% of consequences come from 20% of the causes
\item Deciles:
\begin{itemize}
\item 0 - 10% 1st decile
\item 10 - 20% 2nd decile
\item $\vdots$
\item 90 - 100% 10th decile
\end{itemize}
\end{itemize}
\section{The Binomial Distribution}
If $X \sim Bin(n,p)$ where $p = \frac{1}{2}$, hence $q = 1 - \frac{1}{2} = \frac{1}{2}$, then
\begin{align}
P(X=k) &= {n\choose k}p^k q^{n-k}\
&= {n\choose k}{\frac{1}{2}}^k \frac{1}{2}^{n-k}\
&= {n\choose k}{\frac{1}{2}}^n\
&= \frac{{n\choose k}}{2^n}
\end{align}
Note that $2^n$ is constant for fixed $n$. Therefore, $P(X=k)$ has symmetry matching the symmetry of Pascal's Triangle.
If $p < \frac{1}{2}$, the distribution is negatively skewed.
\begin{align}
P(X=k) &= {n\choose k}p^k q^{n-k}\
&= {n\choose k}{\frac{1}{6}}^k \frac{5}{6}^{n-k}\
&= \frac{{n\choose k 5^{n-k}}}{6^n}
\end{align}
Note that $5^{n-k}$ does affect the symmetry. If $k$ is small, probabilities to left of the mode are higher. If $k$ is large, probabilities to the right of the mode are lower.
\end{document}


\frac{1]with mismatched delimiters – Steven B. Segletes Jun 18 '21 at 02:07This is pdfTeX, Version 3.141592653-2.6-1.40.22 (MiKTeX 21.3) (preloaded format=pdflatex 2021.5.31), which is definitely different thanformat=pdftex. – Steven B. Segletes Jun 18 '21 at 02:21a \choose bis plain syntax that should not be used in laetx for example) so it's like asking why an English spell checker doesn't work properly on a German text. – David Carlisle Jun 18 '21 at 07:04\\at the end of a paragraph, you do get warnings about badness 10000 (ie as bad as possible) from2. Want to borrow $1$ to $n$ books:\\– David Carlisle Jun 18 '21 at 07:29Underfull \hbox (badness 10000) in paragraph at lines 33--36badness is tex's internal check on the quality of the output and 10000 is the maximum value so tex is telling you it is giving up and the output will be bad. see https://tex.stackexchange.com/a/334249/1090 – David Carlisle Jun 18 '21 at 09:40