\documentclass[mathserif]{beamer}
\setbeamertemplate{navigation symbols}{}
\usepackage{graphicx,color,amsmath}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{beamerthemeshadow}
\usefonttheme{serif}
\usetheme{warsaw}
%\pagenumbering{}
%\inserttotalframenumber
\setbeamerfont{structure}{family=\rmfamily,shape=\itshape}
 \begin{document}
\begin{frame}[plain]
  \begin{algorithm}[ht!]
\caption{LSM Algorithem for American Option Pricing}
\label{alg1}
\begin{algorithmic}
\REQUIRE $n$ = The number of time steps, $N$ = The number of paths, $m$ = The number of basis, $r$ = The riskless interest rate, $S$ =  The matrix of simulated paths($size (S) = [N,n]$), $H$ = Barrier.
\ENSURE $V_0=$ The price of American option
\STATE $V \leftarrow h_L(S(:,L))$
\STATE $Time \leftarrow$ a vector that all components are equal to $n$ ($length(Time) = N$)
\FOR {$i=n-1$ to $1$}
\STATE  $\alpha\leftarrow (A^TA)^{-1}A~ydata$
\STATE  $ \hat C \leftarrow  A \alpha$
\STATE $lx \leftarrow  $ length($xdata$)
Update $V$ and $Time$:
\FOR {$j=1$ to $lx$}
\STATE
\IF{$\hat C_j \geqslant (h)_j(xdata_j)$ }
\STATE set the elements of $V$ and $Time$ corresponding to $xdata_j$ to $\hat C_j$ and $i$ respectively
\ENDIF
\ENDFOR 
\ENDFOR
$V_0=$ $sum(d_{0,Time}V)/M$
\end{algorithmic}
\end{algorithm}
\end{frame}
\end{document} 