Un arbre de probabilité 2×2

Voici son code :

input geometriesyr16.mp ;

%------------------------------------------------------------------------
% Arbre 2x2
%------------------------------------------------------------------------

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

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

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

T[1]:= 0.5[U[1],U[2]] shifted(-dx*u,0);
T[2]:= 0.5[U[3],U[4]] 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[2],U[3]]--(1-cr)[T[2],U[3]];
draw cr[T[2],U[4]]--(1-cr)[T[2],U[4]];

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

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

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

label(btex $\overline{B}$ etex,U[2]);
label.llft(btex $0,9$ etex,0.6[T[1],U[2]]);

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

label(btex $\overline{B}$ etex,U[4]);
label.llft(btex $0,7$ etex,0.6[T[2],U[4]]);

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

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