File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/4L12-25IT0cM7.js.map
{"version":3,"file":"4L12-25IT0cM7.js","sources":["../../src/exercices/4e/4L12.js"],"sourcesContent":["import { miseEnEvidence, texteEnCouleurEtGras } from '../../lib/outils/embellissements'\nimport { texteGras } from '../../lib/format/style'\nimport Exercice from '../Exercice.js'\nimport { randint, listeQuestionsToContenu } from '../../modules/outils.js'\nexport const titre = 'Demonstrate the equivalence of two calculation programs'\n\n// Les exports suivants sont optionnels mais au moins la date de publication semble essentielle\nexport const dateDePublication = '21/02/2022' // La date de publication initiale au format 'jj/mm/aaaa' pour affichage temporaire d'un tag\nexport const dateDeModifImportante = '' // Une date de modification importante au format 'jj/mm/aaaa' pour affichage temporaire d'un tag\n\n/**\n * Aléatoirisation de l'exercice de la vidéo d'Yvan Monka https://www.youtube.com/watch?v=-iw4OkMhgCA\n * Affichage de deux programmes de calcul de 2 ou 3 opérations équivalents\n * Première question : Demande d'évaluer les deux programmes de calcul pour une valeur entre -9 et 9 et demande d'émettre une conjecture\n * Deuxième question : Demande de démontrer cette conjecture\n * @author Guillaume Valmont\n * Référence 4L12\n*/\nexport const uuid = '501f9'\nexport const ref = '4L12'\nexport default function EquivalenceProgrammesCalcul () {\n Exercice.call(this)\n this.nbQuestions = 1\n\n this.nbCols = 2\n this.nbColsCorr = 2\n this.video = 'https://www.youtube.com/watch?v=-iw4OkMhgCA'\n\n this.testeProgrammesDeCalcul = function (nombreATester, A1, A2, B1, B2, B3, signeA2, signeB1, signeB3) {\n return `${texteGras('Program A:')}<br>$${nombreATester} \\\\times ${A1} = ${nombreATester * A1}$ <br>$${nombreATester * A1} ${signeA2} ${A2} = ${miseEnEvidence(nombreATester * A1 + A2)}$ <br><br>${texteGras('Program B:')}<br>$${nombreATester} ${signeB1} ${B1} = ${nombreATester + B1}$ <br>$${nombreATester + B1} \\\\times ${B2} = ${(nombreATester + B1) * B2}$ <br>$${(nombreATester + B1) * B2} ${signeB3} ${B3} = ${miseEnEvidence((nombreATester + B1) * B2 + B3)}$ <br><br>`\n }\n\n this.nouvelleVersion = function () {\n this.listeQuestions = []\n this.listeCorrections = []\n this.autoCorrection = []\n\n for (let i = 0, texte, texteCorr, texteOperationA1, texteOperationA2, texteOperationB1, texteOperationB3, signeA2, signeB1, signeB3, signeB1B2, signeB1B2B3, cpt = 0; i < this.nbQuestions && cpt < 50;) {\n const B1 = randint(-9, 9, [0])\n const B2 = randint(2, 6)\n const B3 = randint(-9, 9, [0])\n const A1 = B2\n const A2 = B1 * B2 + B3\n const nombreATester = randint(-9, 9)\n const nombreChoisi = randint(-9, 9, [nombreATester])\n if (A1 === 2) {\n texteOperationA1 = 'double'\n } else if (A1 === 3) {\n texteOperationA1 = 'triple'\n } else {\n texteOperationA1 = `multiply by $${A1}$`\n }\n if (A2 < 0) {\n texteOperationA2 = `remove $${-A2}$`\n signeA2 = ''\n } else {\n texteOperationA2 = `add $${A2}$`\n signeA2 = '+'\n }\n if (B1 < 0) {\n texteOperationB1 = `subtract $${-B1}$`\n signeB1 = ''\n } else {\n texteOperationB1 = `add $${B1}$`\n signeB1 = '+'\n }\n if (B3 < 0) {\n texteOperationB3 = `subtract $${-B3}$`\n signeB3 = ''\n } else {\n texteOperationB3 = `add $${B3}$`\n signeB3 = '+'\n }\n if (B1 * B2 < 0) {\n signeB1B2 = ''\n } else {\n signeB1B2 = '+'\n }\n if (B1 * B2 + B3 < 0) {\n signeB1B2B3 = ''\n } else {\n signeB1B2B3 = '+'\n }\n texte = `We consider the following calculation programs:<br><br>${texteGras('Program A:')}<br>- choose a number,<br>- the ${texteOperationA1},<br>- then ${texteOperationA2}.<br><br>${texteGras('Program B:')}<br>- choose a number,<br>- him ${texteOperationB1},<br>- multiply the result by ${B2},<br>- ${texteOperationB3}.<br><br>${texteEnCouleurEtGras('1)')} Test these programs with the number $${nombreATester}$ and choosing any other number. Make a conjecture.<br>${texteEnCouleurEtGras('2)')} Prove this conjecture.`\n texteCorr = `${texteEnCouleurEtGras('1)')} ${this.testeProgrammesDeCalcul(nombreATester, A1, A2, B1, B2, B3, signeA2, signeB1, signeB3)}Let's test these two calculation programs with the number $${nombreChoisi}$ for example:<br>${this.testeProgrammesDeCalcul(nombreChoisi, A1, A2, B1, B2, B3, signeA2, signeB1, signeB3)}Each time, program A gave the same result as program B.<br>We conjecture that program A will give the same result as program B for all numbers.<br><br>${texteEnCouleurEtGras('2)')} Let's apply these two calculation programs to a number (any) which we will denote $${miseEnEvidence('\\\\textit{x}')}$:<br>${texteGras('Program A:')}<br>$ ${miseEnEvidence('\\\\textit{x}')} \\\\times ${A1} = ${A1} ${miseEnEvidence('\\\\textit{x}')}$<br>$${A1} ${miseEnEvidence('\\\\textit{x}')} ${signeA2} ${A2} = ${miseEnEvidence(A1 + ' \\\\textit{x} ' + signeA2 + ' ' + A2)}$<br><br>${texteGras('Program B:')}<br>$ ${miseEnEvidence('\\\\textit{x}')} ${signeB1} ${B1} = ${miseEnEvidence('\\\\textit{x}')} ${signeB1} ${B1}$<br>$(${miseEnEvidence('\\\\textit{x}')} ${signeB1} ${B1}) \\\\times ${B2} = ${miseEnEvidence('\\\\textit{x}')} \\\\times ${B2} ${signeB1} ${B1} \\\\times ${B2} = ${B2} ${miseEnEvidence('\\\\textit{x}')} ${signeB1B2} ${B1 * B2}$<br>$${B2} ${miseEnEvidence('\\\\textit{x}')} ${signeB1B2} ${B1 * B2} ${signeB3} ${B3} = ${miseEnEvidence(B2 + ' \\\\textit{x} ' + signeB1B2B3 + ' ' + (B1 * B2 + B3))}$<br><br>We obtained the same result with the two calculation programs.<br>As we can replace $${miseEnEvidence('\\\\textit{x}')}$ by any number, we have shown that we obtain the same result with the two calculation programs for any number.`\n\n // If the question has never been asked, we save it\n if (this.questionJamaisPosee(i, A1, A2, B1, B3)) { // <- laisser le i et ajouter toutes les variables qui rendent les exercices différents (par exemple a, b, c et d)\n // Delete b, c and d in the line above and replace them with NumberAAdd!\n this.listeQuestions.push(texte)\n this.listeCorrections.push(texteCorr)\n i++\n }\n cpt++\n }\n listeQuestionsToContenu(this)\n }\n}\n"],"names":["titre","dateDePublication","dateDeModifImportante","uuid","ref","EquivalenceProgrammesCalcul","Exercice","nombreATester","A1","A2","B1","B2","B3","signeA2","signeB1","signeB3","texteGras","miseEnEvidence","i","texte","texteCorr","texteOperationA1","texteOperationA2","texteOperationB1","texteOperationB3","signeB1B2","signeB1B2B3","cpt","randint","nombreChoisi","texteEnCouleurEtGras","listeQuestionsToContenu"],"mappings":"wGAIY,MAACA,EAAQ,0DAGRC,EAAoB,aACpBC,EAAwB,GAUxBC,EAAO,QACPC,EAAM,OACJ,SAASC,GAA+B,CACrDC,EAAS,KAAK,IAAI,EAClB,KAAK,YAAc,EAEnB,KAAK,OAAS,EACd,KAAK,WAAa,EAClB,KAAK,MAAQ,8CAEb,KAAK,wBAA0B,SAAUC,EAAeC,EAAIC,EAAIC,EAAIC,EAAIC,EAAIC,EAASC,EAASC,EAAS,CACrG,MAAO,GAAGC,EAAU,YAAY,CAAC,QAAQT,CAAa,YAAYC,CAAE,MAAMD,EAAgBC,CAAE,UAAUD,EAAgBC,CAAE,IAAIK,CAAO,IAAIJ,CAAE,MAAMQ,EAAeV,EAAgBC,EAAKC,CAAE,CAAC,aAAaO,EAAU,YAAY,CAAC,QAAQT,CAAa,IAAIO,CAAO,IAAIJ,CAAE,MAAMH,EAAgBG,CAAE,UAAUH,EAAgBG,CAAE,YAAYC,CAAE,OAAOJ,EAAgBG,GAAMC,CAAE,WAAWJ,EAAgBG,GAAMC,CAAE,IAAII,CAAO,IAAIH,CAAE,MAAMK,GAAgBV,EAAgBG,GAAMC,EAAKC,CAAE,CAAC,YAC1c,EAED,KAAK,gBAAkB,UAAY,CACjC,KAAK,eAAiB,CAAE,EACxB,KAAK,iBAAmB,CAAE,EAC1B,KAAK,eAAiB,CAAE,EAExB,QAASM,EAAI,EAAGC,EAAOC,EAAWC,EAAkBC,EAAkBC,EAAkBC,EAAkBX,EAASC,EAASC,EAASU,EAA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