File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/P009-0EmfWt9t.js
import{r as g}from"./reperes-MjYMQS1W.js";import{t as w}from"./diagrammes-QnJBnD2K.js";import{E as C,r as o,w as $,i as M,ax as d,V as k,o as q,l as D}from"./index-hc8lvKav.js";import"./style-0IaNCtso.js";const F="Simulation of random experiments",S="P009",W="691a7";function I(){C.call(this),this.nbQuestions=1,this.nbQuestionsModifiable=!0,this.nbCols=1,this.nbColsCorr=1,this.correctionDetailleeDisponible=!0,this.correctionDetaillee=!0,this.sup=1,this.sup2=1e4,this.sup3=!1,this.nouvelleVersion=function(){let t="",p="",i=2*o(1,5)+2;const l=parseInt(this.sup2),s=[];let x=0;const c=[];this.listeCorrections=[],this.listeQuestions=[];const f=["red","green","blue","black"],r=[o(2,5),o(2,5),o(2,5),o(2,5)];let y=0,u,h,a;for(let e=0;e<4;e++)y+=r[e];switch(parseInt(this.sup)){case 1:if(u=M(1,i),p=`Each face has the same probability of coming out: $${u.texFraction}\\approx ${$(u.pourcentage,2)}\\%$.<br>`,t+=`We roll a die with ${i} faces ${k(l)} times.<br>We study the frequencies of appearance of each face.<br>We obtain the following results: <br>`,this.sup3){for(let e=0;e<i;e++)s.push(0);for(let e=0;e<l;e++)s[o(1,i)-1]++;for(let e=0;e<i;e++)c[e]=[e,d(s[e]/l)]}else{a=o(1,i);for(let e=0;e<i;e++)s.push(0);for(let e=0;e<i;e++)s.push(0);for(let e=0;e<l;e++)s[o(1,i)-1]++;x=s[a-1]*3/4,s[o(1,i,a)-1]+=x,s[a-1]-=x;for(let e=0;e<i;e++)c[e]=[e,d(s[e]/l)];p+="Here, experience shows that there is something which seems to distort this equiprobability like a rigged die.<br>",p+=`Indeed, the frequency of the face $${a}$ is much lower than $${$(u.pourcentage,2)}\\%$.`}break;case 2:if(a=o(1,4),t+="Balls of different colors are placed in an urn.<br>",t+=`There are $${r[0]}$ ${f[0]}, $${r[1]}$ ${f[1]}, $${r[2]}$ ${f[2]} and $${r[3]}$ ${f[3]}.<br>`,t+=`We carry out $${$(l)}$ draws with discount.<br>`,t+="We study the frequencies of appearance of each color.<br>We obtain the following results: <br>",u=M(r[a-1],y),this.sup3){i=4;for(let e=0;e<i;e++)s.push(0);for(let e=0;e<l;e++)h=o(1,y),h<=r[0]?s[0]++:h<=r[0]+r[1]?s[1]++:h<=r[0]+r[1]+r[2]?s[2]++:s[3]++;for(let e=0;e<i;e++)c[e]=[e,d(s[e]/l)]}else{i=4;for(let e=0;e<i;e++)s.push(0);for(let e=0;e<l;e++)h=o(0,y-1),h<r[0]?s[0]++:h<r[0]+r[1]?s[1]++:h<r[0]+r[1]+r[2]?s[2]++:s[3]++;x=s[a-1]*3/4,s[o(1,4,a)-1]+=x,s[a-1]-=x;for(let e=0;e<i;e++)c[e]=[e,d(s[e]/l)];p+="Here, experience shows that there is something that seems to distort this equiprobability like balls discernible by touch.<br>",p+=`Indeed, the frequency of ${f[a-1]} balls is much lower than $${u.texFraction}\\approx ${$(u.pourcentage,2)}\\%$.`}break}switch(parseInt(this.sup)){case 1:t+="$\\begin{array}{|l|"+"c|".repeat(i)+`}
ot`,t+=`\\hline
`,t+="\\text{Side number}";for(let e=0;e<i;e++)t+=` & \\textbf{\\text{${e+1}}}`;t+=`\\\\\\hline
`,t+="\\text{Appearance frequency}";for(let e=0;e<i;e++)t+=` & ${$(100*c[e][1],1)} \\%`;if(t+=`\\\\\\hline
`,t+=`\\end{array}
$`,t+="<br>",this.correctionDetaillee){const b=g({grilleX:!1,grilleY:"dots",xThickListe:!1,xLabelListe:!1,yUnite:.1,yThickDistance:10,yMax:40,xMin:0,xMax:10,yMin:0,axeXStyle:"",yLegende:"frequencies in %"}),m=[];for(let n=0;n<i;n++)m.push(w((b.xMax-b.xMin)/i*(n+.5),c[n][1]*10,n+1));t+=q({xmin:-1,xmax:11,ymin:-4,ymax:5.5,pixelsParCm:30,scale:1},b,m)}break;case 2:t+="$\\begin{array}{|l|"+"c|".repeat(i)+`}
ot`,t+=`\\hline
`,t+="\\text{Color of the ball}";for(let e=0;e<i;e++)t+=` & \\textbf{\\text{${f[e].substring(0,f[e].length-1)}}}`;t+=`\\\\\\hline
`,t+="\\text{Appearance frequency}";for(let e=0;e<i;e++)t+=` & ${$(100*c[e][1],1)} \\%`;if(t+=`\\\\\\hline
`,t+=`\\end{array}
$`,t+="<br>",this.correctionDetaillee){const b=g({grilleX:!1,grilleY:"dots",xThickListe:!1,xLabelListe:!1,yUnite:.1,yThickDistance:10,yMax:55,xMin:0,xMax:10,yMin:0,axeXStyle:"",yLegende:"frequencies in %"}),m=[];for(let n=0;n<i;n++)m.push(w((b.xMax-b.xMin)/i*(n+.5),c[n][1]*10,f[n]));t+=q({xmin:-1,xmax:12,ymin:-4,ymax:7,pixelsParCm:30,scale:1},b,m)}break}this.listeQuestions.push(t),this.listeCorrections.push(p),D(this)},this.besoinFormulaireNumerique=["Type of experience",2,`1: Drawing of dice
2: Drawing from an urn`],this.besoinFormulaire2Texte=["Number of prints","Type an integer: 10000 for example"],this.besoinFormulaire3CaseACocher=["Equiprobability",!0]}export{I as default,S as ref,F as titre,W as uuid};
//# sourceMappingURL=P009-0EmfWt9t.js.map