Following the example in "Single ampersand used with wrong catcode" error using tikz matrix in beamer I removed the errors I got but the tree is still not produced correctly. I am trying to reproduce in beamer what I saw in this thread: http://www.latex-community.org/forum/viewtopic.php?f=45&t=7846&sid=2129f08cf0ff8d6a5473794a64bdf5ac
Thanks in advance.
\documentclass[xcolor=pdflatex,dvipsnames,table]{beamer}
\usepackage{tikz}
\usetikzlibrary{matrix}
\mode<presentation>
\usetheme{JuanLesPins}
\setbeamercovered{transparent=30}
\title[Investment Science II]{ Investment Science II \\ Introduction to Binomial Trees }
\author[ Anonymous]
{ Investment Science II }
\institute{ Blah University }
\begin{document}
\frame{\maketitle}
\begin{frame}
\begin{tikzpicture}
\matrix (tree) [matrix of nodes,ampersand replacement=\&]
{
\& \& F \\
\& C \& \\
\$A \& \& E \\
\& B \& \\
\& \& D \\
};
\draw[->] (tree-3-1) -- (tree-2-2) node [midway,above] {$p$};
\draw[->] (tree-3-1) -- (tree-4-2) node [midway,below] {$(1-p)$};
\draw[->] (tree-2-2) -- (tree-1-3) node [midway,above] {$p^2$};
\draw[->] (tree-2-2) -- (tree-3-3) node [midway,below] {$(1-p)p$};
\draw[->] (tree-4-2) -- (tree-3-3) node [midway,above] {$(1-p)p$};
\draw[->] (tree-4-2) -- (tree-5-3) node [midway,below] {$(1-p)^2$};
\end{tikzpicture}
\end{frame}
\end{document}
