[Tex/LaTex] Bad math environment delimiter. \end{equation}

delimitersenvironmentsequationsmath-mode

hi i am beginner in latex and i am trying to write these 2 equations however i got different errors what is wrong with this code ? please,can anyone help ? thanks in advance

\begin{equation}


$Support(X  )= \frac{No,of\; transactions\;  that \; contain\;  X}{No,of \;transactions\; in\; the \;database}$

\end{equation}

%\noindent
\begin{equation}

$confidence(X \longrightarrow Y)$=$ \frac {Support (X \cup Y) }{ support(X)}$
\end{equation}

The error messages are:

Missing $ inserted. 
Display math should end with $$.
Bad math environment delimiter. \end{equation} 
  Missing $ inserted. \end{equation}
  You can't use `\eqno' in vertical mode. 

Best Answer

I think the following may be what you're looking to write. Observe the use of \text in the numerator and denominator of the first equation. I encased the term X in the first numerator in $ symbols to inform LaTeX that it (the X) should be processed in math mode.

Observe also that there must be no blank lines in a display-math environment (such as equation).

enter image description here

\documentclass{article}

\usepackage{amsmath} % for "\text" and "\DeclareMathOperator" macros
\DeclareMathOperator{\Support}{Support}
\DeclareMathOperator{\Confidence}{Confidence}

\begin{document}

\begin{equation}
\Support(X) = \frac{\text{No of transactions that contain $X$}}%
                   {\text{No of transactions in the database}}
\end{equation}

\begin{equation}
\Confidence(X \longrightarrow Y) = \frac{\Support(X\cup Y)}{\Support(X)}
\end{equation}

\end{document} 
Related Question