# I'm getting the error “missing } inserted” in LaTeX

\documentclass [12pt,letterpaper]{exam}
\usepackage{amsmath, amsthm, amsfonts, amssymb, amscd, latexsym}
\usepackage{type1cm}
\usepackage{simplemath}

\oddsidemargin  0.0in
\evensidemargin 0.0in
\textwidth      6.0in
\topmargin      1.0in
\textheight     8.5in

%\begin{math}
\newcounter{count}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{enumerate}
\item If E=$\phi$ then it is obvious that a $\notin$ E $\Rightarrow$ $\delta_a$ (E)=0. Now let $\ra E_n$ be a sequence
of subsets of X such that:
\\*n$\neq$m$\Rightarrow$ $E_n$$\cap$$E_m$=$\Phi$
This is not a trivial statement as it also implies that "a" could belong to at most one term of the sequence.
\\*Hence we have:
\begin{enumerate}
\item'a' belongs to a term $E_i$ of the sequence
\item'a' does not belong to any of the terms.
\end{enumerate}
For (a):
\\* We have a $\in$ ${\bigcup\limits_{n=1}^\infty}$ $E_n$=${\bigcup\limits_{n=1 \\* n\neq i}^\infty}$ $E_n$ $\cup$ $E_i$$\Rightarrow \delta_a({\bigcup\limits_{n=1}^\infty}$$E_n$)=1
\\*But,
\\*${\sum\limits_{n=1}^\infty}$$\delta_a (E_n)={\sum\limits_{n=1 n\neq i}^\infty}$$\delta_a$ $(E_n)$ + $\delta_a$ $(E_i)$=1 (Since $\delta_a$ $(E_n)$=$\forall$ n$\neq$ i)
\\*Hence,
\\*$\delta_a$(${\bigcup\limits_{n=1}^\infty}$$E_n)= {\sum\limits_{n=1}^\infty} \delta_a (E_n)\\*\\* For (b):\\* a \notin {\bigcup\limits_{n=1}^\infty} E_n \Leftrightarrowa \notin E_n \forall n \Rightarrow$${\bigcup\limits_{n=1}^\infty}$$\delta_a(E_n) Thus from the above we conclude that \delta_a is a measure on X (the Dirac Measure in a) \item \begin{enumerate} \item \int_Ef d\mu = \int_Ef d\delta_a \\*Assuming f is measurable, we know that if a \notinE then \\* \delta_a(E)=0 and thus \int_Ef d\delta_a=0 \\* If a\inE, then we can define the set B=\{a\} and C=E-B \\* We get, \mu(e)=\delta_a(e)=0. Since a\notine. Also, we have B\subsetE, thus, assuming E\inm, by corollary of theorm 11.2 (lecture 10) we have \\* \int_Ef d\delta_a = \int_af d\delta_a = f(a) \\* Thus, we have \int_Ef d \delta_a = \begin{cases} 0 & \text{ if } a\in E\\ f(a) & \text{ if } a\notin E \end{cases} \\* \item Let E = \{n_1 ... n_k\ \LeftrightarrowE = {\bigcup\limits_{n=1}^k} \{n_k\}\\* Then,\\* \int_E f d\mu = {\int_{\bigcup\limits_{n=1}^k{n}} f d\mu_c}= {\sum\limits_{n=1}^k} {\int_{\{n\}} f d\mu_c = {\sum\limits_{n=1}^k} f(n_i) = {\sum\limits_{x_i\in E}}f(n_i) \end{enumerate} \end{enumerate} %\end{math} \end{document}  I'm getting the error in the second to last \end{enumerate} Im doing this for the first time, kindly help, please. ## 2 Answers \*{\sum\limits_{n=1}^\infty}$$\delta_a$ $(E_n)$=${\sum\limits_{n=1 n\neq i}^\infty}$$\de  here you are going into and out of math mode for each term which makes the source impossible to follow (it is not surprising that you missed a $ but also makes a very poor layout. this is a single displayed expression and should be set as such.

I probably missed some cases, but this uses slightly more reasonable markup and runs without error.

\documentclass [12pt,letterpaper]{exam}
\usepackage{amsmath, amsthm, amsfonts, amssymb, amscd, latexsym}
\usepackage{type1cm}
%\usepackage{simplemath}
\newcommand\ra{arightarrow}

\oddsidemargin  0.0in
\evensidemargin 0.0in
\textwidth      6.0in
\topmargin      1.0in
\textheight     8.5in

%\begin{math}
\newcounter{count}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\begin{enumerate}
\item If $E=\phi$ then it is obvious that
$a \notin E \Rightarrow \delta_a (E)=0$. Now let $\ra E_n$ be a sequence
of subsets of $X$ such that:
$\neq m\Rightarrow E_n \cap E_m=\Phi$
This is not a trivial statement as it also implies that $a$
could belong to at most one term of the sequence.

Hence we have:
\begin{enumerate}
\item $a$ belongs to a term $E_i$ of the sequence
\item $a$ does not belong to any of the terms.
\end{enumerate}

For (a):
We have
$a\in {\bigcup\limits_{n=1}^\infty} E_n= {\bigcup\limits_{n=1 n\neq i}^\infty} E_n \cup E_i \Rightarrow \delta_a({\bigcup\limits_{n=1}^\infty}E_n)=1$
But,
${\sum\limits_{n=1}^\infty}\delta_a (E_n)={\sum\limits_{n=1 n\neq i}^\infty}\delta_a (E_n) + \delta_a (E_i)=1 (Since \delta_a (E_n)=\forall n\neq i)$
Hence,
$\delta_a({\bigcup\limits_{n=1}^\infty}E_n)= {\sum\limits_{n=1}^\infty} \delta_a (E_n)$
For (b):
$a \notin {\bigcup\limits_{n=1}^\infty} E_n \Leftrightarrow a \notin E_n \forall n \Rightarrow{\bigcup\limits_{n=1}^\infty}\delta_a(E_n)$
Thus from the above we conclude that $\delta_a$ is a measure on $X$ (the Dirac Measure in $a$)
\item \begin{enumerate}
\item
$\int_Ef d\mu = \int_Ef d\delta_a$
Assuming $f$ is measurable, we know that if $a \notin$ then
$\delta_a(E)=0 and thus \int_Ef d\delta_a=0$
If $a\in E$, then we can define the set $B=\{a\}$ and $C=E-B$.

We get, $\mu(e)=\delta_a(e)=0$. Since $a\notin e$.
Also, we have $B\subset E$, thus, assuming $E\in m$,
by corollary of theorm 11.2 (lecture 10) we have
$\int_E f d\delta_a = \int_af d\delta_a = f(a)$
Thus, we have
$\int_Ef d \delta_a = \begin{cases} 0 & \text{ if } a\in E\\ f(a) & \text{ if } a\notin E \end{cases}$

\item Let
$E = \{n_1 ... n_k\ \Leftrightarrow E = {\bigcup\limits_{n=1}^k} \{n_k\}$
Then,
\begin{align}
\int_E f d\mu &= {\int_{\bigcup\limits_{n=1}^k{n}} f d\mu_c}\\
&=
{\sum\limits_{n=1}^k} \int_{\{n\}}  f d\mu_c\\
& =
{\sum\limits_{n=1}^k} f(n_i)\\
& =
{\sum\limits_{x_i\in E}}f(n_i)
\end{align}
\end{enumerate}
\end{enumerate}
%\end{math}
\end{document}


The last $ is missing:  \item Let E =$\{n_1 \dots n_k\ \Leftrightarrow$E =${\bigcup\limits_{n=1}^k}\{n_k\}$\\* %%% ^^^^^  and this one looks not correct: $\int_E f d\mu = {\int_{\bigcup\limits_{n=1}^k{n}} f d\mu_c}=
{\sum\limits_{n=1}^k} {\int_\{n\}}  f d\mu_c =
{\sum\limits_{n=1}^k} f(n_i) =
{\sum\limits_{x_i\in E}}f(n_i)
\$