[Tex/LaTex] How to create this game-tree in Latex

arrowstablestrees

I have the following figure:

Game tree

As of now I create this in Word/Powerpoint and paste the screenshot in a LaTeX file. Is there a way to create this natively? Also, what would be the advantage of doing so?

The tables are just place holders and actual table design/content may change. But I prefer if it could be editable and not fixed. I'm not sure I even know where to start or how to go about it. I've never needed to draw anything in LaTeX before.

Best Answer

Using forest:

\documentclass{article}
\usepackage{forest}

\newcommand\mytable[5]{%
#1\\
\begin{tabular}[t]{*{3}{|c}|}
\hline
& T1 & T2 \\
\hline
T1 & #2 & #3 \\
\hline
T2 & #4 & #5 \\
\hline
\end{tabular}%
}

\begin{document}
\begin{forest}
for tree={parent anchor=south, child anchor=north,l=2cm,edge={->}},
for descendants={text width=4.2cm,align=c}
[Developers
  [\mytable{Type I probability: 0.2}{A,B}{C,D}{E,F}{G,H}]
  [\mytable{Type II probability: 0.5}{P,Q}{R,S}{U,V}{W,X}]
  [\mytable{Type III probability: 0.3}{A,B}{C,D}{E,F}{G,H}]
]
\end{forest}

\end{document}

enter image description here

As mbork notices in his comment, perhaps you can avoid most of the lines in the tables:

\documentclass{article}
\usepackage{forest}

\newcommand\mytable[5]{%
#1\\[1ex]
{%
\renewcommand\arraystretch{1.3}%
\begin{tabular}[t]{c|cc}
& T1 & T2 \\
\hline
T1 & #2 & #3 \\
T2 & #4 & #5 \\
\end{tabular}%
}%
}

\begin{document}
\begin{forest}
for tree={parent anchor=south, child anchor=north,l=2cm,edge={->}},
for descendants={text width=4.2cm,align=c}
[Developers
  [\mytable{Type I probability: 0.2}{A,B}{C,D}{E,F}{G,H}]
  [\mytable{Type II probability: 0.5}{P,Q}{R,S}{U,V}{W,X}]
  [\mytable{Type III probability: 0.3}{A,B}{C,D}{E,F}{G,H}]
]
\end{forest}

\end{document}

enter image description here

Related Question