File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/can1P06-s1TSYuRi.js.map
{"version":3,"file":"can1P06-s1TSYuRi.js","sources":["../../src/exercices/can/1e/can1P06.js"],"sourcesContent":["import { choice } from '../../../lib/outils/arrayOutils'\nimport { sp } from '../../../lib/outils/outilString.js'\nimport { texNombre } from '../../../lib/outils/texNombre.js'\nimport Exercice from '../../Exercice.js'\nimport { listeQuestionsToContenu, randint } from '../../../modules/outils.js'\nimport Decimal from 'decimal.js'\nimport FractionEtendue from '../../../modules/FractionEtendue.js'\nimport { ajouteChampTexteMathLive } from '../../../lib/interactif/questionMathLive.js'\n\nimport { setReponse } from '../../../lib/interactif/gestionInteractif.js'\nimport { tableauColonneLigne } from '../../../lib/2d/tableau.js'\n\nexport const titre = 'Déterminer une probabilté dans un tableau de probabilités'\nexport const dateDePublication = '06/07/2022'\nexport const interactifReady = true\nexport const interactifType = 'mathLive'\nexport const amcReady = true\nexport const amcType = 'AMCNum'\n\n/**\n *\n * @author Gilles Mora\n\n */\nexport const uuid = '73673'\nexport const ref = 'can1P06'\nexport default function CalculProbaTableau () {\n Exercice.call(this) // Héritage de la classe Exercice()\n this.sup = true\n this.keyboard = ['lycee']\n this.consigne = ''\n this.nbQuestions = 1\n this.tailleDiaporama = 2 // Pour les exercices chronométrés. 50 par défaut pour les exercices avec du texte\n this.video = '' // Id YouTube ou url\n\n this.nouvelleVersion = function () {\n this.listeQuestions = [] // Liste de questions\n this.listeCorrections = [] // Liste de questions corrigées\n this.autoCorrection = []\n for (let i = 0, cpt = 0, reponse, tableau, pAbarreinterBbarre, pA, pB, pAinterB, texte, texteCorr; i < this.nbQuestions && cpt < 50;) {\n // On choisit les probas de l'arbre\n pA = (new Decimal(randint(27, 40))).div(100)\n pB = (new Decimal(randint(41, 70))).div(100)\n pAinterB = (new Decimal(randint(11, 25))).div(100)\n pAbarreinterBbarre = (new Decimal(1 - pA)).sub(pB).add(pAinterB)\n\n tableau = tableauColonneLigne(['', 'A', '\\\\overline{A}', '\\\\text{Total}'],\n ['B', '\\\\overline{B}', '\\\\text{Total}'],\n [`${texNombre(pAinterB, 2)}`, `${texNombre(pB - pAinterB, 2)}`, `${texNombre(pB, 2)}`, `${texNombre(pA - pAinterB, 2)}`, `${texNombre(pAbarreinterBbarre, 2)}`, `${texNombre(1 - pB, 2)}`, `${texNombre(pA, 2)}`, `${texNombre(1 - pA, 2)}`, '1'])\n texte = 'Ce tableau est un tableau de probabilités avec deux événements $A$ et $B$ d’une expérience aléatoire.<br>'\n this.canEnonce = texte\n switch (choice([1, 2, 3, 4, 5, 6, 7, 8, 9])) { //\n case 1:// p_A(B)\n texte += `${tableau}`\n if (this.interactif) {\n texte += '<br> $P_A(B)=$ '\n texte += ajouteChampTexteMathLive(this, i, 'inline largeur25 lycee', { texteApres: '(Résultat sous la forme d’une fraction d’entiers)' })\n } else {\n texte += 'Déterminer $P_A(B)$. '\n }\n texteCorr = ` $P_A(B)=\\\\dfrac{P(A\\\\cap B)}{P(A)}=\\\\dfrac{${texNombre(pAinterB, 2)}}{${texNombre(pA, 2)}}=\\\\dfrac{${texNombre(pAinterB * 100, 0)}}{${texNombre(pA * 100, 0)}}$\n `\n reponse = new FractionEtendue(pAinterB, pA)\n setReponse(this, i, reponse, { formatInteractif: 'fractionEgale' })\n this.canEnonce += `${tableau}<br>`\n this.canReponseACompleter = '$P_A(B)=\\\\ldots$'\n break\n case 2:// p(B)\n texte += `${tableau}`\n if (this.interactif) {\n texte += '<br>Calculer $P(B)$. '\n texte += ajouteChampTexteMathLive(this, i, 'inline largeur25 lycee', { texteApres: '(Résultat sous forme décimale)' })\n } else {\n texte += 'Déterminer $P_A(B)$. '\n }\n texteCorr = ` $P(B)=${texNombre(pB, 2)}$`\n reponse = pB\n setReponse(this, i, reponse)\n this.canEnonce += `${tableau}<br>`\n this.canReponseACompleter = '$P_A(B)=\\\\ldots$'\n break\n\n case 3:// p(Bbarre)\n texte += `${tableau} `\n if (this.interactif) {\n texte += '<br> $P(\\\\overline{B})=$ '\n texte += ajouteChampTexteMathLive(this, i, 'inline largeur25 lycee', { texteApres: '(Résultat sous forme décimale)' })\n } else {\n texte += 'Déterminer $P(\\\\overline{B})$. '\n }\n texteCorr = ` $P(\\\\overline{B})=${texNombre(1 - pB, 2)}$\n `\n reponse = (new Decimal(pB)).mul(-1).add(1)\n setReponse(this, i, reponse)\n this.canEnonce += `${tableau}<br>`\n this.canReponseACompleter = '$P(\\\\overline{B})=\\\\ldots$'\n break\n case 4:// p(AinterB)\n texte += `${tableau}`\n if (this.interactif) {\n texte += '<br> $P(A\\\\cap B)=$ '\n texte += ajouteChampTexteMathLive(this, i, 'inline largeur25 lycee', { texteApres: '(Résultat sous forme décimale)' })\n } else {\n texte += ' Déterminer $P(A\\\\cap B)$. '\n }\n texteCorr = ` $P(A\\\\cap B))=${texNombre(pAinterB, 2)}$ `\n reponse = pAinterB\n setReponse(this, i, reponse)\n this.canEnonce += `${tableau}<br>`\n this.canReponseACompleter = '$P(A\\\\cap B)=\\\\ldots$'\n break\n\n case 5:// p(AinterBbarre)\n texte += `${tableau} `\n if (this.interactif) {\n texte += '<br> $P(A\\\\cap \\\\overline{B})=$ '\n texte += ajouteChampTexteMathLive(this, i, 'inline largeur25 lycee', { texteApres: '(Résultat sous forme décimale)' })\n } else {\n texte += ' Déterminer $P(A\\\\cap \\\\overline{B})$. '\n }\n texteCorr = ` $P(A\\\\cap \\\\overline{B})=${texNombre(pA - pAinterB, 2)}$ `\n reponse = (new Decimal(pA)).sub(pAinterB)\n setReponse(this, i, reponse)\n this.canEnonce += `${tableau}<br>`\n this.canReponseACompleter = '$P(A\\\\cap \\\\overline{B})=\\\\ldots$'\n break\n\n case 6:// p(AbarreinterBbarre)\n texte += `${tableau} `\n if (this.interactif) {\n texte += '<br>$P(\\\\overline{A}\\\\cap B)=$. '\n texte += ajouteChampTexteMathLive(this, i, 'inline largeur25 lycee', { texteApres: '(Résultat sous forme décimale)' })\n } else {\n texte += `${sp(5)}Déterminer $P(\\\\overline{A}\\\\cap B)$. `\n }\n texteCorr = ` $P(\\\\overline{A}\\\\cap B)=${texNombre(pB - pAinterB, 2)}$ `\n reponse = (new Decimal(pB)).sub(pAinterB)\n setReponse(this, i, reponse)\n this.canEnonce += `${tableau}<br>`\n this.canReponseACompleter = '$P(\\\\overline{A}\\\\cap B)=\\\\ldots$'\n break\n\n case 7:// p_B(A)\n texte += `${tableau}`\n if (this.interactif) {\n texte += '<br>$P_B(A)=$ '\n texte += ajouteChampTexteMathLive(this, i, 'inline largeur25 lycee', { texteApres: '(Résultat sous la forme d’une fraction d’entiers)' })\n } else {\n texte += ' Déterminer $P_B(A)$. '\n }\n texteCorr = ` $P_B(A)=\\\\dfrac{P(A\\\\cap B)}{P(B)}=\\\\dfrac{${texNombre(pAinterB, 2)}}{${texNombre(pB, 2)}}=\\\\dfrac{${texNombre(pAinterB * 100, 0)}}{${texNombre(pB * 100, 0)}}$\n `\n reponse = new FractionEtendue(pAinterB, pB)\n setReponse(this, i, reponse, { formatInteractif: 'fractionEgale' })\n this.canEnonce += `${tableau}<br>`\n this.canReponseACompleter = '$P_B(A)=\\\\ldots$'\n break\n case 8:// p_B(Abarre)\n texte += `${tableau} `\n if (this.interactif) {\n texte += '<br> $P_B(\\\\overline{A})=$ '\n texte += ajouteChampTexteMathLive(this, i, 'inline largeur25 lycee', { texteApres: '(Résultat sous la forme d’une fraction d’entiers)' })\n } else {\n texte += 'Déterminer $P_B(\\\\overline{A})$. '\n }\n texteCorr = ` $P_B(\\\\overline{A})=\\\\dfrac{P(\\\\overline{A}\\\\cap B)}{P(B)}=\\\\dfrac{${texNombre(pB - pAinterB, 2)}}{${texNombre(pB, 2)}}=\\\\dfrac{${texNombre((pB - pAinterB) * 100, 0)}}{${texNombre(pB * 100, 0)}}$\n `\n reponse = new FractionEtendue(pB - pAinterB, pB)\n setReponse(this, i, reponse, { formatInteractif: 'fractionEgale' })\n this.canEnonce += `${tableau}<br>`\n this.canReponseACompleter = '$P_B(\\\\overline{A})=\\\\ldots$'\n break\n\n case 9:// p_Bbare(Abarre)\n texte += `${tableau}`\n if (this.interactif) {\n texte += '<br>$P_{\\\\overline{B}}(\\\\overline{A})=$ '\n texte += ajouteChampTexteMathLive(this, i, 'inline largeur25 lycee', { texteApres: '(Résultat sous la forme d’une fraction d’entiers)' })\n } else {\n texte += ' Déterminer $P_{\\\\overline{B}}(\\\\overline{A})$. '\n }\n texteCorr = ` $P_{\\\\overline{B}}(\\\\overline{A})=\\\\dfrac{P(\\\\overline{A}\\\\cap \\\\overline{B})}{P(\\\\overline{B})}=\\\\dfrac{${texNombre(pAbarreinterBbarre, 2)}}{${texNombre(1 - pB, 2)}}=\\\\dfrac{${texNombre(pAbarreinterBbarre * 100, 0)}}{${texNombre((1 - pB) * 100, 0)}}$ `\n reponse = new FractionEtendue(pAbarreinterBbarre, 1 - pB)\n setReponse(this, i, reponse, { formatInteractif: 'fractionEgale' })\n this.canEnonce += `${tableau}<br>`\n this.canReponseACompleter = '$P_{\\\\overline{B}}(\\\\overline{A})=\\\\ldots$'\n break\n }\n if (this.questionJamaisPosee(i, pA, pB)) {\n this.listeQuestions.push(texte)\n this.listeCorrections.push(texteCorr)\n this.listeCanEnonces.push(this.canEnonce)\n this.listeCanReponsesACompleter.push(this.canReponseACompleter)\n i++\n }\n cpt++\n }\n listeQuestionsToContenu(this)\n }\n}\n"],"names":["titre","dateDePublication","interactifReady","interactifType","amcReady","amcType","uuid","ref","CalculProbaTableau","Exercice","i","cpt","reponse","tableau","pAbarreinterBbarre","pA","pB","pAinterB","texte","texteCorr","Decimal","randint","tableauColonneLigne","texNombre","choice","ajouteChampTexteMathLive","FractionEtendue","setReponse","sp","listeQuestionsToContenu"],"mappings":"iJAYY,MAACA,EAAQ,4DACRC,EAAoB,aACpBC,EAAkB,GAClBC,EAAiB,WACjBC,EAAW,GACXC,EAAU,SAOVC,EAAO,QACPC,EAAM,UACJ,SAASC,GAAsB,CAC5CC,EAAS,KAAK,IAAI,EAClB,KA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