# Scenario Trees for Prob

Would appreciate if anyone help me draw this network? Thank you in advance.

• Can you let us know how is this different from this old question of yours? tex.stackexchange.com/q/243919/32374 You've provided us with no code to go by... – darthbith May 21 '15 at 20:09
• My only problem is how to make the second set of trees straight and horizontal and not sloped in the previous diagram. Thank you. – user28251 May 21 '15 at 20:18
• This answer tex.stackexchange.com/a/166303/32374 that was linked on your previous question shows some straight lines... can you duplicate that? If not, you need to be quite specific about what you can't do, in particular, by providing code that shows something close to what you want, but not quite. – darthbith May 21 '15 at 20:48

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[c/.style 2 args={insert path={node[n={#1}{#2}] (n#1#2){}}},
n/.style 2 args={circle,fill,inner sep=1pt,label={90:$D(#1,#2)$}}
]
\path (-2,4.5)[c={1}{1}];
\foreach\y in{1,...,8}{
\draw (n11) -- (2,\y)[c={2}{\y}] -- (4,\y) [c={3}{\y}] -- (6,\y) [c={4}{\y}]
node[right]{Scen\y};}
\end{tikzpicture}
\end{document}


• @user28251 my pleasure but please try to give us at least a code attempt next time. Believe it or not typing those first two lines is a torture for every question here. – percusse May 21 '15 at 20:59
• Sure, I will exactly that next time. – user28251 May 21 '15 at 21:04

A short code with pstricks and etoolbox:

\documentclass[pdf, x11names, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[charter]{mathdesign}
\usepackage{etoolbox}

\begin{document}

\begin{pspicture}$\psset{xunit=2.5, tickstyle=top, ticksize=6pt, tickwidth=0.6pt, labels=none, labelsep=4pt, dotsize=5pt, linecolor=LightSteelBlue3, tickcolor=LightSteelBlue3} \psaxes[linewidth=0.6pt,](0,0.3)(4,0.3) \dotnode[linecolor=SteelBlue4!80!](1,4.5){D11}\uput[ul](D11){D_{1,1}} \multido{\ic=2+1}{3}{\multido{\il=8+-1,\im=1+1}{8}{% \dotnode[linecolor=SteelBlue4!80!](\ic,\il){D\ic\im} \ifnumless{\ic}{3}{\uput[55](D\ic\im){D(\ic, \im)}}{\uput[120](D\ic\im){D(\ic, \im)}} }% } \multido{\i=0+1}{5}{\uput[d](\i, 0){t = \i}} \multido{\im=1+1}{8}{\ncline{D11}{D2\im}\ncline{D2\im}{D3\im}\ncline{D3\im}{D4\im}\uput[r](D4\im){\enspace\textrm{Scen \im}}} \ncline{D11}{D1}$\end{pspicture}

\end{document}

{}


Since it is a tree, you should have a forest...

\documentclass[tikz,border=5pt,multi]{standalone}
\usepackage{forest}
\begin{document}

\begin{forest}
delay={
for tree={
grow'=0,
l sep+=50pt,
circle,
minimum width = 2.5pt,
fill,
inner sep = 0pt,
parent anchor = center,
child anchor = center,
tier/.wrap pgfmath arg={tier #1}{level()},
delay n=1{
if level=1{
label/.wrap 2 pgfmath args={[font=\footnotesize]above right:$D(#1,#2)$}{int(level()+1)}{n},
}{
if level=0{
label={[font=\footnotesize]above left:$D(1,1)$}
}{
label/.wrap 2 pgfmath args={[font=\footnotesize]above left:$D(#1,#2)$}{int(level()+1)}{n("!to tier=tier 1")},
if n children=0{
l sep+=-70pt,
append={[, font=\footnotesize, content/.wrap pgfmath arg={Scen #1}{n("!to tier=tier 1")}, no edge]}
}{},
}
}
}
}
},
[,
repeat=8{
append = {[[[]]]}
},
]
\end{forest}

\end{document}


Here's a way to do it for anyone interested in using asymptote.

unitsize(1inch);
pair d11 = (1, 1.5);
label("$D$(1,1)", d11, NW);
for (int y = 1; y <= 8; ++y)
{
path p = d11;
pair d;
for (int x = 2; x <= 4; ++x)
{
d = (x, (9-y)/3.0);
p = p--d;
label("$D$("+string(x)+","+string(y)+")", d+(0,0.1), (3-x,0));
}
label("Scen "+string(y), d, 2*E);
draw(p);
dot(p);
}
draw((0,0)--(4,0));
for (int x = 0; x <= 4; ++x)
{
draw((x,0)--(x,0.1));
label("$t="+string(x)+"$", (x,0), S);
}