math-exercises 2.2.6 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/calcul/addAndSub.js +1 -1
- package/lib/exercises/math/calcul/addAndSubWithoutRelatives.js +1 -1
- package/lib/exercises/math/calcul/digitDecimalRank.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitDecimalRank.js +2 -3
- package/lib/exercises/math/calcul/digitDecimalRankNumber.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitDecimalRankNumber.js +2 -3
- package/lib/exercises/math/calcul/digitRank.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitRank.js +2 -3
- package/lib/exercises/math/calcul/digitRankNumber.d.ts.map +1 -1
- package/lib/exercises/math/calcul/digitRankNumber.js +2 -3
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +2 -0
- package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/index.js +2 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSub.js +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts +7 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalAddAndSubNoRelative.js +71 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.d.ts.map +1 -1
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplications.js +25 -17
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.d.ts +7 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.d.ts.map +1 -0
- package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationsNoRelative.js +93 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts +1 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -0
- package/lib/exercises/math/calcul/operations/expressionNature.js +81 -0
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationByFactorisation.js +1 -1
- package/lib/exercises/math/functions/trinoms/solveSecondDegreeEquationFromCano.js +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts +4 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +1 -1
- package/lib/exercises/math/percent/averageEvolutionRate.d.ts.map +1 -1
- package/lib/exercises/math/percent/averageEvolutionRate.js +16 -0
- package/lib/exercises/math/percent/cmToEvolution.d.ts +7 -0
- package/lib/exercises/math/percent/cmToEvolution.d.ts.map +1 -0
- package/lib/exercises/math/percent/cmToEvolution.js +70 -0
- package/lib/exercises/math/percent/evolutionToCM.d.ts +0 -1
- package/lib/exercises/math/percent/evolutionToCM.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutionToCM.js +20 -24
- package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
- package/lib/exercises/math/percent/findProportion.js +15 -0
- package/lib/exercises/math/percent/globalPercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/globalPercent.js +14 -0
- package/lib/exercises/math/percent/index.d.ts +1 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +1 -0
- package/lib/exercises/math/percent/isTableProportional.d.ts.map +1 -1
- package/lib/exercises/math/percent/isTableProportional.js +35 -33
- package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/percent/percentToDecimal.js +14 -0
- package/lib/exercises/math/percent/reciprocalPercentage.d.ts.map +1 -1
- package/lib/exercises/math/percent/reciprocalPercentage.js +18 -0
- package/lib/exercises/math/percent/valuePercent.d.ts.map +1 -1
- package/lib/exercises/math/percent/valuePercent.js +7 -0
- package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersProduct.js +22 -0
- package/lib/exercises/math/probaStat/expectedValueOfBinomialProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/expectedValueOfBinomialProba.js +14 -2
- package/lib/exercises/math/probaStat/varianceOfBinomialProba.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/varianceOfBinomialProba.js +21 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +15 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormula.js +17 -0
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricExplicitFormulaUsage.js +13 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +15 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +15 -0
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +26 -1
- package/lib/exercises/math/suites/sequenceEvaluation.js +1 -1
- package/lib/exercises/math/suites/sequencePlot.d.ts.map +1 -1
- package/lib/exercises/math/suites/sequencePlot.js +10 -3
- package/lib/index.d.ts +43 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/math/geometry/spaceVector.d.ts +1 -0
- package/lib/math/geometry/spaceVector.d.ts.map +1 -1
- package/lib/math/geometry/spaceVector.js +3 -0
- package/lib/math/polynomials/trinom.js +2 -2
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +2 -14
- package/lib/server.d.ts +1 -0
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +4 -1
- package/lib/utils/numberPrototype/toSeparatedThousands.d.ts +2 -0
- package/lib/utils/numberPrototype/toSeparatedThousands.d.ts.map +1 -0
- package/lib/utils/numberPrototype/toSeparatedThousands.js +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cmToEvolution = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
|
+
const round_1 = require("../../../math/utils/round");
|
|
8
|
+
const alignTex_1 = require("../../../utils/alignTex");
|
|
9
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
10
|
+
const getCmToEvolutionQuestion = () => {
|
|
11
|
+
const evolution = (0, randint_1.randint)(-99, 101, [0]);
|
|
12
|
+
const isHausse = evolution > 0;
|
|
13
|
+
const CM = ((0, round_1.round)(1 + evolution / 100, 2) + "").replaceAll(".", ",");
|
|
14
|
+
const answer = (isHausse ? "+" : "") + evolution + "\\%";
|
|
15
|
+
const question = {
|
|
16
|
+
answer: answer,
|
|
17
|
+
instruction: `Quelle est l'évolution en pourcentage associée à un coefficient multiplicateur de $${CM}$ ?`,
|
|
18
|
+
keys: ["percent"],
|
|
19
|
+
answerFormat: "tex",
|
|
20
|
+
identifiers: { evolution },
|
|
21
|
+
hint: "Pour trouver le taux d'évolution $t$ à partir du coefficient multiplicateur (CM) utilise la formule $t = \\left(\\text{CM}-1\\right)\\times 100$.",
|
|
22
|
+
correction: `Le taux d'évolution $t$ s'obtient par la formule
|
|
23
|
+
|
|
24
|
+
$$t = \\left(\\text{CM}-1\\right)\\times 100$$
|
|
25
|
+
|
|
26
|
+
Ici, on a donc :
|
|
27
|
+
|
|
28
|
+
${(0, alignTex_1.alignTex)([
|
|
29
|
+
["t", "=", `\\left(${CM}-1\\right)\\times 100`],
|
|
30
|
+
["", "=", evolution + ""],
|
|
31
|
+
])}
|
|
32
|
+
|
|
33
|
+
Le taux d'évolution est donc de $${answer}$.
|
|
34
|
+
`,
|
|
35
|
+
};
|
|
36
|
+
return question;
|
|
37
|
+
};
|
|
38
|
+
const getPropositions = (n, { answer, evolution }) => {
|
|
39
|
+
const propositions = [];
|
|
40
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
41
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, "+" + ((0, round_1.round)(1 + evolution / 100, 2) * 100 + "\\%").replaceAll(".", ","));
|
|
42
|
+
while (propositions.length < n) {
|
|
43
|
+
const wrongAnswer = ((0, coinFlip_1.coinFlip)() ? "+" : "-") + (0, randint_1.randint)(1, 100) + "\\%";
|
|
44
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer);
|
|
45
|
+
}
|
|
46
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
47
|
+
};
|
|
48
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
49
|
+
const allowedTex = [answer, answer.replace("\\%", "")];
|
|
50
|
+
if (answer[0] === "+") {
|
|
51
|
+
allowedTex.push(answer.slice(1));
|
|
52
|
+
allowedTex.push(answer.slice(1).replace("\\%", ""));
|
|
53
|
+
}
|
|
54
|
+
return allowedTex.includes(ans);
|
|
55
|
+
};
|
|
56
|
+
exports.cmToEvolution = {
|
|
57
|
+
id: "cmToEvolution",
|
|
58
|
+
connector: "=",
|
|
59
|
+
label: "Passer de coefficient multiplicateur à évolution en pourcentage",
|
|
60
|
+
levels: ["2ndPro", "2nde", "1rePro", "1reTech", "1reESM"],
|
|
61
|
+
isSingleStep: true,
|
|
62
|
+
sections: ["Pourcentages"],
|
|
63
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCmToEvolutionQuestion, nb),
|
|
64
|
+
qcmTimer: 60,
|
|
65
|
+
freeTimer: 60,
|
|
66
|
+
getPropositions,
|
|
67
|
+
isAnswerValid,
|
|
68
|
+
subject: "Mathématiques",
|
|
69
|
+
hasHintAndCorrection: true,
|
|
70
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evolutionToCM.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/evolutionToCM.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"evolutionToCM.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/evolutionToCM.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAsEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAc/C,CAAC"}
|
|
@@ -5,49 +5,44 @@ const exercise_1 = require("../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
7
|
const round_1 = require("../../../math/utils/round");
|
|
8
|
-
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
9
8
|
const getEvolutionToCmQuestion = () => {
|
|
10
|
-
const isFromEvolutionToCM = (0, coinFlip_1.coinFlip)();
|
|
11
9
|
const evolution = (0, randint_1.randint)(-99, 101, [0]);
|
|
12
10
|
const isHausse = evolution > 0;
|
|
13
11
|
const CM = ((0, round_1.round)(1 + evolution / 100, 2) + "").replaceAll(".", ",");
|
|
14
|
-
const answer =
|
|
15
|
-
? CM
|
|
16
|
-
: (isHausse ? "+" : "") + evolution + "\\%";
|
|
12
|
+
const answer = CM;
|
|
17
13
|
const question = {
|
|
18
14
|
answer: answer,
|
|
19
|
-
instruction:
|
|
20
|
-
? `Quel est le coefficient multiplicateur associé à une ${isHausse ? "hausse" : "baisse"} de $${isHausse ? evolution : evolution.toString().slice(1)}\\%$ ?`
|
|
21
|
-
: `Quelle est l'évolution en pourcentage associée à un coefficient multiplicateur de $${CM}$ ?`,
|
|
15
|
+
instruction: `Quel est le coefficient multiplicateur associé à une ${isHausse ? "hausse" : "baisse"} de $${isHausse ? evolution : evolution.toString().slice(1)}\\%$ ?`,
|
|
22
16
|
keys: ["percent"],
|
|
23
17
|
answerFormat: "tex",
|
|
24
|
-
identifiers: {
|
|
18
|
+
identifiers: { evolution },
|
|
19
|
+
hint: `Le coefficient multiplicateur associé à une ${isHausse ? "hausse" : "baisse"} de $t\\%$ est donné par $${isHausse ? "1+\\frac{t}{100}" : "1-\\frac{t}{100}"}$.
|
|
20
|
+
`,
|
|
21
|
+
correction: `Le coefficient multiplicateur associé à une ${isHausse ? "hausse" : "baisse"} de $t\\%$ est donné par $${isHausse ? "1+\\frac{t}{100}" : "1-\\frac{t}{100}"}$.
|
|
22
|
+
|
|
23
|
+
Ici, on a $t = ${Math.abs(evolution)}$\\%, donc le coefficient multiplicateur vaut :
|
|
24
|
+
|
|
25
|
+
$$
|
|
26
|
+
1${isHausse ? "+" : "-"}\\frac{${Math.abs(evolution)}}{100} = ${CM}
|
|
27
|
+
$$
|
|
28
|
+
|
|
29
|
+
`,
|
|
25
30
|
};
|
|
26
31
|
return question;
|
|
27
32
|
};
|
|
28
|
-
const getPropositions = (n, { answer,
|
|
33
|
+
const getPropositions = (n, { answer, evolution }) => {
|
|
29
34
|
const propositions = [];
|
|
30
35
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, evolution + "");
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, "+" + ((0, round_1.round)(1 + evolution / 100, 2) * 100 + "\\%").replaceAll(".", ","));
|
|
37
|
-
}
|
|
36
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, ((0, round_1.round)(evolution / 100, 2) + "").replaceAll(".", ","));
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, evolution + "");
|
|
38
38
|
while (propositions.length < n) {
|
|
39
|
-
const wrongAnswer =
|
|
40
|
-
? ((0, round_1.round)((0, randint_1.randint)(1, 200) / 100, 2) + "").replaceAll(".", ",")
|
|
41
|
-
: ((0, coinFlip_1.coinFlip)() ? "+" : "-") + (0, randint_1.randint)(1, 100) + "\\%";
|
|
39
|
+
const wrongAnswer = ((0, round_1.round)((0, randint_1.randint)(1, 200) / 100, 2) + "").replaceAll(".", ",");
|
|
42
40
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer);
|
|
43
41
|
}
|
|
44
42
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
45
43
|
};
|
|
46
44
|
const isAnswerValid = (ans, { answer }) => {
|
|
47
|
-
|
|
48
|
-
if (answer[0] === "+")
|
|
49
|
-
allowedTex.push(answer.slice(1));
|
|
50
|
-
return allowedTex.includes(ans);
|
|
45
|
+
return ans === answer;
|
|
51
46
|
};
|
|
52
47
|
exports.evolutionToCM = {
|
|
53
48
|
id: "evolutionToCM",
|
|
@@ -62,4 +57,5 @@ exports.evolutionToCM = {
|
|
|
62
57
|
getPropositions,
|
|
63
58
|
isAnswerValid,
|
|
64
59
|
subject: "Mathématiques",
|
|
60
|
+
hasHintAndCorrection: true,
|
|
65
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findProportion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findProportion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"findProportion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findProportion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAsDF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
|
|
@@ -16,6 +16,20 @@ const getFindProportionQuestion = () => {
|
|
|
16
16
|
keys: ["percent"],
|
|
17
17
|
answerFormat: "tex",
|
|
18
18
|
identifiers: { total, lefties },
|
|
19
|
+
hint: `La proportion de gauchers s'obtient par la formule :
|
|
20
|
+
|
|
21
|
+
$$
|
|
22
|
+
\\frac{\\text{nombre de gauchers}}{\\text{nombre d'élèves}}\\times 100
|
|
23
|
+
$$
|
|
24
|
+
|
|
25
|
+
`,
|
|
26
|
+
correction: `Le pourcentage de gauchers dans ce lycée est de :
|
|
27
|
+
|
|
28
|
+
$$
|
|
29
|
+
\\frac{${lefties}}{${total}}\\times 100 = ${answer}
|
|
30
|
+
$$
|
|
31
|
+
|
|
32
|
+
`,
|
|
19
33
|
};
|
|
20
34
|
return question;
|
|
21
35
|
};
|
|
@@ -45,4 +59,5 @@ exports.findProportion = {
|
|
|
45
59
|
getPropositions,
|
|
46
60
|
isAnswerValid,
|
|
47
61
|
subject: "Mathématiques",
|
|
62
|
+
hasHintAndCorrection: true,
|
|
48
63
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globalPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/globalPercent.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAMxB,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;
|
|
1
|
+
{"version":3,"file":"globalPercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/globalPercent.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAMxB,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAuFF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAe/C,CAAC"}
|
|
@@ -34,6 +34,19 @@ const getGlobalPercentQuestion = () => {
|
|
|
34
34
|
keys: ["percent"],
|
|
35
35
|
answerFormat: "tex",
|
|
36
36
|
identifiers: { evolutions },
|
|
37
|
+
hint: "Transforme chaque taux d'évolution en coefficient multiplicateur, puis multiplie ces coefficients multiplicateurs entre eux pour obtenir le coefficient multiplicateur global. Transforme alors ce CM global en taux d'évolution.",
|
|
38
|
+
correction: `On transforme les taux d'évolution en coefficients multiplicateurs puis on les multiplie entre eux :
|
|
39
|
+
|
|
40
|
+
$${evolutions
|
|
41
|
+
.map((e) => (0, round_1.round)(1 + Number(e) / 100, 2).frenchify())
|
|
42
|
+
.join(" \\times ")} = ${(0, round_1.round)(evolutions.reduce((acc, curr) => acc * (0, round_1.round)(1 + Number(curr) / 100, 2), 1), 4).frenchify()}$
|
|
43
|
+
|
|
44
|
+
Enfin, on transforme ce CM global en taux d'évolution :
|
|
45
|
+
|
|
46
|
+
$(${(0, round_1.round)(evolutions.reduce((acc, curr) => acc * (0, round_1.round)(1 + Number(curr) / 100, 2), 1), 4).frenchify()} - 1)\\times 100 = ${answer.replace("\\%", "")}$
|
|
47
|
+
|
|
48
|
+
Le taux d'évolution global est donc de $${answer}$.
|
|
49
|
+
`,
|
|
37
50
|
};
|
|
38
51
|
return question;
|
|
39
52
|
};
|
|
@@ -69,4 +82,5 @@ exports.globalPercent = {
|
|
|
69
82
|
getPropositions,
|
|
70
83
|
isAnswerValid,
|
|
71
84
|
subject: "Mathématiques",
|
|
85
|
+
hasHintAndCorrection: true,
|
|
72
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC"}
|
|
@@ -23,3 +23,4 @@ __exportStar(require("./percentToDecimal"), exports);
|
|
|
23
23
|
__exportStar(require("./valuePercent"), exports);
|
|
24
24
|
__exportStar(require("./findProportion"), exports);
|
|
25
25
|
__exportStar(require("./isTableProportional"), exports);
|
|
26
|
+
__exportStar(require("./cmToEvolution"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"isTableProportional.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/isTableProportional.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG,EAAE,CAAC;AA8DtB,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAerD,CAAC"}
|
|
@@ -3,17 +3,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isTableProportional = void 0;
|
|
4
4
|
const exercise_1 = require("../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randTupleInt_1 = require("../../../math/utils/random/randTupleInt");
|
|
6
7
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
8
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
9
|
const getIsTableProportionalQuestion = () => {
|
|
9
|
-
const
|
|
10
|
+
const xValues = (0, randTupleInt_1.randTupleInt)(3, {
|
|
11
|
+
from: 1,
|
|
12
|
+
to: 15,
|
|
13
|
+
allDifferent: true,
|
|
14
|
+
}).sort((a, b) => a - b);
|
|
15
|
+
const isProportionnal = (0, coinFlip_1.coinFlip)();
|
|
16
|
+
const coeff = (0, randint_1.randint)(2, 6);
|
|
17
|
+
const yValues = isProportionnal
|
|
18
|
+
? xValues.map((value) => value * coeff)
|
|
19
|
+
: xValues.map((value) => value * (0, randint_1.randint)(2, 5));
|
|
10
20
|
const question = {
|
|
11
|
-
answer:
|
|
12
|
-
instruction: `On considère le tableau ci-dessous. Est-ce un tableau de proportionnalité
|
|
21
|
+
answer: isProportionnal ? "Oui" : "Non",
|
|
22
|
+
instruction: `On considère le tableau ci-dessous. Est-ce un tableau de proportionnalité
|
|
23
|
+
|${xValues.map((value) => `$${value}$`).join("|")}|
|
|
24
|
+
|-|-|-|
|
|
25
|
+
|${yValues.map((value) => `$${value}$`).join("|")}|
|
|
26
|
+
`,
|
|
13
27
|
keys: [],
|
|
14
28
|
answerFormat: "raw",
|
|
15
29
|
style: { tableHasNoHeader: true },
|
|
16
|
-
identifiers: {
|
|
30
|
+
identifiers: {
|
|
31
|
+
xValues,
|
|
32
|
+
yValues,
|
|
33
|
+
},
|
|
34
|
+
hint: "Pour passer de la ligne du haut à la ligne du bas, multiplie-t-on toujours par le même nombre ? Si oui, alors c'est un tableau de proportionnalité.",
|
|
35
|
+
correction: `On divise les nombres de la deuxième ligne par les nombres de la première ligne. Si on obtient toujours le même résultat, alors c'est un tableau de proportionnalité.
|
|
36
|
+
|
|
37
|
+
- $${yValues[0]}\\div ${xValues[0]} = ${yValues[0] / xValues[0]}$
|
|
38
|
+
|
|
39
|
+
- $${yValues[1]}\\div ${xValues[1]} = ${yValues[1] / xValues[1]}$
|
|
40
|
+
|
|
41
|
+
- $${yValues[2]}\\div ${xValues[2]} = ${yValues[2] / xValues[2]}$
|
|
42
|
+
|
|
43
|
+
${isProportionnal
|
|
44
|
+
? "Puisque tous les résultats sont égaux, c'est bien un tableau de proportionnalité."
|
|
45
|
+
: "Puisque les résultats ne sont pas tous égaux, ce n'est pas un tableau de proportionnalité."}
|
|
46
|
+
`,
|
|
17
47
|
};
|
|
18
48
|
return question;
|
|
19
49
|
};
|
|
@@ -28,35 +58,6 @@ const getPropositions = (n, { answer }) => {
|
|
|
28
58
|
const isAnswerValid = (ans, { answer }) => {
|
|
29
59
|
return ans === answer;
|
|
30
60
|
};
|
|
31
|
-
const generateTable = () => {
|
|
32
|
-
const xValues = [(0, randint_1.randint)(1, 11)];
|
|
33
|
-
while (xValues.length < 3) {
|
|
34
|
-
let lastNb = xValues[xValues.length - 1];
|
|
35
|
-
let random = (0, randint_1.randint)(lastNb, lastNb + 11, [...xValues]);
|
|
36
|
-
xValues.push(random);
|
|
37
|
-
}
|
|
38
|
-
const yValues = generateYValues(xValues);
|
|
39
|
-
return {
|
|
40
|
-
table: `
|
|
41
|
-
|${xValues.map((value) => `$${value}$`).join("|")}|
|
|
42
|
-
|-|-|-|
|
|
43
|
-
|${yValues.values.map((value) => `$${value}$`).join("|")}|
|
|
44
|
-
`,
|
|
45
|
-
coeff: yValues.coeff,
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
const generateYValues = (xValues) => {
|
|
49
|
-
const flip = (0, coinFlip_1.coinFlip)();
|
|
50
|
-
const coeff = (0, randint_1.randint)(2, 6);
|
|
51
|
-
return flip
|
|
52
|
-
? {
|
|
53
|
-
values: xValues.map((value) => value * (0, randint_1.randint)(2, 5)),
|
|
54
|
-
}
|
|
55
|
-
: {
|
|
56
|
-
values: xValues.map((value) => value * coeff),
|
|
57
|
-
coeff,
|
|
58
|
-
};
|
|
59
|
-
};
|
|
60
61
|
exports.isTableProportional = {
|
|
61
62
|
id: "isVTableProportional",
|
|
62
63
|
label: "Reconnaître un tableau de proportionnalité",
|
|
@@ -70,4 +71,5 @@ exports.isTableProportional = {
|
|
|
70
71
|
isAnswerValid,
|
|
71
72
|
answerType: "QCU",
|
|
72
73
|
subject: "Mathématiques",
|
|
74
|
+
hasHintAndCorrection: true,
|
|
73
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percentToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"percentToDecimal.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/percentToDecimal.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAwFF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAelD,CAAC"}
|
|
@@ -21,6 +21,19 @@ const getPercentToDecimalQuestion = () => {
|
|
|
21
21
|
keys: ["percent"],
|
|
22
22
|
answerFormat: "tex",
|
|
23
23
|
identifiers: { isPercentToDecimal, nb: nb.value },
|
|
24
|
+
hint: `${isPercentToDecimal
|
|
25
|
+
? `Pour écrire $x\\%$ en décimal, rappelle toi que $x\\% = \\frac{x}{100}$.`
|
|
26
|
+
: `Pour écrire un nombre $x$ en pourcentage, on multiplie $x$ par $100$.`}`,
|
|
27
|
+
correction: `${isPercentToDecimal
|
|
28
|
+
? `Le symbole $\\%$ signifie simplement "divisé par $100$".
|
|
29
|
+
|
|
30
|
+
On a donc $${(nb.value * 100).frenchify()}\\% = \\frac{${(nb.value * 100).frenchify()}}{100} = ${answer}$
|
|
31
|
+
`
|
|
32
|
+
: `Pour écrire un nombre sous la forme d'un pourcentage, il suffit de le multiplier par $100$.
|
|
33
|
+
|
|
34
|
+
On a donc $${nb.value.frenchify()} = ${answer}$.
|
|
35
|
+
|
|
36
|
+
En effet, on a bien $${answer} = \\frac{${answer.replace("\\%", "")}}{100} = ${nb.value.frenchify()}$.`}`,
|
|
24
37
|
};
|
|
25
38
|
return question;
|
|
26
39
|
};
|
|
@@ -68,4 +81,5 @@ exports.percentToDecimal = {
|
|
|
68
81
|
getPropositions,
|
|
69
82
|
isAnswerValid,
|
|
70
83
|
subject: "Mathématiques",
|
|
84
|
+
hasHintAndCorrection: true,
|
|
71
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reciprocalPercentage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/reciprocalPercentage.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAKxB,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"reciprocalPercentage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/reciprocalPercentage.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAKxB,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAiFF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAetD,CAAC"}
|
|
@@ -18,12 +18,29 @@ const getReciprocalPercentageQuestion = () => {
|
|
|
18
18
|
const answer = `${(ans > 0
|
|
19
19
|
? "+" + (0, round_1.round)(ans, 2)
|
|
20
20
|
: "" + (0, round_1.round)(ans, 2)).replace(".", ",")}\\%`;
|
|
21
|
+
const cm = (0, round_1.round)(1 + (isUp ? randPercent / 100 : -randPercent / 100), 4);
|
|
22
|
+
const recipCm = (0, round_1.round)(1 / cm, 4);
|
|
21
23
|
const question = {
|
|
22
24
|
instruction,
|
|
23
25
|
answer,
|
|
24
26
|
keys: ["percent"],
|
|
25
27
|
answerFormat: "tex",
|
|
26
28
|
identifiers: { isUp, randPercent },
|
|
29
|
+
hint: `Calcule le coefficient multiplicateur associé à une ${isUp ? "hausse" : "baisse"} de $${randPercent}\\%$. Puis, calcule le coefficient multiplicateur réciproque : c'est l'inverse du coefficient multiplicateur. Il ne reste alors plus qu'à transformer le coefficient multiplicateur réciproque en taux d'évolution.`,
|
|
30
|
+
correction: `Le coefficient multiplicateur correspondant à une ${isUp ? "hausse" : "baisse"} de $${randPercent}\\%$ est :
|
|
31
|
+
|
|
32
|
+
$1${isUp ? "+" : "-"}\\frac{${randPercent}}{100} = ${cm.frenchify()}$
|
|
33
|
+
|
|
34
|
+
Le coefficient multiplicateur réciproque est l'inverse du coefficient multiplicateur :
|
|
35
|
+
|
|
36
|
+
$\\frac{1}{${cm.frenchify()}} = ${recipCm.frenchify()}$
|
|
37
|
+
|
|
38
|
+
On transforme ce coefficient multiplicateur en taux d'évolution :
|
|
39
|
+
|
|
40
|
+
$(${recipCm.frenchify()}-1)\\times 100 = ${(0, round_1.round)(ans, 2).frenchify()}$.
|
|
41
|
+
|
|
42
|
+
Ainsi, le taux d'évolution permettant de revenir au prix initial est de $${answer}$.
|
|
43
|
+
`,
|
|
27
44
|
};
|
|
28
45
|
return question;
|
|
29
46
|
};
|
|
@@ -59,4 +76,5 @@ exports.reciprocalPercentage = {
|
|
|
59
76
|
getPropositions,
|
|
60
77
|
isAnswerValid,
|
|
61
78
|
subject: "Mathématiques",
|
|
79
|
+
hasHintAndCorrection: true,
|
|
62
80
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"valuePercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/valuePercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"valuePercent.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/valuePercent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAyCF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
|
|
@@ -16,6 +16,12 @@ const getValuePercentQuestion = () => {
|
|
|
16
16
|
keys: [],
|
|
17
17
|
answerFormat: "tex",
|
|
18
18
|
identifiers: { percent, nb },
|
|
19
|
+
hint: `Pour calculer $x\\%$ d'un nombre, on le multiplie par $\\frac{x}{100}$.`,
|
|
20
|
+
correction: `Pour calculer $${percent}\\%$ de $${nb}$, on multiplie $${nb}$ par $\\frac{${percent}}{100}$ :
|
|
21
|
+
|
|
22
|
+
$
|
|
23
|
+
${nb}\\times \\frac{${percent}}{100} = ${ans}
|
|
24
|
+
$`,
|
|
19
25
|
};
|
|
20
26
|
return question;
|
|
21
27
|
};
|
|
@@ -43,4 +49,5 @@ exports.valuePercent = {
|
|
|
43
49
|
getPropositions,
|
|
44
50
|
isAnswerValid,
|
|
45
51
|
subject: "Mathématiques",
|
|
52
|
+
hasHintAndCorrection: true,
|
|
46
53
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powersProduct.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersProduct.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"powersProduct.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/powersProduct.ts"],"names":[],"mappings":"AAAA;;GAEG;AAUH,OAAO,EACL,QAAQ,EAQT,MAAM,gBAAgB,CAAC;AAIxB,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6EF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CA8BpD,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAkB/C,CAAC"}
|
|
@@ -7,8 +7,10 @@ exports.powersProduct = exports.powersOfTenProduct = void 0;
|
|
|
7
7
|
const power_1 = require("../../../math/numbers/integer/power");
|
|
8
8
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
9
9
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
10
|
+
const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
10
11
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
11
12
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
13
|
+
const alignTex_1 = require("../../../utils/alignTex");
|
|
12
14
|
const shuffle_1 = require("../../../utils/shuffle");
|
|
13
15
|
const exercise_1 = require("../../exercise");
|
|
14
16
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
@@ -26,6 +28,24 @@ const getPowersProductQuestion = (opts) => {
|
|
|
26
28
|
keys: [],
|
|
27
29
|
answerFormat: "tex",
|
|
28
30
|
identifiers: { a, b, c },
|
|
31
|
+
hint: `Utilise la propriété : ${opts?.useOnlyPowersOfTen
|
|
32
|
+
? `$10^n \\times 10^m = 10^{n+m}$`
|
|
33
|
+
: `$a^n \\times a^m = a^{n+m}$`}`,
|
|
34
|
+
correction: `On sait que ${opts?.useOnlyPowersOfTen
|
|
35
|
+
? `$10^n \\times 10^m = 10^{n+m}$`
|
|
36
|
+
: `$a^n \\times a^m = a^{n+m}$`}.
|
|
37
|
+
|
|
38
|
+
On a donc :
|
|
39
|
+
|
|
40
|
+
${(0, alignTex_1.alignTex)([
|
|
41
|
+
[
|
|
42
|
+
statmentTex,
|
|
43
|
+
"=",
|
|
44
|
+
new powerNode_1.PowerNode(a.toTree(), new addNode_1.AddNode(b.toTree(), c.toTree())).toTex(),
|
|
45
|
+
],
|
|
46
|
+
["", "=", answer],
|
|
47
|
+
])}
|
|
48
|
+
`,
|
|
29
49
|
};
|
|
30
50
|
return question;
|
|
31
51
|
};
|
|
@@ -74,6 +94,7 @@ exports.powersOfTenProduct = {
|
|
|
74
94
|
getPropositions,
|
|
75
95
|
isAnswerValid,
|
|
76
96
|
subject: "Mathématiques",
|
|
97
|
+
hasHintAndCorrection: true,
|
|
77
98
|
};
|
|
78
99
|
exports.powersProduct = {
|
|
79
100
|
id: "powersProduct",
|
|
@@ -88,4 +109,5 @@ exports.powersProduct = {
|
|
|
88
109
|
getPropositions,
|
|
89
110
|
isAnswerValid,
|
|
90
111
|
subject: "Mathématiques",
|
|
112
|
+
hasHintAndCorrection: true,
|
|
91
113
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expectedValueOfBinomialProba.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/expectedValueOfBinomialProba.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"expectedValueOfBinomialProba.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/expectedValueOfBinomialProba.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiFF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAc9D,CAAC"}
|
|
@@ -8,21 +8,32 @@ const randint_1 = require("../../../math/utils/random/randint");
|
|
|
8
8
|
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
9
9
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
10
10
|
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
11
|
+
const alignTex_1 = require("../../../utils/alignTex");
|
|
11
12
|
const getExpectedValueOfBinomialProbaQuestion = () => {
|
|
12
13
|
const nX = (0, randint_1.randint)(1, 9);
|
|
13
14
|
const b = (0, randint_1.randint)(2, 11);
|
|
14
15
|
const a = (0, randint_1.randint)(1, b);
|
|
15
16
|
const p = new rational_1.Rational(a, b);
|
|
16
17
|
const node = getCorrectAnswer(nX, p);
|
|
18
|
+
const answer = node.toTex();
|
|
17
19
|
const question = {
|
|
18
|
-
answer
|
|
19
|
-
instruction: `Soit $X$ une variable aléatoire qui suit une loi binomiale de
|
|
20
|
+
answer,
|
|
21
|
+
instruction: `Soit $X$ une variable aléatoire qui suit une loi binomiale de paramètres $n=${nX}$ et $p=${p
|
|
20
22
|
.toTree()
|
|
21
23
|
.simplify()
|
|
22
24
|
.toTex()}$. Calculez l'espérance de $X$.`,
|
|
23
25
|
keys: [],
|
|
24
26
|
answerFormat: "tex",
|
|
25
27
|
identifiers: { nX, a, b },
|
|
28
|
+
hint: `L'espérance d'une variable aléatoire $X$ qui suit une loi binomiale de paramètres $n$ et $p$ est donnée par $E(X) = np$.`,
|
|
29
|
+
correction: `L'espérance d'une variable aléatoire $X$ qui suit une loi binomiale de paramètres $n$ et $p$ est donnée par $E(X) = np$.
|
|
30
|
+
|
|
31
|
+
Ici, on a donc :
|
|
32
|
+
|
|
33
|
+
${(0, alignTex_1.alignTex)([
|
|
34
|
+
["E(X)", "=", new multiplyNode_1.MultiplyNode(nX.toTree(), p.toTree()).toTex()],
|
|
35
|
+
["", "=", answer],
|
|
36
|
+
])}`,
|
|
26
37
|
};
|
|
27
38
|
return question;
|
|
28
39
|
};
|
|
@@ -74,4 +85,5 @@ exports.expectedValueOfBinomialProba = {
|
|
|
74
85
|
getPropositions,
|
|
75
86
|
isAnswerValid,
|
|
76
87
|
subject: "Mathématiques",
|
|
88
|
+
hasHintAndCorrection: true,
|
|
77
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"varianceOfBinomialProba.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/varianceOfBinomialProba.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"varianceOfBinomialProba.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/varianceOfBinomialProba.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAalC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+FF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
|
|
@@ -9,6 +9,7 @@ const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
|
9
9
|
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
10
10
|
const powerNode_1 = require("../../../tree/nodes/operators/powerNode");
|
|
11
11
|
const substractNode_1 = require("../../../tree/nodes/operators/substractNode");
|
|
12
|
+
const alignTex_1 = require("../../../utils/alignTex");
|
|
12
13
|
const nbOneNode = new numberNode_1.NumberNode(1);
|
|
13
14
|
const getVarianceOfBinomialProbaQuestion = () => {
|
|
14
15
|
const nX = (0, randint_1.randint)(1, 9);
|
|
@@ -16,8 +17,9 @@ const getVarianceOfBinomialProbaQuestion = () => {
|
|
|
16
17
|
const a = (0, randint_1.randint)(1, b);
|
|
17
18
|
const p = new rational_1.Rational(a, b);
|
|
18
19
|
const correctAns = getCorrectAnswer(nX, p);
|
|
20
|
+
const answer = correctAns.toTex();
|
|
19
21
|
const question = {
|
|
20
|
-
answer
|
|
22
|
+
answer,
|
|
21
23
|
instruction: `Soit $X$ une variable aléatoire qui suit une loi binomiale de paramètres $n=${nX}$ et $p=${p
|
|
22
24
|
.toTree()
|
|
23
25
|
.simplify()
|
|
@@ -25,6 +27,23 @@ const getVarianceOfBinomialProbaQuestion = () => {
|
|
|
25
27
|
keys: [],
|
|
26
28
|
answerFormat: "tex",
|
|
27
29
|
identifiers: { nX, a, b },
|
|
30
|
+
hint: `L'espérance d'une variable aléatoire $X$ qui suit une loi binomiale de paramètres $n$ et $p$ est donnée par :
|
|
31
|
+
|
|
32
|
+
$V(X) = np(1-p)$.`,
|
|
33
|
+
correction: `L'espérance d'une variable aléatoire $X$ qui suit une loi binomiale de paramètres $n$ et $p$ est donnée par :
|
|
34
|
+
|
|
35
|
+
$V(X) = np(1-p)$.
|
|
36
|
+
|
|
37
|
+
Ici, on a donc :
|
|
38
|
+
|
|
39
|
+
${(0, alignTex_1.alignTex)([
|
|
40
|
+
[
|
|
41
|
+
"V(X)",
|
|
42
|
+
"=",
|
|
43
|
+
new multiplyNode_1.MultiplyNode(nX.toTree(), new multiplyNode_1.MultiplyNode(p.toTree(), new substractNode_1.SubstractNode((1).toTree(), p.toTree())), { forceTimesSign: true }).toTex(),
|
|
44
|
+
],
|
|
45
|
+
["", "=", answer],
|
|
46
|
+
])}`,
|
|
28
47
|
};
|
|
29
48
|
return question;
|
|
30
49
|
};
|
|
@@ -71,4 +90,5 @@ exports.varianceOfBinomialProba = {
|
|
|
71
90
|
getPropositions,
|
|
72
91
|
isAnswerValid,
|
|
73
92
|
subject: "Mathématiques",
|
|
93
|
+
hasHintAndCorrection: true,
|
|
74
94
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"arithmeticExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA+DF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAehE,CAAC"}
|
|
@@ -5,6 +5,9 @@ const exercise_1 = require("../../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const polynomial_1 = require("../../../../math/polynomials/polynomial");
|
|
7
7
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
8
|
+
const addNode_1 = require("../../../../tree/nodes/operators/addNode");
|
|
9
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
10
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
8
11
|
const shuffle_1 = require("../../../../utils/shuffle");
|
|
9
12
|
const getArithmeticExplicitFormulaUsage = () => {
|
|
10
13
|
const askedRank = (0, randint_1.randint)(0, 10);
|
|
@@ -21,6 +24,17 @@ const getArithmeticExplicitFormulaUsage = () => {
|
|
|
21
24
|
keys: ["u", "underscore", "equal"],
|
|
22
25
|
answerFormat: "tex",
|
|
23
26
|
identifiers: { firstValue, askedRank, reason },
|
|
27
|
+
hint: `Il suffit de remplacer $n$ par $${askedRank}$ dans la formule donnée.`,
|
|
28
|
+
correction: `On remplace $n$ par $${askedRank}$ dans la formule donnée :
|
|
29
|
+
|
|
30
|
+
${(0, alignTex_1.alignTex)([
|
|
31
|
+
[
|
|
32
|
+
`u_{${askedRank}}`,
|
|
33
|
+
"=",
|
|
34
|
+
new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(reason.toTree(), askedRank.toTree()), firstValue.toTree()).toTex(),
|
|
35
|
+
],
|
|
36
|
+
["", "=", answer],
|
|
37
|
+
])}`,
|
|
24
38
|
};
|
|
25
39
|
return question;
|
|
26
40
|
};
|
|
@@ -52,4 +66,5 @@ exports.arithmeticExplicitFormulaUsage = {
|
|
|
52
66
|
getPropositions,
|
|
53
67
|
isAnswerValid,
|
|
54
68
|
subject: "Mathématiques",
|
|
69
|
+
hasHintAndCorrection: true,
|
|
55
70
|
};
|