Asked
Active
Viewed 204 times
1 Answers
3
Welcome to TeX-SE! This is to give you a start. I am convinced that you could also add the H and T programmatically, but I do not have motivation now to spell this out (the more so since I am not sure if that's what you want).
\documentclass{article}
\usepackage[edges]{forest}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{forest}
for tree={s sep=0cm,l sep=1.2cm,font=\sffamily,
where n children=0{rotate=90,anchor=west,edge={thick,-{Latex}}}{},
edge={thick}
}
[H,alias=L1
[H,alias=L2
[H,alias=L3
[H,alias=L4
[H,alias=L5
[HHHHH,alias=L6]
]
[T
[HHHHT]
]
]
[T
[H
[HHHTH]
]
[T
[HHHTT]
]
]
]
[T
[H
[H
[HHTHH]
]
[T
[HHTHT]
]
]
[T
[H
[HHTTH]
]
[T
[HHTTT]
]
]
]
]
[T
[H
[H
[H
[HTHHH]
]
[T
[HTHHT]
]
]
[T
[H
[HTHTH]
]
[T
[HTHTT]
]
]
]
[T
[H
[H
[HTTHH]
]
[T
[HTTHT]
]
]
[T
[H
[HTTTH]
]
[T
[HTTTT]
]
]
]
]
]
\foreach \X [count=\Y] in {First,Second,Third,Fourth,Fifth}
{\node[anchor=east,font=\sffamily] at (L6.north|-L\Y){\X\ flip};}
\node[anchor=east,font=\sffamily] at (L6.north){Outcome};
\end{forest}
\end{document}
*NOTE**: Almost everything I know about forest I learned from some answers by cfr, who really is a forest master. If you consider upvoting this, please upvote some answer(s) by her instead. That way you will certainly cast a deserved upvote.
\documentclass{article}
\usepackage{adjustbox}
\usepackage[edges]{forest}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{adjustbox}{valign=t,width=0.5\textwidth}
\begin{forest}
for tree={s sep=0cm,l sep=1.2cm,font=\sffamily,
where n children=1{rotate=90,anchor=west,edge={thick,-{Latex}}}{},
edge={thick}
}
[H,alias=L1
[H,alias=L2
[H,alias=L3
[H,alias=L4
[H,alias=L5
[HHHHH,alias=L6
[$5$,alias=L7]
]
]
[T
[HHHHT
[$3$]
]
]
]
[T
[H
[HHHTH
[$3$]
]
]
[T
[HHHTT
[$1$]
]
]
]
]
[T
[H
[H
[HHTHH
[$3$]
]
]
[T
[HHTHT
[$1$]
]
]
]
[T
[H
[HHTTH
[$1$]
]
]
[T
[HHTTT
[$-1$]
]
]
]
]
]
[T
[H
[H
[H
[HTHHH
[$3$]
]
]
[T
[HTHHT
[$1$]
]
]
]
[T
[H
[HTHTH
[$1$]
]
]
[T
[HTHTT
[$-1$]
]
]
]
]
[T
[H
[H
[HTTHH
[$1$]
]
]
[T
[HTTHT
[$-1$]
]
]
]
[T
[H
[HTTTH
[$-1$]
]
]
[T
[HTTTT
[$-3$]
]
]
]
]
]
]
\foreach \X [count=\Y] in {First,Second,Third,Fourth,Fifth}
{\node[anchor=east,font=\sffamily] at (L6.north|-L\Y){\X\ flip};}
\node[anchor=east,font=\sffamily] at (L6.north){Outcome};
\node[anchor=east,font=\sffamily] at (L7.west){Lands on};
\end{forest}
\end{adjustbox}
\begin{adjustbox}{valign=t,width=0.47\textwidth}
\begin{forest}
for tree={s sep=0cm,l sep=1.2cm,font=\sffamily,
where n children=1{rotate=90,anchor=west,edge={thick,-{Latex}}}{},
edge={thick}
}
[T,alias=L1
[H,alias=L2
[H,alias=L3
[H,alias=L4
[H,alias=L5
[THHHH,alias=L6
[$3$,alias=L7]
]
]
[T
[THHHT
[$1$]
]
]
]
[T
[H
[THHTH
[$1$]
]
]
[T
[THHTT
[$-1$]
]
]
]
]
[T
[H
[H
[THTHH
[$1$]
]
]
[T
[THTHT
[$-1$]
]
]
]
[T
[H
[THTTH
[$-1$]
]
]
[T
[THTTT
[$-3$]
]
]
]
]
]
[T
[H
[H
[H
[TTHHH
[$1$]
]
]
[T
[TTHHT
[$-1$]
]
]
]
[T
[H
[TTHTH
[$-1$]
]
]
[T
[TTHTT
[$-3$]
]
]
]
]
[T
[H
[H
[TTTHH
[$-1$]
]
]
[T
[TTTHT
[$-3$]
]
]
]
[T
[H
[TTTTH
[$-3$]
]
]
[T
[TTTTT
[$-5$]
]
]
]
]
]
]
\end{forest}
\end{adjustbox}
\end{document}
-
-
Thanks a lot!! It's really helpful! Can I ask you one more question? How can I produce one more line:Lands on: 5 3 3 1 3 1 1 -1 3 1 1 -1 1 -1 -1 -3? And Is that possible to put graph for H and graph for T side by side? – Karena Mar 07 '19 at 10:37



\documentclass, includes all relevant\usepackagecommands, ends with\end{document}and compiles without errors, even if it does not produce your desired output. Welcome to TeX.SX. – Sandy G Mar 06 '19 at 17:53