next up previous contents index
suivant: Analyse du résultat monter: Les quatre cartes bicolores précédent: Les quatre cartes bicolores   Table des matières   Index

Simulation

cartebic4(n):={
  local C,a,b,nbi;
  C:=[[0,0],[0,1],[1,1],[1,1]];
  nbi:=0
  for (k:=0;k<n;k++){
    a:=rand(4);
    b:=rand(2);
    while (C[a,b]==0) {
      a:=rand(4);
      b:=rand(2);
    }
    if (C[a,irem(b+1, 2)]==0) {
      nbi:=nbi+1;
    }
  }
  return(evalf(nbi/n));
};
On a obtenu:
cartebic4(300)= 0.18
cartebic4(3000)= 0.203666666667
cartebic4(30000)=0.2019


Documentation de giac écrite par Renée De Graeve