File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/beta3F23-FPThnb2L.js.map
{"version":3,"file":"beta3F23-FPThnb2L.js","sources":["../../src/exercices/beta/beta3F23.js"],"sourcesContent":["import { combinaisonListes } from '../../lib/outils/arrayOutils'\nimport { deprecatedTexFraction, texFractionReduite } from '../../lib/outils/deprecatedFractions.js'\nimport { ecritureAlgebrique } from '../../lib/outils/ecritures'\nimport { pgcd } from '../../lib/outils/primalite'\nimport Exercice from '../deprecatedExercice.js'\nimport { context } from '../../modules/context.js'\nimport { listeQuestionsToContenu, randint } from '../../modules/outils.js'\n\nexport const titre = 'Déterminer un antécédent'\n\n/**\n * Reconnaître une fonction affine\n* @author Erwan Duplessy\n* 3F23\n* date : 2021/02/21\n* référentiel 3F23 - Déterminer de manière algébrique l\\'antécédent par une fonction, dans des cas se ramenant à la résolution d\\'une équation du premier degré.\n* plusieurs cas :\n* f(x) = ax + b avec a et b petits relatifs\n* f(x) = ax + b avec a et b grands relatifs\n* f(x) = a(x + b) + c avec a, b, c petits relatifs\n* f(x) = a(bx + c) + dx + e avec a, b, c, d petits relatifs\n*/\n\nexport default function AntecedentParCalcul () {\n Exercice.call(this)\n this.titre = titre\n this.consigne = 'Répondre aux questions suivantes avec une valeur exacte simplifiée. '\n this.nbQuestions = 4 // Ici le nombre de questions\n this.nbQuestionsModifiable = true // Active le formulaire nombre de questions\n this.nbCols = 1 // Le nombre de colonnes dans l'énoncé LaTeX\n this.nbColsCorr = 1// Le nombre de colonne pour la correction LaTeX\n this.pasDeVersionLatex = false // mettre à true si on ne veut pas de l'exercice dans le générateur LaTeX\n this.pas_de_version_HMTL = false // mettre à true si on ne veut pas de l'exercice en ligne\n this.spacingCorr = context.isHtml ? 3 : 1\n // Voir la Classe Exercice pour une liste exhaustive des propriétés disponibles.\n\n // this.sup = 1; // A décommenter : valeur par défaut d'un premier paramètre\n // this.sup2 = false; // A décommenter : valeur par défaut d'un deuxième paramètre\n // this.sup3 = false; // A décommenter : valeur par défaut d'un troisième paramètre\n\n // c'est ici que commence le code de l'exercice cette fonction crée une copie de l'exercice\n this.nouvelleVersion = function () {\n this.listeQuestions = [] // tableau contenant la liste des questions\n this.listeCorrections = []\n const typesDeQuestionsDisponibles = [1, 2, 3, 4] // tableau à compléter par valeurs possibles des types de questions\n const listeTypeDeQuestions = combinaisonListes(typesDeQuestionsDisponibles, this.nbQuestions)\n\n for (let i = 0, texte, texteCorr, cpt = 0; i < this.nbQuestions && cpt < 50;) {\n texte = '' // Nous utilisons souvent cette variable pour construire le texte de la question.\n texteCorr = '' // Idem pour le texte de la correction.\n let a = 0; let b = 0; let c = 0; let d = 0; let e = 0; let m = 0\n let expr = ''\n\n switch (listeTypeDeQuestions[i]) { // Chaque question peut être d'un type différent\n case 1:\n // f(x) = ax + b avec a et b petits relatifs\n a = randint(-20, 20, [-1, 0, 1])\n b = randint(-20, 20)\n m = randint(-20, 20)\n expr = `$f(x)=${a}x ${ecritureAlgebrique(b)}$`\n texte += `Déterminer l'antécédent de $${m}$ par la fonction $f$ définie par ${expr}. `\n texteCorr += `On cherche un nombre $x$ tel que $f(x) = ${m}$. `\n texteCorr += `On résout donc l'équation : $f(x) = ${m}$. <br>`\n texteCorr += '$\\\\begin{aligned} '\n texteCorr += `${a}x ${ecritureAlgebrique(b)} &= ${m} \\\\\\\\ `\n texteCorr += `${a}x &= ${m} ${ecritureAlgebrique(-b)} \\\\\\\\ `\n if (pgcd(m - b, a) === 1 && m - b > 0 && a > 0) { // teste si la fraction est simplifiable\n texteCorr += `x &= ${deprecatedTexFraction(m - b, a)} \\\\\\\\`\n } else {\n texteCorr += `x &= ${deprecatedTexFraction(m - b, a)} = ${texFractionReduite(m - b, a)}\\\\\\\\ `\n }\n texteCorr += '\\\\end{aligned}$'\n break\n\n case 2:\n // f(x) = ax + b avec a et b grands relatifs\n a = randint(-999, 999, [-1, 0, 1])\n b = randint(-999, 999, [0])\n m = randint(-999, 999, [0])\n expr = `$f(x)=${a}x ${ecritureAlgebrique(b)}$`\n texte += `Déterminer l'antécédent de $${m}$ par la fonction $f$ définie par ${expr}. `\n texteCorr += `On cherche un nombre $x$ tel que $f(x) = ${m}$. `\n texteCorr += `On résout donc l'équation : $f(x) = ${m}$. <br>`\n texteCorr += '$\\\\begin{aligned} '\n texteCorr += ` ${a}x ${ecritureAlgebrique(b)}&= ${m} \\\\\\\\ `\n texteCorr += ` ${a}x &= ${m} ${ecritureAlgebrique(-b)}\\\\\\\\ `\n if (pgcd(m - b, a) === 1 && m - b > 0 && a > 0) { // teste si la fraction est simplifiable\n texteCorr += `x &= ${deprecatedTexFraction(m - b, a)}\\\\\\\\`\n } else {\n texteCorr += `x &= ${deprecatedTexFraction(m - b, a)} = ${texFractionReduite(m - b, a)}\\\\\\\\`\n }\n texteCorr += '\\\\end{aligned}$'\n break\n\n case 3:\n // f(x) = a(x + b) + c avec a, b, c petits relatifs\n a = randint(-20, 20, [-1, 0, 1])\n b = randint(-20, 20, [0])\n c = randint(-20, 20, [0])\n m = randint(-20, 20)\n expr = `$f(x)=${a}(x ${ecritureAlgebrique(b)})${ecritureAlgebrique(c)}$`\n texte += `Déterminer l'antécédent de $${m}$ par la fonction $f$ définie par ${expr}. `\n texteCorr += `On cherche un nombre $x$ tel que $f(x) = ${m}$. `\n texteCorr += `On résout donc l'équation : $f(x) = ${m}$. <br>`\n\n texteCorr += '$\\\\begin{aligned} '\n texteCorr += `${a}(x ${ecritureAlgebrique(b)})${ecritureAlgebrique(c)} &= ${m}\\\\\\\\`\n texteCorr += `${a}x ${ecritureAlgebrique(a * b)}${ecritureAlgebrique(c)} &= ${m}\\\\\\\\`\n texteCorr += `${a}x ${ecritureAlgebrique(a * b + c)} &= ${m}\\\\\\\\`\n texteCorr += `${a}x &= ${m} ${ecritureAlgebrique(-a * b - c)}\\\\\\\\`\n if (pgcd(m - a * b - c, a) === 1 && m - a * b - c > 0 && a > 0) { // teste si la fraction est simplifiable\n texteCorr += `x &= ${deprecatedTexFraction(m - a * b - c, a)}\\\\\\\\`\n } else {\n texteCorr += `x &= ${deprecatedTexFraction(m - a * b - c, a)} = ${texFractionReduite(m - a * b - c, a)}\\\\\\\\`\n }\n texteCorr += '\\\\end{aligned}$'\n break\n\n case 4:\n // f(x) = a(bx + c) + dx + e avec a, b, c, d petits relatifs\n a = randint(-20, 20, [-1, 0, 1])\n b = randint(-20, 20, [-1, 0, 1])\n c = randint(-20, 20, [0])\n d = randint(-20, 20, [-1, 0, 1, -a * b]) // d différent de -ab pour assurer une solution\n e = randint(-20, 20, [0])\n m = randint(-20, 20)\n expr = `$f(x)=${a}(${b}x ${ecritureAlgebrique(c)})${ecritureAlgebrique(d)}x${ecritureAlgebrique(e)}$`\n texte += `Déterminer l'antécédent de $${m}$ par la fonction $f$ définie par ${expr}. `\n texteCorr += `On cherche un nombre $x$ tel que $f(x) = ${m}$. `\n texteCorr += `On résout donc l'équation : $f(x) = ${m}$. <br>`\n\n texteCorr += '$\\\\begin{aligned} '\n texteCorr += `${a}(${b}x ${ecritureAlgebrique(c)})${ecritureAlgebrique(d)}x${ecritureAlgebrique(e)} &= ${m}\\\\\\\\`\n texteCorr += `${a * b}x ${ecritureAlgebrique(a * c)}${ecritureAlgebrique(d)}x${ecritureAlgebrique(e)} &= ${m}\\\\\\\\`\n texteCorr += `${a * b + d}x ${ecritureAlgebrique(a * c + e)} &= ${m}\\\\\\\\`\n texteCorr += `${a * b + d}x &= ${m}${ecritureAlgebrique(-a * c - e)}\\\\\\\\`\n texteCorr += `${a * b + d}x &= ${m - a * c - e}\\\\\\\\`\n if (pgcd(m - a * c - e, a * b + d) === 1 && m - a * c - e > 0 && a * b + d > 0) { // teste si la fraction est simplifiable\n texteCorr += `x &= ${deprecatedTexFraction(m - a * c - e, a * b + d)}\\\\\\\\`\n } else {\n texteCorr += `x &= ${deprecatedTexFraction(m - a * c - e, a * b + d)} = ${texFractionReduite(m - a * c - e, a * b + d)}\\\\\\\\`\n }\n texteCorr += '\\\\end{aligned}$'\n\n break\n }\n if (this.questionJamaisPosee(i, a, b, c, d, m, e)) {\n // Si la question n'a jamais été posée, on la stocke dans la liste des questions\n this.listeQuestions.push(texte)\n this.listeCorrections.push(texteCorr)\n i++\n }\n cpt++\n }\n listeQuestionsToContenu(this) // On envoie l'exercice à la fonction de mise en page\n }\n}\n"],"names":["titre","AntecedentParCalcul","Exercice","context","listeTypeDeQuestions","combinaisonListes","i","texte","texteCorr","cpt","a","b","c","d","e","m","expr","randint","ecritureAlgebrique","pgcd","deprecatedTexFraction","texFractionReduite","listeQuestionsToContenu"],"mappings":"iJAQY,MAACA,EAAQ,2BAeN,SAASC,GAAuB,CAC7CC,EAAS,KAAK,IAAI,EAClB,KAAK,MAAQF,EACb,KAAK,SAAW,uEAChB,KAAK,YAAc,EACnB,KAAK,sBAAwB,GAC7B,KAAK,OAAS,EACd,KAAK,WAAa,EAClB,KAAK,kBAAoB,GACzB,KAAK,oBAAsB,GAC3B,KAAK,YAAcG,EAAQ,OAAS,EAAI,EAQxC,KAAK,gBAAkB,UAAY,CACjC,KAAK,eAAiB,CAAE,EACxB,KAAK,iBAAmB,CAAE,EAE1B,MAAMC,EAAuBC,EADO,CAAC,EAAG,EAAG,EAAG,CAAC,EAC6B,KAAK,WAAW,EAE5F,QAASC,EAAI,EAAGC,EAAOC,EAAWC,EAAM,EAAGH,EAAI,KAAK,aAAeG,EAAM,IAAK,CAC5EF,EAAQ,GACRC,EAAY,GACZ,IAAIE,EAAI,EAAOC,EAAI,EAAOC,EAAI,EAAOC,EAAI,EAAOC,EAAI,EAAOC,EAAI,EAC3DC,EAAO,GAEX,OAAQZ,EAAqBE,CAAC,EAAC,CAC7B,IAAK,GAEHI,EAAIO,EAAQ,IAAK,GAAI,CAAC,GAAI,EAAG,CAAC,CAAC,EAC/BN,EAAIM,EAAQ,IAAK,EAAE,EACnBF,EAAIE,EAAQ,IAAK,EAAE,EACnBD,EAAO,SAASN,CAAC,KAAKQ,EAAmBP,CAAC,CAAC,IAC3CJ,GAAS,+BAA+BQ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