# Un arbre de probabilité 2×3

Voici son code :

input geometriesyr16.mp ;

%------------------------------------------------------------------------
% Arbre 2x3
%------------------------------------------------------------------------

u:=1cm;
figure (-8u,-12u,10u,8u);
pair S,T[],U[];

numeric dx,dh,cr;
dx:=3;
dh:=1.5;
cr:=0.1;

for i:=1 upto 6:
U[i]:=(2*dx*u,-i*dh*u);
endfor

T[1]:= 0.5[U[1],U[3]] shifted(-dx*u,0);
T[2]:= 0.5[U[4],U[6]] shifted(-dx*u,0);

S:= 0.5[T[1],T[2]] shifted(-dx*u,0);

draw cr[S,T[1]]--(1-cr)[S,T[1]];
draw cr[S,T[2]]--(1-cr)[S,T[2]];
draw cr[T[1],U[1]]--(1-cr)[T[1],U[1]];
draw cr[T[1],U[2]]--(1-cr)[T[1],U[2]];
draw cr[T[1],U[3]]--(1-cr)[T[1],U[3]];
draw cr[T[2],U[4]]--(1-cr)[T[2],U[4]];
draw cr[T[2],U[5]]--(1-cr)[T[2],U[5]];
draw cr[T[2],U[6]]--(1-cr)[T[2],U[6]];

%----------- premier niveau
label(btex $E$ etex,T[1]);
label.ulft(btex $3 \over 4$ etex,0.6[S,T[1]]);

label(btex $\overline{E}$ etex,T[2]);
label.llft(btex $1 \over 4$ etex,0.6[S,T[2]]);

%----------- deuxième niveau supérieur
label(btex $A$ etex,U[1]);
label.ulft(btex $0,1$ etex,0.6[T[1],U[1]]);

label(btex $B$ etex,U[2]);
label.ulft(btex $0,4$ etex,0.6[T[1],U[2]]);

label(btex $C$ etex,U[3]);
label.llft(btex $0,5$ etex,0.6[T[1],U[3]]);

%----------- deuxième niveau inférieur
label(btex $A$ etex,U[4]);
label.ulft(btex $0,2$ etex,0.6[T[2],U[4]]);

label(btex $B$ etex,U[5]);
label.ulft(btex $0,1$ etex,0.6[T[2],U[5]]);

label(btex $C$ etex,U[6]);
label.llft(btex $0,7$ etex,0.6[T[2],U[6]]);

fin;
%-----------------------------------------------------------------------

%-----------------------------------------------------------------------
end ;