Clear[X,Rep,Time,i,Chans];For[i=1;Rep=100000;Time=0,i≤Rep,i++,X=0;While[X==0,Time=Time+1;Chans=Random[UniformDistribution[{0,1}]];If[Chans<N[1/6],X=2,If[Chans<N[1/2],X=1]]];While[X==1,Time=Time+1;Chans=Random[UniformDistribution[{0,1}]];If[Chans<N[1/3],X=2]]];N[Time/Rep]