math-exercises 3.0.188 → 3.0.189
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/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +44 -37
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +16 -61
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +27 -35
- package/lib/exercises/math/functions/affines/adjustment/affineAdjustment.d.ts +8 -0
- package/lib/exercises/math/functions/affines/adjustment/affineAdjustment.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/adjustment/affineAdjustment.js +129 -0
- package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentComplete.d.ts +8 -0
- package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentComplete.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentComplete.js +108 -0
- package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.d.ts +8 -0
- package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.js +92 -0
- package/lib/exercises/math/functions/affines/adjustment/index.d.ts +4 -0
- package/lib/exercises/math/functions/affines/adjustment/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/adjustment/index.js +3 -0
- package/lib/exercises/math/functions/affines/index.d.ts +2 -4
- package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/index.js +2 -4
- package/lib/exercises/math/functions/affines/situations/affineFromExercise.d.ts +10 -0
- package/lib/exercises/math/functions/affines/situations/affineFromExercise.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/situations/affineFromExercise.js +219 -0
- package/lib/exercises/math/functions/affines/situations/affineModelisationSituations.d.ts +10 -0
- package/lib/exercises/math/functions/affines/situations/affineModelisationSituations.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/situations/affineModelisationSituations.js +69 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationComputeAntecedent.d.ts +10 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationComputeAntecedent.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationComputeAntecedent.js +133 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationComputeImage.d.ts +10 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationComputeImage.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationComputeImage.js +229 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationThreshold.d.ts +10 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationThreshold.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationThreshold.js +166 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationVariation.d.ts +9 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationVariation.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/situations/affineSituationVariation.js +78 -0
- package/lib/exercises/math/functions/affines/situations/index.d.ts +6 -0
- package/lib/exercises/math/functions/affines/situations/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/situations/index.js +5 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts +1 -7
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/index.js +1 -7
- package/lib/exercises/math/probaStat/randomVariable/situations/index.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/index.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/index.js +7 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationAverage.d.ts +11 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationAverage.js +112 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationComputeProbability.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationComputeProbability.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationComputeProbability.js +176 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationIsGameFavorable.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationIsGameFavorable.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationIsGameFavorable.js +94 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationProbabilityLaw.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationProbabilityLaw.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationProbabilityLaw.js +166 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationStandardDeviation.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationStandardDeviation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationStandardDeviation.js +133 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationValues.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationValues.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationValues.js +211 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationVariance.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationVariance.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituationVariance.js +113 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituations.d.ts +41 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituations.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/situations/randomVariableSituations.js +173 -0
- package/lib/exercises/math/python/list/pyListMutationMix.d.ts.map +1 -1
- package/lib/exercises/math/python/list/pyListMutationMix.js +11 -6
- package/lib/index.d.ts +44 -24
- package/lib/index.d.ts.map +1 -1
- package/lib/tree/utilities/nodeUtils.d.ts +2 -0
- package/lib/tree/utilities/nodeUtils.d.ts.map +1 -1
- package/lib/tree/utilities/nodeUtils.js +40 -0
- package/package.json +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randfloat } from "../../../../../math/utils/random/randfloat.js";
|
|
4
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
5
|
+
import { round } from "../../../../../math/utils/round.js";
|
|
6
|
+
import { generateAffineCloud } from "../../../../../math/utils/stats/generateAffineCloud.js";
|
|
7
|
+
import { leastSquares } from "../../../../../math/utils/stats/leastSquares.js";
|
|
8
|
+
import { rSquared } from "../../../../../math/utils/stats/rSquared.js";
|
|
9
|
+
import { EqualNode } from "../../../../../tree/nodes/equations/equalNode.js";
|
|
10
|
+
import { NumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
|
|
11
|
+
import { AddNode } from "../../../../../tree/nodes/operators/addNode.js";
|
|
12
|
+
import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
13
|
+
import { PowerNode } from "../../../../../tree/nodes/operators/powerNode.js";
|
|
14
|
+
import { SubstractNode } from "../../../../../tree/nodes/operators/substractNode.js";
|
|
15
|
+
import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.js";
|
|
16
|
+
import { dollarize } from "../../../../../utils/latex/dollarize.js";
|
|
17
|
+
import { mdTable } from "../../../../../utils/markdown/mdTable.js";
|
|
18
|
+
const getAnswer = (identifiers) => {
|
|
19
|
+
const { xValues, yValues } = identifiers;
|
|
20
|
+
const { a, b } = leastSquares(xValues, yValues);
|
|
21
|
+
const aFixed = round(a, 1);
|
|
22
|
+
const bFixed = round(b, 1);
|
|
23
|
+
const answerEq = new EqualNode(new VariableNode("y"), new AddNode(new MultiplyNode(new NumberNode(aFixed), new VariableNode("x")), new NumberNode(bFixed)).simplify({ forbidFactorize: true })).toTex();
|
|
24
|
+
const r2 = round(rSquared(xValues, yValues), 2);
|
|
25
|
+
const answerR = new EqualNode(new PowerNode(new VariableNode("R"), new NumberNode(2)), r2.toTree()).toTex();
|
|
26
|
+
return `${answerEq}\\newline ${answerR}`;
|
|
27
|
+
};
|
|
28
|
+
const getInstruction = (identifiers) => {
|
|
29
|
+
const { xValues, yValues } = identifiers;
|
|
30
|
+
const dataTable = mdTable([
|
|
31
|
+
["$x$", ...xValues.map((n) => dollarize(n.frenchify()))],
|
|
32
|
+
["$y$", ...yValues.map((n) => dollarize(n.frenchify()))],
|
|
33
|
+
]);
|
|
34
|
+
return `On considère la série statistique ci-dessous. A l'aide de la calculatrice, déterminer l'équation de la droite d'ajustement et la valeur du coefficient de détermination. ${dataTable}
|
|
35
|
+
`;
|
|
36
|
+
};
|
|
37
|
+
const getAffineAdjustmentCompleteQuestion = () => {
|
|
38
|
+
const data = generateAffineCloud(6);
|
|
39
|
+
data.sort((a, b) => a.x - b.x);
|
|
40
|
+
const xValues = data.map((point) => point.x);
|
|
41
|
+
const yValues = data.map((point) => point.y);
|
|
42
|
+
const identifiers = {
|
|
43
|
+
xValues,
|
|
44
|
+
yValues,
|
|
45
|
+
};
|
|
46
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
47
|
+
};
|
|
48
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
49
|
+
const question = {
|
|
50
|
+
answer: getAnswer(identifiers),
|
|
51
|
+
instruction: getInstruction(identifiers),
|
|
52
|
+
keys: [],
|
|
53
|
+
answerFormat: "tex",
|
|
54
|
+
identifiers,
|
|
55
|
+
style: {
|
|
56
|
+
tableOptions: {
|
|
57
|
+
firstCellIsDivided: false,
|
|
58
|
+
firstColumnIsHeader: true,
|
|
59
|
+
firstRowIsHeader: false,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
return question;
|
|
64
|
+
};
|
|
65
|
+
const getPropositions = (n, { answer, xValues, yValues }) => {
|
|
66
|
+
const propositions = [];
|
|
67
|
+
addValidProp(propositions, answer, "tex");
|
|
68
|
+
const { a, b } = leastSquares(xValues, yValues);
|
|
69
|
+
const r2 = round(rSquared(xValues, yValues), 2);
|
|
70
|
+
const aFixed = round(a, 1);
|
|
71
|
+
const bFixed = round(b, 1);
|
|
72
|
+
const answerEq = new EqualNode(new VariableNode("y"), new AddNode(new MultiplyNode(new NumberNode(aFixed), new VariableNode("x")), new NumberNode(bFixed)).simplify({ forbidFactorize: true })).toTex();
|
|
73
|
+
const answerR = new EqualNode(new PowerNode(new VariableNode("R"), new NumberNode(2)), r2.toTree()).toTex();
|
|
74
|
+
const wrongAnswerEq1 = new EqualNode(new VariableNode("y"), new SubstractNode(new MultiplyNode(new NumberNode(aFixed), new VariableNode("x")), new NumberNode(bFixed)).simplify({ forbidFactorize: true })).toTex();
|
|
75
|
+
const awrong = randfloat(1, 10, 1);
|
|
76
|
+
const wrongAnswerEq2 = new EqualNode(new VariableNode("y"), new AddNode(new MultiplyNode(new NumberNode(round(awrong, 1)), new VariableNode("x")), new NumberNode(bFixed)).simplify({ forbidFactorize: true })).toTex();
|
|
77
|
+
const wrongAnswerR1 = new EqualNode(new VariableNode("R"), r2.toTree()).toTex();
|
|
78
|
+
const wrongAnswerR2 = new EqualNode(new PowerNode(new VariableNode("R"), new NumberNode(2)), (r2 + 0.01).toTree()).toTex();
|
|
79
|
+
const wrongAnswer1 = `${answerEq}\\newline ${wrongAnswerR1}`;
|
|
80
|
+
const wrongAnswer2 = `${answerEq}\\newline ${wrongAnswerR2}`;
|
|
81
|
+
const wrongAnswer3 = `${wrongAnswerEq1}\\newline ${answerR}`;
|
|
82
|
+
const wrongAnswer4 = `${wrongAnswerEq2}\\newline ${answerR}`;
|
|
83
|
+
tryToAddWrongProp(propositions, wrongAnswer1);
|
|
84
|
+
tryToAddWrongProp(propositions, wrongAnswer2);
|
|
85
|
+
tryToAddWrongProp(propositions, wrongAnswer3);
|
|
86
|
+
tryToAddWrongProp(propositions, wrongAnswer4);
|
|
87
|
+
propWhile(propositions, n, () => {
|
|
88
|
+
const a = randint(-10, 10, [0]);
|
|
89
|
+
const b = randint(-10, 10);
|
|
90
|
+
const wrongAnswerEq = new EqualNode(new VariableNode("y"), new AddNode(new MultiplyNode(new NumberNode(a), new VariableNode("x")), new NumberNode(b)).simplify({ forbidFactorize: true })).toTex();
|
|
91
|
+
const wrongAnswerR = new EqualNode(new PowerNode(new VariableNode("R"), new NumberNode(2)), round(Math.random(), 2).toTree()).toTex();
|
|
92
|
+
const wrongAnswer = `${wrongAnswerEq}\\newline ${wrongAnswerR}`;
|
|
93
|
+
tryToAddWrongProp(propositions, wrongAnswer);
|
|
94
|
+
});
|
|
95
|
+
return shuffleProps(propositions, n);
|
|
96
|
+
};
|
|
97
|
+
export const affineAdjustmentCompleteExercise = {
|
|
98
|
+
id: "affineAdjustmentComplete",
|
|
99
|
+
label: "Déterminer l'équation de la droite d'ajustement et le coefficient de détermination",
|
|
100
|
+
isSingleStep: true,
|
|
101
|
+
generator: (nb) => getDistinctQuestions(getAffineAdjustmentCompleteQuestion, nb),
|
|
102
|
+
qcmTimer: 60,
|
|
103
|
+
freeTimer: 60,
|
|
104
|
+
getPropositions,
|
|
105
|
+
subject: "Mathématiques",
|
|
106
|
+
getQuestionFromIdentifiers,
|
|
107
|
+
answerType: "QCU",
|
|
108
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
xValues: number[];
|
|
4
|
+
yValues: number[];
|
|
5
|
+
};
|
|
6
|
+
export declare const affineAdjustmentRsquaredExercise: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=affineAdjustmentRsquared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affineAdjustmentRsquared.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAqHF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAalE,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { round } from "../../../../../math/utils/round.js";
|
|
4
|
+
import { generateAffineCloud } from "../../../../../math/utils/stats/generateAffineCloud.js";
|
|
5
|
+
import { rSquared } from "../../../../../math/utils/stats/rSquared.js";
|
|
6
|
+
import { EqualNode } from "../../../../../tree/nodes/equations/equalNode.js";
|
|
7
|
+
import { NumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
|
|
8
|
+
import { PowerNode } from "../../../../../tree/nodes/operators/powerNode.js";
|
|
9
|
+
import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.js";
|
|
10
|
+
import { dollarize } from "../../../../../utils/latex/dollarize.js";
|
|
11
|
+
import { mdTable } from "../../../../../utils/markdown/mdTable.js";
|
|
12
|
+
const getInstruction = (identifiers) => {
|
|
13
|
+
const { xValues, yValues } = identifiers;
|
|
14
|
+
const dataTable = mdTable([
|
|
15
|
+
["$x$", ...xValues.map((n) => dollarize(n.frenchify()))],
|
|
16
|
+
["$y$", ...yValues.map((n) => dollarize(n.frenchify()))],
|
|
17
|
+
]);
|
|
18
|
+
return `On considère la série statistique ci-dessous :
|
|
19
|
+
|
|
20
|
+
${dataTable}
|
|
21
|
+
|
|
22
|
+
Déterminer la valeur du coefficient de détermination pour un ajustement affine de cette série.
|
|
23
|
+
`;
|
|
24
|
+
};
|
|
25
|
+
const getAnswer = (identifiers) => {
|
|
26
|
+
const { xValues, yValues } = identifiers;
|
|
27
|
+
const r2 = round(rSquared(xValues, yValues), 2);
|
|
28
|
+
const answer = new EqualNode(new PowerNode(new VariableNode("R"), new NumberNode(2)), r2.toTree()).toTex();
|
|
29
|
+
return answer;
|
|
30
|
+
};
|
|
31
|
+
const getAffineAdjustmentRsquaredQuestion = () => {
|
|
32
|
+
const data = generateAffineCloud(6);
|
|
33
|
+
data.sort((a, b) => a.x - b.x);
|
|
34
|
+
const xValues = data.map((point) => round(point.x, 1));
|
|
35
|
+
const yValues = data.map((point) => round(point.y, 1));
|
|
36
|
+
const identifiers = { xValues, yValues };
|
|
37
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
38
|
+
};
|
|
39
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
40
|
+
const question = {
|
|
41
|
+
answer: getAnswer(identifiers),
|
|
42
|
+
instruction: getInstruction(identifiers),
|
|
43
|
+
keys: ["R", "equal"],
|
|
44
|
+
answerFormat: "tex",
|
|
45
|
+
identifiers,
|
|
46
|
+
style: {
|
|
47
|
+
tableOptions: {
|
|
48
|
+
firstCellIsDivided: false,
|
|
49
|
+
firstColumnIsHeader: true,
|
|
50
|
+
firstRowIsHeader: false,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
return question;
|
|
55
|
+
};
|
|
56
|
+
const getPropositions = (n, { answer, xValues, yValues }) => {
|
|
57
|
+
const propositions = [];
|
|
58
|
+
const r2 = round(rSquared(xValues, yValues), 2);
|
|
59
|
+
addValidProp(propositions, answer, "tex");
|
|
60
|
+
const wrongAnswer1 = new EqualNode(new VariableNode("R"), r2.toTree()).toTex();
|
|
61
|
+
const wrongAnswer2 = new EqualNode(new PowerNode(new VariableNode("R"), new NumberNode(2)), (r2 + 0.01).toTree()).toTex();
|
|
62
|
+
const wrongAnswer3 = new EqualNode(new VariableNode("R"), (r2 - 0.01).toTree()).toTex();
|
|
63
|
+
tryToAddWrongProp(propositions, wrongAnswer1);
|
|
64
|
+
tryToAddWrongProp(propositions, wrongAnswer2);
|
|
65
|
+
tryToAddWrongProp(propositions, wrongAnswer3);
|
|
66
|
+
propWhile(propositions, n, () => {
|
|
67
|
+
const wrongAnswer = new EqualNode(new PowerNode(new VariableNode("R"), new NumberNode(1)), round(Math.random(), 2).toTree()).toTex();
|
|
68
|
+
tryToAddWrongProp(propositions, wrongAnswer);
|
|
69
|
+
});
|
|
70
|
+
return shuffleProps(propositions, n);
|
|
71
|
+
};
|
|
72
|
+
const isAnswerValid = (ans, { xValues, yValues }) => {
|
|
73
|
+
const r2 = round(rSquared(xValues, yValues), 2);
|
|
74
|
+
const validanswer = new EqualNode(new PowerNode(new VariableNode("R"), new NumberNode(2)), r2.toTree());
|
|
75
|
+
const latexs = validanswer.toAllValidTexs({
|
|
76
|
+
allowRawRightChildAsSolution: true,
|
|
77
|
+
allowFractionToDecimal: true,
|
|
78
|
+
});
|
|
79
|
+
return latexs.includes(ans);
|
|
80
|
+
};
|
|
81
|
+
export const affineAdjustmentRsquaredExercise = {
|
|
82
|
+
id: "affineAdjustmentRsquared",
|
|
83
|
+
label: "Déterminer le coefficient de détermination à partir d'un tableau de données",
|
|
84
|
+
isSingleStep: true,
|
|
85
|
+
generator: (nb) => getDistinctQuestions(getAffineAdjustmentRsquaredQuestion, nb),
|
|
86
|
+
qcmTimer: 60,
|
|
87
|
+
freeTimer: 60,
|
|
88
|
+
getPropositions,
|
|
89
|
+
isAnswerValid,
|
|
90
|
+
subject: "Mathématiques",
|
|
91
|
+
getQuestionFromIdentifiers,
|
|
92
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/affines/adjustment/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC"}
|
|
@@ -6,12 +6,8 @@ export * from "./affineExpressionReading.js";
|
|
|
6
6
|
export * from "./interceptReading.js";
|
|
7
7
|
export * from "./algebricExpressionOfAffine.js";
|
|
8
8
|
export * from "./leadingCoeffAndOriginOrdinate.js";
|
|
9
|
-
export * from "./affineAdjustment.js";
|
|
10
|
-
export * from "./affineAdjustmentRsquared.js";
|
|
11
|
-
export * from "./affineAdjustmentComplete.js";
|
|
12
9
|
export * from "./affineMeanValue.js";
|
|
13
10
|
export * from "./affineExpressionFromTwoImages.js";
|
|
14
|
-
export * from "./affineFromExercise.js";
|
|
15
11
|
export * from "./drawAffineFromLitExp.js";
|
|
16
12
|
export * from "./recognizeExprAffine.js";
|
|
17
13
|
export * from "./drawAffineFrom2Points.js";
|
|
@@ -24,4 +20,6 @@ export * from "./drawAffineFromPointAndLeadingCoeff.js";
|
|
|
24
20
|
export * from "./drawAffineFromProgCalc.js";
|
|
25
21
|
export * from "./placePointsFromAffine.js";
|
|
26
22
|
export * from "./recognizeAffinePointsFromPoints.js";
|
|
23
|
+
export * from "./adjustment/index.js";
|
|
24
|
+
export * from "./situations/index.js";
|
|
27
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,oCAAoC,CAAC;AAEnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yCAAyC,CAAC;AACxD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
|
@@ -6,12 +6,8 @@ export * from "./affineExpressionReading.js";
|
|
|
6
6
|
export * from "./interceptReading.js";
|
|
7
7
|
export * from "./algebricExpressionOfAffine.js";
|
|
8
8
|
export * from "./leadingCoeffAndOriginOrdinate.js";
|
|
9
|
-
export * from "./affineAdjustment.js";
|
|
10
|
-
export * from "./affineAdjustmentRsquared.js";
|
|
11
|
-
export * from "./affineAdjustmentComplete.js";
|
|
12
9
|
export * from "./affineMeanValue.js";
|
|
13
10
|
export * from "./affineExpressionFromTwoImages.js";
|
|
14
|
-
export * from "./affineFromExercise.js";
|
|
15
11
|
export * from "./drawAffineFromLitExp.js";
|
|
16
12
|
export * from "./recognizeExprAffine.js";
|
|
17
13
|
export * from "./drawAffineFrom2Points.js";
|
|
@@ -24,3 +20,5 @@ export * from "./drawAffineFromPointAndLeadingCoeff.js";
|
|
|
24
20
|
export * from "./drawAffineFromProgCalc.js";
|
|
25
21
|
export * from "./placePointsFromAffine.js";
|
|
26
22
|
export * from "./recognizeAffinePointsFromPoints.js";
|
|
23
|
+
export * from "./adjustment/index.js";
|
|
24
|
+
export * from "./situations/index.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
id: string;
|
|
4
|
+
situationIndex: number;
|
|
5
|
+
initial: number;
|
|
6
|
+
growth: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const affineFromExercise: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=affineFromExercise.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affineFromExercise.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/affines/situations/affineFromExercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA6PF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAiBpD,CAAC"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
4
|
+
import { add } from "../../../../../tree/nodes/operators/addNode.js";
|
|
5
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
6
|
+
import { VariableNode } from "../../../../../tree/nodes/variables/variableNode.js";
|
|
7
|
+
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
8
|
+
import { affineModelisationSituations } from "./affineModelisationSituations.js";
|
|
9
|
+
const situationsData = [
|
|
10
|
+
{
|
|
11
|
+
question: `Quelle est sa hauteur (en $\\textrm{cm}$) après $x$ jours ?`,
|
|
12
|
+
hint: `Quel calcul permet de trouver la hauteur de la plante au bout de $10$ jours ?
|
|
13
|
+
|
|
14
|
+
Inspire toi de ce calcul pour déterminer la hauteur de la plante au bout de $x$ jours.`,
|
|
15
|
+
correction: (initial, growth, answer) => `Chaque jour, la plante gagne $${growth.frenchify()}\\ \\textrm{cm}$. Au bout de $x$ jours, la plante a donc gagné $x\\times ${growth.frenchify()}\\ \\textrm{cm}$.
|
|
16
|
+
|
|
17
|
+
La hauteur initiale de la plante est de $${initial}\\ \\textrm{cm}$.
|
|
18
|
+
|
|
19
|
+
Au bout de $x$ jours, la plante a donc une hauteur de :
|
|
20
|
+
|
|
21
|
+
$$
|
|
22
|
+
${answer}\\ \\textrm{cm}
|
|
23
|
+
$$`,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
question: `Quel est le prix payé (en $€$) pour $x \\ \\textrm{km}$ parcourus ?`,
|
|
27
|
+
hint: `Quel calcul permet de trouver le prix payé pour $10$ kilomètres parcourus ?
|
|
28
|
+
|
|
29
|
+
Inspire toi de ce calcul pour déterminer le prix payé pour $x$ kilomètres parcourus.
|
|
30
|
+
`,
|
|
31
|
+
correction: (initial, growth, answer) => `Pour chaque kilomètre parcouru, le prix augmente de $${growth.frenchify()}\\ €$. Au bout de $x$ kilomètres, le prix augmente donc de $x\\times ${growth.frenchify()}\\ \\ €$.
|
|
32
|
+
|
|
33
|
+
Le montant fixe initial du trajet est de $${initial}\\ €$.
|
|
34
|
+
|
|
35
|
+
Pour $x$ kilomètres parcourus, le prix du trajet est donc de :
|
|
36
|
+
|
|
37
|
+
$$
|
|
38
|
+
${answer}\\ €
|
|
39
|
+
$$`,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
question: `Quelle sera la facture (en $€$) pour $x \\ \\textrm{kWh}$ consommés ?`,
|
|
43
|
+
hint: `Quel calcul permet de trouver la facture pour $10$ kWh consommés ?
|
|
44
|
+
|
|
45
|
+
Inspire toi de ce calcul pour déterminer la facture pour $x$ kWh consommés.
|
|
46
|
+
`,
|
|
47
|
+
correction: (initial, growth, answer) => `Pour chaque kWh consommé, le prix augmente de $${growth.frenchify()}\\ €$.
|
|
48
|
+
Au bout de $x$ kWh, le prix augmente donc de $x\\times ${growth.frenchify()}\\ \\ €$.
|
|
49
|
+
|
|
50
|
+
Le montant de l'abonnement fixe est de $${initial}\\ €$.
|
|
51
|
+
|
|
52
|
+
Pour $x$ kWh consommés, la facture sera donc de :
|
|
53
|
+
|
|
54
|
+
$$
|
|
55
|
+
${answer}\\ €
|
|
56
|
+
$$`,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
question: `Quelle sera la température (en °C) pour $x$ centaines de km parcourus vers le Sud ?`,
|
|
60
|
+
hint: `Quel calcul permet de trouver la température pour $2$ centaines de km parcourus ?
|
|
61
|
+
|
|
62
|
+
Inspire toi de ce calcul pour déterminer la température pour $x$ centaines de km parcourus.
|
|
63
|
+
`,
|
|
64
|
+
correction: (initial, growth, answer) => `Pour chaque centaine de km parcourue, la température augmente de $${growth.frenchify()}$ °C.
|
|
65
|
+
Au bout de $x$ centaines de km, la température augmente donc de $x\\times ${growth.frenchify()}$ °C.
|
|
66
|
+
|
|
67
|
+
Au départ, la température est de $${initial}$ °C.
|
|
68
|
+
|
|
69
|
+
Pour $x$ centaines de km parcourus, la température sera donc de :
|
|
70
|
+
|
|
71
|
+
$$
|
|
72
|
+
${answer}\\ \\textrm{°C}
|
|
73
|
+
$$`,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
question: `Quel sera son salaire net (en €) quand elle aura $x$ années d'ancienneté ?`,
|
|
77
|
+
hint: `Quel calcul permet de trouver son salaire net pour $10$ années d'ancienneté ?
|
|
78
|
+
|
|
79
|
+
Inspire toi de ce calcul pour déterminer son salaire net pour $x$ années d'ancienneté.
|
|
80
|
+
`,
|
|
81
|
+
correction: (initial, growth, answer) => `Chaque année, son salaire net augmente de $${growth.frenchify()}\\ €$.
|
|
82
|
+
Au bout de $x$ années, son salaire net aura augmenté de $x\\times ${growth.frenchify()}\\ €$.
|
|
83
|
+
|
|
84
|
+
Au départ, son salaire net était de $${initial}\\ €$.
|
|
85
|
+
|
|
86
|
+
Pour $x$ années d'ancienneté, son salaire net sera donc de :
|
|
87
|
+
|
|
88
|
+
$$
|
|
89
|
+
${answer}\\ \\textrm{€}
|
|
90
|
+
$$`,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
question: `Quel sera son score s'il commet $x$ erreurs ?`,
|
|
94
|
+
hint: `Quel calcul permet de trouver son score net pour $10$ erreurs ?
|
|
95
|
+
|
|
96
|
+
Inspire toi de ce calcul pour déterminer son score pour $x$ erreurs.
|
|
97
|
+
`,
|
|
98
|
+
correction: (initial, growth, answer) => `Pour chaque erreur, son score baisse de $${Math.abs(growth).frenchify()}$ points.
|
|
99
|
+
Au bout de $x$ erreurs, son score aura baissé de $x\\times ${Math.abs(growth).frenchify()}$ points.
|
|
100
|
+
|
|
101
|
+
Au départ, son score était de $${initial}$ points.
|
|
102
|
+
|
|
103
|
+
Pour $x$ erreurs, son score sera donc de :
|
|
104
|
+
|
|
105
|
+
$$
|
|
106
|
+
${answer}
|
|
107
|
+
$$`,
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
question: `De combien disposera l'entreprise au bout de $x$ jours ?`,
|
|
111
|
+
hint: `Quel calcul permet de trouver ce dont dispose l'entreprise après $10$ jours ?
|
|
112
|
+
|
|
113
|
+
Inspire toi de ce calcul pour déterminer ce dont elle dispose après $x$ jours.
|
|
114
|
+
`,
|
|
115
|
+
correction: (initial, growth, answer) => `Chaque jour, l'entreprise perd $${Math.abs(growth).frenchify()} \\ €$ de chiffres d'affaires.
|
|
116
|
+
Au bout de $x$ jours, son chiffre d'affaires aura donc réduit de $x\\times ${Math.abs(growth).frenchify()}\\ €$.
|
|
117
|
+
|
|
118
|
+
Au départ, l'entreprise faisait un chiffre d'affaires de $${initial}\\ €$.
|
|
119
|
+
|
|
120
|
+
Après $x$ jours, l'entreprise aura donc un chiffre d'affaries de :
|
|
121
|
+
|
|
122
|
+
$$
|
|
123
|
+
${answer}\\ €
|
|
124
|
+
$$`,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
question: `Quelle sera la température (en $\\textrm{°C}$) au bout de $x$ jours ?`,
|
|
128
|
+
hint: `Quel calcul permet de trouver la température après $2$ jours ?
|
|
129
|
+
|
|
130
|
+
Inspire toi de ce calcul pour déterminer la température après $x$ jours.
|
|
131
|
+
`,
|
|
132
|
+
correction: (initial, growth, answer) => `Chaque jour, la température baisse de $${Math.abs(growth).frenchify()}\\textrm{°C}$.
|
|
133
|
+
Au bout de $x$ jours, la température baissera donc de $x\\times ${Math.abs(growth).frenchify()}\\textrm{°C}$.
|
|
134
|
+
|
|
135
|
+
Au départ, la température est de $${initial}\\textrm{°C}$.
|
|
136
|
+
|
|
137
|
+
Après $x$ jours, la température sera donc de :
|
|
138
|
+
|
|
139
|
+
$$
|
|
140
|
+
${answer}\\ \\textrm{°C}
|
|
141
|
+
$$`,
|
|
142
|
+
},
|
|
143
|
+
];
|
|
144
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
145
|
+
const propositions = [];
|
|
146
|
+
const { initial, growth } = identifiers;
|
|
147
|
+
addValidProp(propositions, answer);
|
|
148
|
+
tryToAddWrongProp(propositions, add(multiply(initial, new VariableNode("x")), growth).toTex());
|
|
149
|
+
tryToAddWrongProp(propositions, add(multiply(growth, new VariableNode("n")), initial).toTex());
|
|
150
|
+
tryToAddWrongProp(propositions, add(multiply(initial, growth), new VariableNode("x")).toTex());
|
|
151
|
+
tryToAddWrongProp(propositions, multiply(add(initial, growth).simplify(), new VariableNode("x")).toTex());
|
|
152
|
+
return shuffleProps(propositions, n);
|
|
153
|
+
};
|
|
154
|
+
const getAnswer = (identifiers) => {
|
|
155
|
+
return add(multiply(identifiers.growth, new VariableNode("x")), identifiers.initial).toTex();
|
|
156
|
+
};
|
|
157
|
+
const getInstruction = (identifiers) => {
|
|
158
|
+
const { situationIndex, initial, growth } = identifiers;
|
|
159
|
+
const situation = affineModelisationSituations[situationIndex];
|
|
160
|
+
const situationData = situationsData[situationIndex];
|
|
161
|
+
return situation.context(initial, growth) + "\n \n" + situationData.question;
|
|
162
|
+
};
|
|
163
|
+
const getHint = (identifiers) => {
|
|
164
|
+
const { situationIndex } = identifiers;
|
|
165
|
+
const situation = situationsData[situationIndex];
|
|
166
|
+
return situation.hint;
|
|
167
|
+
};
|
|
168
|
+
const getCorrection = (identifiers) => {
|
|
169
|
+
const { situationIndex, initial, growth } = identifiers;
|
|
170
|
+
const situation = situationsData[situationIndex];
|
|
171
|
+
const answer = getAnswer(identifiers);
|
|
172
|
+
return situation.correction(initial, growth, answer);
|
|
173
|
+
};
|
|
174
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
175
|
+
return parseAlgebraic(ans)
|
|
176
|
+
.simplify()
|
|
177
|
+
.equals(parseAlgebraic(answer).simplify());
|
|
178
|
+
};
|
|
179
|
+
const getAffineFromExerciseQuestion = () => {
|
|
180
|
+
const situationIndex = randint(0, affineModelisationSituations.length);
|
|
181
|
+
const situation = affineModelisationSituations[situationIndex];
|
|
182
|
+
const initial = situation.randInitial();
|
|
183
|
+
const growth = situation.randGrowth();
|
|
184
|
+
const identifiers = {
|
|
185
|
+
id: situation.id,
|
|
186
|
+
situationIndex,
|
|
187
|
+
initial,
|
|
188
|
+
growth,
|
|
189
|
+
};
|
|
190
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
191
|
+
};
|
|
192
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
193
|
+
return {
|
|
194
|
+
answer: getAnswer(identifiers),
|
|
195
|
+
instruction: getInstruction(identifiers),
|
|
196
|
+
keys: ["x"],
|
|
197
|
+
answerFormat: "tex",
|
|
198
|
+
identifiers,
|
|
199
|
+
hint: getHint(identifiers),
|
|
200
|
+
correction: getCorrection(identifiers),
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
export const affineFromExercise = {
|
|
204
|
+
id: "affineFromExercise",
|
|
205
|
+
label: "Écrire la fonction affine correspondant à une situation donnée",
|
|
206
|
+
isSingleStep: true,
|
|
207
|
+
generator: (nb, opts) => getDistinctQuestions(() => getAffineFromExerciseQuestion(opts), nb),
|
|
208
|
+
qcmTimer: 60,
|
|
209
|
+
freeTimer: 60,
|
|
210
|
+
getPropositions,
|
|
211
|
+
isAnswerValid,
|
|
212
|
+
subject: "Mathématiques",
|
|
213
|
+
getInstruction,
|
|
214
|
+
getHint,
|
|
215
|
+
getCorrection,
|
|
216
|
+
getAnswer,
|
|
217
|
+
getQuestionFromIdentifiers,
|
|
218
|
+
hasHintAndCorrection: true,
|
|
219
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type Situation = {
|
|
2
|
+
id: string;
|
|
3
|
+
context: (initial: number, growth: number) => string;
|
|
4
|
+
randInitial: () => number;
|
|
5
|
+
randGrowth: () => number;
|
|
6
|
+
functionNotation: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const affineModelisationSituations: Situation[];
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=affineModelisationSituations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affineModelisationSituations.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/affines/situations/affineModelisationSituations.ts"],"names":[],"mappings":"AAGA,KAAK,SAAS,GAAG;IACf,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IACrD,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,UAAU,EAAE,MAAM,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,SAAS,EAiFnD,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { randfloat } from "../../../../../math/utils/random/randfloat.js";
|
|
2
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
3
|
+
export const affineModelisationSituations = [
|
|
4
|
+
{
|
|
5
|
+
id: "plant",
|
|
6
|
+
context: (initial, growth) => `On suppose qu'une plante, d'une hauteur initiale de
|
|
7
|
+
$${initial.frenchify()}\\ \\textrm{cm}$, croît chaque jour de $${growth.frenchify()}\\ \\textrm{cm}$.`,
|
|
8
|
+
randInitial: () => randint(2, 20),
|
|
9
|
+
randGrowth: () => randfloat(0, 4, 2, [0]),
|
|
10
|
+
functionNotation: `On note $f(x)$ la hauteur de la plante, en $\\textrm{cm}$, atteinte au $x$-ème jour.`,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: "taxi",
|
|
14
|
+
context: (initial, growth) => `Une compagnie de taxis propose un tarif qui inclut un
|
|
15
|
+
montant fixe de $${initial.frenchify()}\\ €$ et un montant variable de $${growth.frenchify()}\\ €$
|
|
16
|
+
par kilomètre parcouru.`,
|
|
17
|
+
randInitial: () => randint(2, 20),
|
|
18
|
+
randGrowth: () => randfloat(0, 4, 2, [0]),
|
|
19
|
+
functionNotation: `On note $f(x)$ le prix payé en $\\textrm{€}$ pour $x$ kilomètres parcourus.`,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "elec",
|
|
23
|
+
context: (initial, growth) => `Pour l’électricité de sa maison, Jimmy paye
|
|
24
|
+
un abonnement fixe de $${initial.frenchify()}\\ €$
|
|
25
|
+
puis il paye $${growth.frenchify()}\\ €$ par $\\textrm{kWh}$ consommé.`,
|
|
26
|
+
randInitial: () => randint(10, 20),
|
|
27
|
+
randGrowth: () => randfloat(0, 0.5, 2, [0]),
|
|
28
|
+
functionNotation: "On note $f(x)$ le prix payé en $\\textrm{€}$ pour $x\\ \\textrm{kWh}$ consommés",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "tempKm",
|
|
32
|
+
context: (initial, growth) => `Dany décide de partir au Sud de la France.
|
|
33
|
+
Il part de Valenciennes où il fait $${initial.frenchify()}\\ \\textrm{°C}$.
|
|
34
|
+
La température augmente de $${growth.frenchify()}\\ \\textrm{°C}$ à chaque centaine de km vers le Sud.`,
|
|
35
|
+
randInitial: () => randint(0, 10),
|
|
36
|
+
randGrowth: () => randfloat(0.5, 1, 2),
|
|
37
|
+
functionNotation: `On note $f(x)$ la température, en $\\textrm{°C}$, atteinte au $x$-ème centaine de $\\textrm{km}$ parcouru.`,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "salary",
|
|
41
|
+
context: (initial, growth) => `Emma est salariée. Son salaire net était
|
|
42
|
+
de $${initial.frenchify()}\\ €$ à son entrée dans l'entreprise,
|
|
43
|
+
et augmente de $${growth.frenchify()}\\ €$ tous les ans.`,
|
|
44
|
+
randInitial: () => randint(12, 17) * 100,
|
|
45
|
+
randGrowth: () => randfloat(20, 50, 2),
|
|
46
|
+
functionNotation: `On note $f(x)$ le salaire, en $\\textrm{€}$, atteint à la $x$-ème année.`,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "scoreGame",
|
|
50
|
+
context: (initial, growth) => `Rayan joue à un jeu vidéo. Au début de la partie, son score est de $${initial.frenchify()}$ points. À chaque erreur qu'il commet, il perd $${Math.abs(growth).frenchify()}$ points.`,
|
|
51
|
+
randInitial: () => randint(1, 20) * 10,
|
|
52
|
+
randGrowth: () => randint(-20, 0),
|
|
53
|
+
functionNotation: `On note $f(x)$ le score, en $\\textrm{points}$, atteint après la $x$-ème erreur.`,
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: "company",
|
|
57
|
+
context: (initial, growth) => `Une entreprise est en difficulté : elle perd de l'argent tous les jours. Aujourd'hui, elle fait un chiffre d'affaires de $${initial.frenchify()} \\ €$. Chaque jour, son chiffre d'affaire se réduit de $${Math.abs(growth).frenchify()} \\ €$.`,
|
|
58
|
+
randInitial: () => randint(1, 20) * 1000,
|
|
59
|
+
randGrowth: () => randint(-20, 0) * 10,
|
|
60
|
+
functionNotation: `On note $f(x)$ le chiffre d'affaires, en $\\textrm{€}$, atteint au $x$-ème jour.`,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "temp",
|
|
64
|
+
context: (initial, growth) => `Manon installe un thermomètre sur son balcon au début de l'automne. Le premier jour, il indique une température de $${initial.frenchify()} \\ \\textrm{°C}$. Chaque jour, elle remarque que la température baisse de $${Math.abs(growth).frenchify()} \\ °C$.`,
|
|
65
|
+
randInitial: () => randint(10, 30),
|
|
66
|
+
randGrowth: () => randfloat(-3, 0, 2, [0]),
|
|
67
|
+
functionNotation: `On note $f(x)$ la température, en $\\textrm{°C}$, atteinte au $x$-ème jour.`,
|
|
68
|
+
},
|
|
69
|
+
];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
situationId: string;
|
|
4
|
+
initial: number;
|
|
5
|
+
growth: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const affineSituationComputeAntecedent: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=affineSituationComputeAntecedent.d.ts.map
|
package/lib/exercises/math/functions/affines/situations/affineSituationComputeAntecedent.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affineSituationComputeAntecedent.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/affines/situations/affineSituationComputeAntecedent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+HF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAuBlE,CAAC"}
|