File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/5S13-2-GhWknRST.js
import{d as R}from"./diagrammes-_PB4x9vx.js";import{E as M,aj as B,l as S,o as j,aa as V,h as v,ai as W,r as p,W as y,b4 as h,ax as Q,c as q,i as T,w,f as k,ci as N,s as E,a as A}from"./index-ajJ0B2-K.js";import{t as P}from"./tableau-klWf8qqZ.js";import"./reperes-w_D-727i.js";import"./style-YtQgMMZt.js";const U="Frequency calculations",Y=!0,K="mathLive",X=!0,Z="AMCHybride";function I(b,l){const i=new Array(l),f=Math.floor(b/l),o=b%l;for(let e=0;e<i.length-1;e++)i[e]=f;i[i.length-1]=f+o;for(let e=0,t=0;e<i.length-2;e++){t=p(-i[e]+1,i[e]-1),i[e]+=t;const s=i.length-e-2;let a=0;t>=0?a=Math.floor(t/s):a=Math.ceil(t/s);const n=t%s;for(let u=e+1;u<i.length-1;u++)i[u]-=a;i[i.length-1]-=n}return i}function J(b,l,{reperageTraitPointille:i=!1,couleurDeRemplissage:f="blue",titreAxeVertical:o="",titre:e="",hauteurDiagramme:t=8,coeff:s=2,axeVertical:a=!1,etiquetteValeur:n=!0,labelAxeVert:u=!1}){const c=R(b,l,{reperageTraitPointille:i,couleurDeRemplissage:f,titreAxeVertical:o,titre:e,hauteurDiagramme:t,coeff:s,axeVertical:a,etiquetteValeur:n,labelAxeVert:u});return j(Object.assign({},V([c],{rxmin:-3,rymin:-3,rymax:1.5}),{style:"inline",scale:.5}),c)}class F{constructor(l){const i=["establishment","living room","car park","collection"],f=new Map;f.set("establishment",{lieu:"an institution",individus:"students",caractere:"their favorite sport",caracterePourTableau:"Sports",modalites:["Soccer","Rugby","Basketball","Tennis","Judo","Handball","Volleyball","Athletics","Ping-pong"]}),f.set("living room",{lieu:"an European esports show",individus:"visitors",caractere:"their country of origin",caracterePourTableau:"Country",modalites:["France","England","Holland","Spain","Italy","Belgium","Germany","Portugal","Austria"]}),f.set("car park",{lieu:"a supermarket parking lot",individus:"cars",caractere:"their color",caracterePourTableau:"Colors",modalites:["Black","White","Blue","Red","Green","Gray","Brown","Yellow","Orange"]}),f.set("collection",{lieu:"a collection",individus:"discs",caractere:"the music genres",caracterePourTableau:"Styles",modalites:["Pop","Jazz","Rap","RnB","Folk","Rock","Electro","Reggae","Drunk"]});let o={};l==="chance"?o=f.get(v(i)):o=f.get(l),this.lieu=o.lieu,this.individus=o.individus,this.caractere=o.caractere,this.caracterePourTableau=o.caracterePourTableau,this.effectifTotal=v([100,120,150,200,250,400,500,1e3]),this.modalites=W(o.modalites.slice(0,p(5,o.modalites.length))),this.effectifs=I(this.effectifTotal,this.modalites.length),this.rangEffectifCache=p(0,this.modalites.length-1),this.entreeCachee=this.modalites[this.rangEffectifCache]}getPreambule(l){let i=`In ${this.lieu} of ${this.effectifTotal} ${this.individus}, we noted ${this.caractere}.<br>`;switch(l){case"painting ":i+="The results are recorded in the following table:<br><br>";break;case"diagram":i+="We represented this data using the diagram below.<br><br>";break;default:throw Error("Error: styleExo is neither table nor diagram")}return i}getEntrees(){const l=new Map;for(let i=0;i<this.modalites.length;i++)l.set(this.modalites[i],this.effectifs[i]);return l}}const ee="ff67d",te="5S13-2";function ie(){M.call(this),this.consigne="",this.nbQuestions=1,this.nbQuestionsModifiable=!0,this.spacing=1,this.spacingCorr=1.5,this.nbCols=1,this.nbColsCorr=1,this.sup=1,this.besoinFormulaireNumerique=["Type of questions",4,["1: Choice of a random exercise from the two versions","2: Calculate frequencies from a staffing table","3: Calculate frequencies from a stick diagram","4: The two versions in two questions (theme of the 2nd at random)"].join(`
`)],this.sup2=1,this.besoinFormulaire2Numerique=["Context theme",5,["1: Random","2: School and favorite sports","3: European exhibition and nationalities of participants","4: Parking and car colors","5: Record collection and music styles"].join(`
`)];const b=["chance","establishment","living room","car park","collection"];function l(o,e,t,s){let a=[];const n=p(0,e.effectifs.length-1,e.rangEffectifCache),u=y(e.effectifs[n]*100/e.effectifTotal,1);let c="<br>"+h(0)+`The missing squad is that of the ${e.entreeCachee.charAt(0).toLocaleLowerCase()+e.entreeCachee.slice(1)}. Let $e$ be this number.<br>`;c+=`$e=${e.effectifTotal}-(`;let d=!0;e.effectifs.forEach((m,g)=>{g!==e.rangEffectifCache&&(d?(c+=`${m}`,d=!d):c+=`+${m}`)}),c+=")$<br>",c+=`$e=${e.effectifTotal}-${Q(e.effectifTotal-e.effectifs[e.rangEffectifCache])}$<br>`,c+=`$e=${e.effectifs[e.rangEffectifCache]}$`;let r;if(!q.isAmc&&!t.interactif){r="<br>"+h(1)+"Frequency calculations.<br><br>",r+="We recall that for the frequency relative to a value is given by the quotient:",r+="$\\dfrac{\\text{effective value}}{\\text{total effective}}$<br><br>",r+="We therefore deduce the following calculations:<br><br>";const m=[""],g=[],$=[],x=[];e.effectifs.forEach((D,L)=>{m.push(`\\text{${e.modalites[L]}}`);const C=T(D,e.effectifTotal);$.push(C.texFraction),x.push(`${w(C.pourcentage)} ${k(1)}\\%`)}),g.push("\\textbf{Frequencies}","\\textbf{Frequencies in percentages}"),r+=P(m,g,$.concat(x)),r+="<br>"}else{r="<br>"+h(1)+`Calculation of the frequency of the ${e.modalites[n]} value.<br><br>`,r+="We recall that for the frequency relative to a value is given by the quotient:",r+="$\\dfrac{\\text{effective value}}{\\text{total effective}}$<br><br>",r+="We therefore deduce:<br>";const m=T(e.effectifs[n],e.effectifTotal);r+=`$\\text{Frequency}_{${e.modalites[n]}}= ${m.texFraction}$<br>`,r+=`$\\text{Frequency}_{${e.modalites[n]}}${N(e.effectifs[n]*100/e.effectifTotal,1)}${w(y(m.pourcentage,1))} ${k(1)}\\%$`}return!t.interactif&&!q.isAmc?a=[o,"<br>"+h(0)+"Determine the missing workforce.","<br>"+h(1)+`Determine the frequencies for each ${e.caractere.substring(5)} (as a percentage, round to the nearest tenth if necessary).`]:q.isAmc?t.autoCorrection[s]={options:{multicols:!0},enonce:o+"<br>"+h(0)+"Determine the missing workforce.<br>"+h(1)+`Determine the frequency of the ${e.modalites[n]} value (in percentage, round to the tenth if necessary).`,propositions:[{type:"AMCNum",propositions:[{texte:c+r,reponse:{texte:h(0),valeur:[e.effectifs[e.rangEffectifCache]],param:{digits:3,decimals:0,signe:!1}}}]},{type:"AMCNum",propositions:[{texte:"",reponse:{texte:h(1),valeur:[u],param:{digits:3,decimals:1,signe:!1}}}]}]}:(E(t,s*2,e.effectifs[e.rangEffectifCache],{formatInteractif:"calculation"}),E(t,s*2+1,u,{formatInteractif:"calculation"}),a=[o,"<br>"+h(0)+"Determine the missing workforce."+A(t,s*2,"width10 inline"),"<br>"+h(1)+`Determine the frequency of the ${e.modalites[n]} value (in percentage, round to the tenth if necessary).`+A(t,s*2+1,"width10 inline")]),{questions:a.join(`
`),corrections:[c,r].join(`
`)}}function i(o,e,t){const s=new F(o);let a=s.getPreambule("painting ");const n=[`\\text{\\textbf{${s.caracterePourTableau}}}`];for(const r of s.modalites)n.push(`\\text{${r}}`);n.push("\\text{\\textbf{TOTAL}}");const u=["\\text{\\textbf{Skills}}","\\text{\\textbf{Frequencies}}"],c=[];s.effectifs.forEach((r,m)=>{m!==s.rangEffectifCache?c.push(r):c.push("")}),c.push(`${s.effectifTotal}`);for(let r=0;r<=s.effectifs.length;r++)c.push("");a+=P(n,u,c,1.5),a+="<br>";const d=l(a,s,e,t);return{questions:d.questions,corrections:d.corrections,effectifs:s.effectifs}}function f(o,e,t){const s=new F(o);let a=s.getPreambule("diagram");const n=s.effectifs.map((d,r)=>r!==s.rangEffectifCache?d:0),u=J(n,s.modalites,{reperageTraitPointille:!1,axeVertical:!0,titreAxeVertical:"Workforce",labelAxeVert:!0});a+=u;const c=l(a,s,e,t);return{questions:c.questions,corrections:c.corrections,effectifs:s.effectifs}}this.nouvelleVersion=function(){this.listeQuestions=[],this.listeCorrections=[],this.autoCorrection=[];const o=b[this.sup2-1],e={questions:[],corrections:[]};let t={};const s=B([0,1],this.nbQuestions);for(let a=0,n=0;a<this.nbQuestions&&n<50;){switch(this.sup){case 1:switch(s[a]){case 0:t=f(o,this,a);break;case 1:t=i(o,this,a);break}e.questions=[t.questions],e.corrections=[t.corrections];break;case 2:t=i(o,this,a),e.questions=[t.questions],e.corrections=[t.corrections];break;case 3:t=f(o,this,a),e.questions=[t.questions],e.corrections=[t.corrections];break;case 4:t=i(o,this,a),e.questions=[t.questions],e.corrections=[t.corrections],t=f("chance",this,a),e.questions.push(t.questions),e.corrections.push(t.corrections)}this.questionJamaisPosee(a,...t.effectifs)&&(this.listeQuestions.push(...e.questions),this.listeCorrections.push(...e.corrections),a++),n++}S(this)}}export{X as amcReady,Z as amcType,ie as default,Y as interactifReady,K as interactifType,te as ref,U as titre,ee as uuid};
//# sourceMappingURL=5S13-2-GhWknRST.js.map