\documentclass{article}
\usepackage{amsmath}
\usepackage{fancyhdr}
\usepackage{amssymb}
\pagestyle{fancy}
\rhead{Homework for Stats Chapter 4\textbackslash Lab}
\cfoot{Page \thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
\section{4.4 Excercises}
\begin{enumerate}
\item For each experiment, list the sample space and the probabilities
for each outcome. Compute the expected number of heads in each case.
\begin{enumerate}
\item Two independent tosses of a fair coin\\
\{(HH),(HT),(TH),(TT)\}\\
$\mathbb{P}(HH)=\frac{1}{4} \mathbb{P}(HT)
=\frac{1}{4}\mathbb{P}(TH)=\frac{1}{4}\mathbb{P}(TT)
=\frac{1}{4}$\\
\begin{align}
\mathbb{E}\left ( H\right )=\sum _{i=0}H_i\cdot p_i & =2\cdot\frac{1}{4}+1\cdot\frac{1}{4}+1\cdot\frac{1}{4}+0\cdot\frac{1}{4}\\
& =\frac{1}{2}+\frac{1}{4}+\frac{1}{4}\\
& =1\\
\end{align}
\end{enumerate}
\end{enumerate}
\end{document}
Can't see where I'm messing up. I've closed everything. Getting "Paragraph ended before \align was complete.
Best Answer
You have a blank line in your align environment. I made some modifications to your code: replaced inline
\frac
(too small, in my opinion) with\mfrac
(=medium-sized fractions, ~80 % of display style fractions) from thenccmath
package, deleted another blank line and as I think each line of your alignment needs not be numbered, I took the liberty to replace it with analigned
environment, nested inequation
.