math-exercises 3.0.192 → 3.0.194
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/dataRepresentations/dataToGraphGraphToData.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +1 -1
- package/lib/exercises/math/functions/affines/index.d.ts +1 -0
- package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/index.js +1 -0
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.d.ts +10 -0
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.js +96 -0
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionWithUnitChange.d.ts +11 -0
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionWithUnitChange.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionWithUnitChange.js +116 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts +3 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponentials/index.js +3 -0
- package/lib/exercises/math/functions/exponentials/modelizeSituationByExponentialFunction.d.ts +9 -0
- package/lib/exercises/math/functions/exponentials/modelizeSituationByExponentialFunction.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/modelizeSituationByExponentialFunction.js +105 -0
- package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.js +2 -2
- package/lib/exercises/math/probaStat/stats2var/buildDataTableFromScatterplot.d.ts +8 -0
- package/lib/exercises/math/probaStat/stats2var/buildDataTableFromScatterplot.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats2var/buildDataTableFromScatterplot.js +114 -0
- package/lib/exercises/math/probaStat/stats2var/buildScatterPlotFromDataTable.d.ts +8 -0
- package/lib/exercises/math/probaStat/stats2var/buildScatterPlotFromDataTable.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats2var/buildScatterPlotFromDataTable.js +110 -0
- package/lib/exercises/math/probaStat/stats2var/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats2var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats2var/index.js +2 -0
- package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.d.ts +8 -0
- package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.js +87 -0
- package/lib/exercises/math/sequences/geometric/graph/index.d.ts +4 -1
- package/lib/exercises/math/sequences/geometric/graph/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/graph/index.js +4 -1
- package/lib/exercises/math/sequences/geometric/graph/plausibleGeometricSequenceExpressionFromGraph.d.ts +12 -0
- package/lib/exercises/math/sequences/geometric/graph/plausibleGeometricSequenceExpressionFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/plausibleGeometricSequenceExpressionFromGraph.js +133 -0
- package/lib/exercises/math/sequences/geometric/graph/readGeometricExpressionFromGraph.d.ts +8 -0
- package/lib/exercises/math/sequences/geometric/graph/readGeometricExpressionFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/readGeometricExpressionFromGraph.js +132 -0
- package/lib/exercises/math/sequences/geometric/graph/recognizeGeometricFromGraph.d.ts +11 -0
- package/lib/exercises/math/sequences/geometric/graph/recognizeGeometricFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/recognizeGeometricFromGraph.js +137 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +1 -0
- package/lib/index.d.ts +44 -0
- package/lib/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataToGraphGraphToData.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/dataToGraphGraphToData.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,QAAQ,EACT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4JF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"dataToGraphGraphToData.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/dataRepresentations/dataToGraphGraphToData.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,QAAQ,EACT,MAAM,6BAA6B,CAAC;AAKrC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4JF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
|
|
@@ -119,7 +119,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
119
119
|
};
|
|
120
120
|
export const dataToGraphGraphToData = {
|
|
121
121
|
id: "dataToGraphGraphToData",
|
|
122
|
-
label: "
|
|
122
|
+
label: "Choisir la bonne représentation d'une situation par un diagramme circulaire",
|
|
123
123
|
isSingleStep: true,
|
|
124
124
|
generator: (nb, opts) => getDistinctQuestions(() => getDataToGraphGraphToDataQuestion(opts), nb),
|
|
125
125
|
qcmTimer: 60,
|
|
@@ -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;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"}
|
|
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;AACtC,cAAc,uBAAuB,CAAC"}
|
package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
situation: number;
|
|
4
|
+
start: number;
|
|
5
|
+
reason: number;
|
|
6
|
+
x: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const computeImageByExponentialFunctionInSituation: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=computeImageByExponentialFunctionInSituation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeImageByExponentialFunctionInSituation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+FF,eAAO,MAAM,4CAA4C,EAAE,QAAQ,CAAC,WAAW,CAsB5E,CAAC"}
|
package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
5
|
+
import { round } from "../../../../math/utils/round.js";
|
|
6
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
8
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
9
|
+
const getPropositions = (n, { answer }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
addValidProp(propositions, answer);
|
|
12
|
+
propWhile(propositions, n, () => {
|
|
13
|
+
const start = randfloat(0.1, 3, 1);
|
|
14
|
+
const reason = randfloat(1.01, 3, 2);
|
|
15
|
+
const x = randfloat(0.3, 2, 1);
|
|
16
|
+
tryToAddWrongProp(propositions, round(multiply(start, power(reason, x)).simplify().evaluate(), 2).frenchify());
|
|
17
|
+
});
|
|
18
|
+
return shuffleProps(propositions, n);
|
|
19
|
+
};
|
|
20
|
+
const getAnswer = (identifiers) => {
|
|
21
|
+
const { start, reason, x } = identifiers;
|
|
22
|
+
return round(multiply(start, power(reason, x)).simplify().evaluate(), 2).frenchify();
|
|
23
|
+
};
|
|
24
|
+
const getInstruction = (identifiers) => {
|
|
25
|
+
const { start, reason, x } = identifiers;
|
|
26
|
+
return `Une entreprise modélise les coûts journaliers, en millier d'euros, engendrés par la production de $x$ tonnes de sables à l'aide de la fonction $f$ définie par :
|
|
27
|
+
|
|
28
|
+
$$
|
|
29
|
+
f(x) = ${multiply(start, power(reason, "x")).toTex()}
|
|
30
|
+
$$
|
|
31
|
+
|
|
32
|
+
Calculer les coûts de production journaliers, en millier d'euros, si l'entreprise extrait $${x}$ tonnes de sables. Arrondir au centième.`;
|
|
33
|
+
};
|
|
34
|
+
const getHint = () => {
|
|
35
|
+
return `Utilise l'expression de la fonction, et une calculatrice.`;
|
|
36
|
+
};
|
|
37
|
+
const getCorrection = (identifiers) => {
|
|
38
|
+
const { start, reason, x } = identifiers;
|
|
39
|
+
return `Il suffit de remplacer $x$ par $${x}$ dans l'expression de la fonction :
|
|
40
|
+
|
|
41
|
+
$$
|
|
42
|
+
f(${x}) = ${multiply(start, power(reason, x)).toTex()}\\approx ${getAnswer(identifiers)}
|
|
43
|
+
$$`;
|
|
44
|
+
};
|
|
45
|
+
const getKeys = () => {
|
|
46
|
+
return [];
|
|
47
|
+
};
|
|
48
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
49
|
+
try {
|
|
50
|
+
return numberVEA(ans, answer);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
return handleVEAError(err);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const getModelizeSituationByExponentialFunctionQuestion = () => {
|
|
57
|
+
const start = randfloat(0.1, 3, 1);
|
|
58
|
+
const reason = randfloat(1.01, 3, 2);
|
|
59
|
+
const x = randfloat(0.3, 2, 1);
|
|
60
|
+
const identifiers = {
|
|
61
|
+
reason,
|
|
62
|
+
start,
|
|
63
|
+
x,
|
|
64
|
+
situation: 0,
|
|
65
|
+
};
|
|
66
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
67
|
+
};
|
|
68
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
69
|
+
return {
|
|
70
|
+
answer: getAnswer(identifiers),
|
|
71
|
+
instruction: getInstruction(identifiers),
|
|
72
|
+
keys: getKeys(identifiers),
|
|
73
|
+
answerFormat: "tex",
|
|
74
|
+
identifiers,
|
|
75
|
+
hint: getHint(identifiers),
|
|
76
|
+
correction: getCorrection(identifiers),
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export const computeImageByExponentialFunctionInSituation = {
|
|
80
|
+
id: "computeImageByExponentialFunctionInSituation",
|
|
81
|
+
connector: "=",
|
|
82
|
+
label: "Calculer une image par une fonction exponentielle dans un contexte",
|
|
83
|
+
isSingleStep: true,
|
|
84
|
+
generator: (nb, opts) => getDistinctQuestions(() => getModelizeSituationByExponentialFunctionQuestion(opts), nb),
|
|
85
|
+
qcmTimer: 60,
|
|
86
|
+
freeTimer: 60,
|
|
87
|
+
getPropositions,
|
|
88
|
+
isAnswerValid,
|
|
89
|
+
subject: "Mathématiques",
|
|
90
|
+
getInstruction,
|
|
91
|
+
getHint,
|
|
92
|
+
getCorrection,
|
|
93
|
+
getAnswer,
|
|
94
|
+
getQuestionFromIdentifiers,
|
|
95
|
+
hasHintAndCorrection: true,
|
|
96
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
situation: number;
|
|
4
|
+
start: number;
|
|
5
|
+
rate: number;
|
|
6
|
+
x: number;
|
|
7
|
+
displayedX: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const computeImageByExponentialFunctionWithUnitChange: Exercise<Identifiers>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=computeImageByExponentialFunctionWithUnitChange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeImageByExponentialFunctionWithUnitChange.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/computeImageByExponentialFunctionWithUnitChange.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAyHF,eAAO,MAAM,+CAA+C,EAAE,QAAQ,CAAC,WAAW,CAuB/E,CAAC"}
|
package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionWithUnitChange.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { round } from "../../../../math/utils/round.js";
|
|
6
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
8
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
9
|
+
const getPropositions = (n, { answer, start, rate, x }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
addValidProp(propositions, answer);
|
|
12
|
+
const cm = round(1 + rate / 100, 4);
|
|
13
|
+
tryToAddWrongProp(propositions, round(multiply(start, power(cm, 2000 + x)).evaluate(), 0).frenchify());
|
|
14
|
+
tryToAddWrongProp(propositions, round(multiply(start, power(rate, x)).evaluate(), 0).frenchify());
|
|
15
|
+
propWhile(propositions, n, () => {
|
|
16
|
+
const fakeStart = randint(10, 100);
|
|
17
|
+
const fakeRate = randint(1, 20);
|
|
18
|
+
const fakeCM = round(1 + fakeRate / 100, 4);
|
|
19
|
+
tryToAddWrongProp(propositions, round(multiply(fakeStart, power(fakeCM, x)).evaluate(), 0).frenchify());
|
|
20
|
+
});
|
|
21
|
+
return shuffleProps(propositions, n);
|
|
22
|
+
};
|
|
23
|
+
const getAnswer = (identifiers) => {
|
|
24
|
+
const { x, rate, start } = identifiers;
|
|
25
|
+
const cm = round(1 + rate / 100, 4);
|
|
26
|
+
return round(multiply(start, power(cm, x)).evaluate(), 0).frenchify();
|
|
27
|
+
};
|
|
28
|
+
const getInstruction = (identifiers) => {
|
|
29
|
+
const { displayedX, rate, start } = identifiers;
|
|
30
|
+
const cm = round(1 + rate / 100, 4);
|
|
31
|
+
return `Le nombre de poissons dans un lac augmente de $${rate}\\%$ tous les ans.
|
|
32
|
+
|
|
33
|
+
En $2000$, le lac comptait $${start}$ poissons.
|
|
34
|
+
|
|
35
|
+
On note $f(x)$ le nombre de poissons en $2000+x$ (où $x$ est un réel positif).
|
|
36
|
+
|
|
37
|
+
On a alors, pour tout $x\\in [0;+\\infty[$ :
|
|
38
|
+
|
|
39
|
+
$$
|
|
40
|
+
f(x) = ${multiply(start, power(cm, "x")).toTex()}
|
|
41
|
+
$$
|
|
42
|
+
|
|
43
|
+
Calculer le nombre de poissons au ${displayedX} (arrondir à l'unité).`;
|
|
44
|
+
};
|
|
45
|
+
const getHint = (identifiers) => {
|
|
46
|
+
const { displayedX } = identifiers;
|
|
47
|
+
return `Détermine ce que vaut $x$ pour obtenir "le ${displayedX}".
|
|
48
|
+
|
|
49
|
+
Puis, utilise l'expression de la fonction.`;
|
|
50
|
+
};
|
|
51
|
+
const getCorrection = (identifiers) => {
|
|
52
|
+
const { displayedX, x, rate, start } = identifiers;
|
|
53
|
+
const cm = round(1 + rate / 100, 4);
|
|
54
|
+
return `Puisque $f(x)$ donne le nombre de poissons en $2000+x$, le ${displayedX} s'obtient pour $x = ${x.frenchify()}$.
|
|
55
|
+
|
|
56
|
+
Il ne reste plus qu'à calculer l'image de $${x.frenchify()}$ par $f$ :
|
|
57
|
+
|
|
58
|
+
$$
|
|
59
|
+
f(${x.frenchify()}) = ${multiply(start, power(cm, x)).toTex()} \\approx ${getAnswer(identifiers)}
|
|
60
|
+
$$
|
|
61
|
+
`;
|
|
62
|
+
};
|
|
63
|
+
const getKeys = () => {
|
|
64
|
+
return [];
|
|
65
|
+
};
|
|
66
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
67
|
+
try {
|
|
68
|
+
return numberVEA(ans, answer);
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
return handleVEAError(err);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const getComputeImageByExponentialFunctionWithUnitChangeQuestion = () => {
|
|
75
|
+
const start = randint(10, 100);
|
|
76
|
+
const rate = randint(1, 20);
|
|
77
|
+
const rawYear = randint(1, 40);
|
|
78
|
+
const x = rawYear + 0.5;
|
|
79
|
+
const identifiers = {
|
|
80
|
+
displayedX: `milieu de l'année $${2000 + rawYear}$`,
|
|
81
|
+
rate,
|
|
82
|
+
situation: 0,
|
|
83
|
+
start,
|
|
84
|
+
x,
|
|
85
|
+
};
|
|
86
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
87
|
+
};
|
|
88
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
89
|
+
return {
|
|
90
|
+
answer: getAnswer(identifiers),
|
|
91
|
+
instruction: getInstruction(identifiers),
|
|
92
|
+
keys: getKeys(identifiers),
|
|
93
|
+
answerFormat: "tex",
|
|
94
|
+
identifiers,
|
|
95
|
+
hint: getHint(identifiers),
|
|
96
|
+
correction: getCorrection(identifiers),
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
export const computeImageByExponentialFunctionWithUnitChange = {
|
|
100
|
+
id: "computeImageByExponentialFunctionWithUnitChange",
|
|
101
|
+
connector: "=",
|
|
102
|
+
label: "Calculer une image par une fonction exponentielle dans un contexte (avec travail sur $x$)",
|
|
103
|
+
isSingleStep: true,
|
|
104
|
+
generator: (nb, opts) => getDistinctQuestions(() => getComputeImageByExponentialFunctionWithUnitChangeQuestion(opts), nb),
|
|
105
|
+
qcmTimer: 60,
|
|
106
|
+
freeTimer: 60,
|
|
107
|
+
getPropositions,
|
|
108
|
+
isAnswerValid,
|
|
109
|
+
subject: "Mathématiques",
|
|
110
|
+
getInstruction,
|
|
111
|
+
getHint,
|
|
112
|
+
getCorrection,
|
|
113
|
+
getAnswer,
|
|
114
|
+
getQuestionFromIdentifiers,
|
|
115
|
+
hasHintAndCorrection: true,
|
|
116
|
+
};
|
|
@@ -7,4 +7,7 @@ export * from "./realPowersProduct.js";
|
|
|
7
7
|
export * from "./realPowersFraction.js";
|
|
8
8
|
export * from "./realPowersPower.js";
|
|
9
9
|
export * from "./realPowersMixOperations.js";
|
|
10
|
+
export * from "./computeImageByExponentialFunctionInSituation.js";
|
|
11
|
+
export * from "./modelizeSituationByExponentialFunction.js";
|
|
12
|
+
export * from "./computeImageByExponentialFunctionWithUnitChange.js";
|
|
10
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sDAAsD,CAAC;AAErE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,sDAAsD,CAAC;AAErE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mDAAmD,CAAC;AAClE,cAAc,6CAA6C,CAAC;AAC5D,cAAc,sDAAsD,CAAC"}
|
|
@@ -8,3 +8,6 @@ export * from "./realPowersProduct.js";
|
|
|
8
8
|
export * from "./realPowersFraction.js";
|
|
9
9
|
export * from "./realPowersPower.js";
|
|
10
10
|
export * from "./realPowersMixOperations.js";
|
|
11
|
+
export * from "./computeImageByExponentialFunctionInSituation.js";
|
|
12
|
+
export * from "./modelizeSituationByExponentialFunction.js";
|
|
13
|
+
export * from "./computeImageByExponentialFunctionWithUnitChange.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
situation: number;
|
|
4
|
+
start: number;
|
|
5
|
+
rate: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const modelizeSituationByExponentialFunction: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=modelizeSituationByExponentialFunction.d.ts.map
|
package/lib/exercises/math/functions/exponentials/modelizeSituationByExponentialFunction.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modelizeSituationByExponentialFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/modelizeSituationByExponentialFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAqGF,eAAO,MAAM,sCAAsC,EAAE,QAAQ,CAAC,WAAW,CAsBxE,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
4
|
+
import { round } from "../../../../math/utils/round.js";
|
|
5
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
6
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
7
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
8
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
9
|
+
const getPropositions = (n, { answer, start, rate }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
addValidProp(propositions, answer);
|
|
12
|
+
tryToAddWrongProp(propositions, multiply(start, power(rate, "x")).toTex());
|
|
13
|
+
tryToAddWrongProp(propositions, multiply(start, power(round(rate / 100, 4), "x")).toTex());
|
|
14
|
+
propWhile(propositions, n, () => {
|
|
15
|
+
const fakeStart = randfloat(10, 100, 1);
|
|
16
|
+
const fakeRate = randfloat(1, 20, 1);
|
|
17
|
+
const fakeCM = round(1 - fakeRate / 100, 4);
|
|
18
|
+
tryToAddWrongProp(propositions, multiply(fakeStart, power(fakeCM, "x")).toTex());
|
|
19
|
+
});
|
|
20
|
+
return shuffleProps(propositions, n);
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
const { start, rate } = identifiers;
|
|
24
|
+
const cm = round(1 - rate / 100, 4);
|
|
25
|
+
return multiply(start, power(cm, "x")).toTex();
|
|
26
|
+
};
|
|
27
|
+
const getInstruction = (identifiers) => {
|
|
28
|
+
const { start, rate } = identifiers;
|
|
29
|
+
return `La surface agricole utilisée par les agriculteurs d'un pays s'élevait à $${start}$ millions d'hectares en $2000$.
|
|
30
|
+
|
|
31
|
+
Depuis, on estime qu'elle baisse en moyenne de $${rate}\\%$ par an.
|
|
32
|
+
|
|
33
|
+
Soit $f$ la fonction qui donne la surface agricole utilisée, en millions d'hectare, en $2000+x$ (où $x$ est un réel positif).
|
|
34
|
+
|
|
35
|
+
Donner l'expression de $f$.`;
|
|
36
|
+
};
|
|
37
|
+
const getHint = () => {
|
|
38
|
+
return `Calcule la surface agricole utilisée en $2000$, puis en $2001$, puis en $2002$... Puis, généralise ce calcule pour l'année $2000+x$.`;
|
|
39
|
+
};
|
|
40
|
+
const getCorrection = (identifiers) => {
|
|
41
|
+
const { start, rate } = identifiers;
|
|
42
|
+
const cm = round(1 - rate / 100, 4);
|
|
43
|
+
return `Puisque la surface agricole utilisée baisse de $${rate}\\%$ par an, elle est multipliée par $${cm}$ chaque année.
|
|
44
|
+
|
|
45
|
+
À l'année $2000$, elle était de $${start}$ milliers d'hectares.
|
|
46
|
+
|
|
47
|
+
En $2000+x$, où $x$ est un réel positif, elle sera donc de :
|
|
48
|
+
|
|
49
|
+
$$
|
|
50
|
+
f(x) = ${getAnswer(identifiers)}
|
|
51
|
+
$$`;
|
|
52
|
+
};
|
|
53
|
+
const getKeys = () => {
|
|
54
|
+
return ["x"];
|
|
55
|
+
};
|
|
56
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
57
|
+
try {
|
|
58
|
+
const parsed = parseAlgebraic(ans);
|
|
59
|
+
if (!parsed)
|
|
60
|
+
return false;
|
|
61
|
+
return parsed.simplify().toTex() === answer;
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
return handleVEAError(err);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const getModelizeSituationByExponentialFunctionQuestion = () => {
|
|
68
|
+
const start = randfloat(20, 50, 1);
|
|
69
|
+
const rate = randfloat(0.1, 2, 1);
|
|
70
|
+
const identifiers = {
|
|
71
|
+
start,
|
|
72
|
+
rate,
|
|
73
|
+
situation: 0,
|
|
74
|
+
};
|
|
75
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
76
|
+
};
|
|
77
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
78
|
+
return {
|
|
79
|
+
answer: getAnswer(identifiers),
|
|
80
|
+
instruction: getInstruction(identifiers),
|
|
81
|
+
keys: getKeys(identifiers),
|
|
82
|
+
answerFormat: "tex",
|
|
83
|
+
identifiers,
|
|
84
|
+
hint: getHint(identifiers),
|
|
85
|
+
correction: getCorrection(identifiers),
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export const modelizeSituationByExponentialFunction = {
|
|
89
|
+
id: "modelizeSituationByExponentialFunction",
|
|
90
|
+
connector: "=",
|
|
91
|
+
label: "Modéliser une situation de croissance continue par une fonction exponentielle",
|
|
92
|
+
isSingleStep: true,
|
|
93
|
+
generator: (nb, opts) => getDistinctQuestions(() => getModelizeSituationByExponentialFunctionQuestion(opts), nb),
|
|
94
|
+
qcmTimer: 60,
|
|
95
|
+
freeTimer: 60,
|
|
96
|
+
getPropositions,
|
|
97
|
+
isAnswerValid,
|
|
98
|
+
subject: "Mathématiques",
|
|
99
|
+
getInstruction,
|
|
100
|
+
getHint,
|
|
101
|
+
getCorrection,
|
|
102
|
+
getAnswer,
|
|
103
|
+
getQuestionFromIdentifiers,
|
|
104
|
+
hasHintAndCorrection: true,
|
|
105
|
+
};
|
package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.js
CHANGED
|
@@ -77,7 +77,7 @@ const getPlausibleExponentialFunctionExpressionFromGraphQuestion = () => {
|
|
|
77
77
|
const firstK = k;
|
|
78
78
|
const secondK = randfloat(0.1, 4, 2);
|
|
79
79
|
const delta = randfloat(1, 3, 2);
|
|
80
|
-
const thirdK = k - delta > 0 ? k - delta : k + delta;
|
|
80
|
+
const thirdK = round(k - delta > 0 ? k - delta : k + delta, 2);
|
|
81
81
|
fakeParams = [
|
|
82
82
|
{ a: firstDescA, k: firstK },
|
|
83
83
|
{ a: secondDescA, k: secondK },
|
|
@@ -91,7 +91,7 @@ const getPlausibleExponentialFunctionExpressionFromGraphQuestion = () => {
|
|
|
91
91
|
const firstK = k;
|
|
92
92
|
const secondK = randfloat(0.1, 4, 2);
|
|
93
93
|
const delta = randfloat(1, 3, 2);
|
|
94
|
-
const thirdK = k - delta > 0 ? k - delta : k + delta;
|
|
94
|
+
const thirdK = round(k - delta > 0 ? k - delta : k + delta, 2);
|
|
95
95
|
fakeParams = [
|
|
96
96
|
{ a: firstAscA, k: firstK },
|
|
97
97
|
{ a: secondAscA, k: secondK },
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
xs: number[];
|
|
4
|
+
ys: number[];
|
|
5
|
+
};
|
|
6
|
+
export declare const buildDataTableFromScatterplot: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=buildDataTableFromScatterplot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildDataTableFromScatterplot.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats2var/buildDataTableFromScatterplot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,EAAE,EAAE,MAAM,EAAE,CAAC;CACd,CAAC;AA6GF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAsB/D,CAAC"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
2
|
+
import { valueTableVEA } from "../../../../exercises/vea/valueTableVEA.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { PointConstructor } from "../../../../math/geometry/point.js";
|
|
5
|
+
import { randTupleInt } from "../../../../math/utils/random/randTupleInt.js";
|
|
6
|
+
import { dollarize } from "../../../../utils/latex/dollarize.js";
|
|
7
|
+
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
8
|
+
const getAnswerTable = (identifiers) => {
|
|
9
|
+
const { xs, ys } = identifiers;
|
|
10
|
+
return [
|
|
11
|
+
["\\text{Temps de révision}", ...xs.map((e) => e.frenchify())],
|
|
12
|
+
["\\text{Note}", ...ys.map((e) => e.frenchify())],
|
|
13
|
+
];
|
|
14
|
+
};
|
|
15
|
+
const getInstruction = () => {
|
|
16
|
+
return `Le graphique ci-dessous donne les résultats d'une classe à un contrôle : le temps de révision (en heures) est en abscisse, et la note obtenue (sur $10$) est en ordonnée.
|
|
17
|
+
|
|
18
|
+
Compléter le tableau de données associé à ce nuage de points.`;
|
|
19
|
+
};
|
|
20
|
+
const getHint = () => {
|
|
21
|
+
return `Lis l'abscisse et l'ordonnée de chaque point. Dans le tableau, chaque colonne correspond à un point. Classe ces points dans l'ordre croissant de leur abscisse.`;
|
|
22
|
+
};
|
|
23
|
+
const getCorrection = (identifiers) => {
|
|
24
|
+
const { xs, ys } = identifiers;
|
|
25
|
+
const points = xs.map((x, i) => PointConstructor.fromCoords([x, ys[i]], `P_${i}`));
|
|
26
|
+
return `On lit les coordonnées de chaque point, on trouve :
|
|
27
|
+
|
|
28
|
+
- $${points.map((p) => p.toCoords()).join("$ \n - $")}$
|
|
29
|
+
|
|
30
|
+
On entre les abscisses dans la première ligne, et les ordonnées correspondantes dans la deuxième.
|
|
31
|
+
|
|
32
|
+
On obtient donc le tableau suivant :
|
|
33
|
+
|
|
34
|
+
${mdTable([
|
|
35
|
+
["Temps de révision", ...xs.map((e) => dollarize(e.frenchify()))],
|
|
36
|
+
["Note", ...ys.map((e) => dollarize(e.frenchify()))],
|
|
37
|
+
])}`;
|
|
38
|
+
};
|
|
39
|
+
const getGGBOptions = (identifiers) => {
|
|
40
|
+
const { xs, ys } = identifiers;
|
|
41
|
+
const points = xs.map((x, i) => PointConstructor.fromCoords([x, ys[i]], `P_${i}`));
|
|
42
|
+
const ggb = new GeogebraConstructor({
|
|
43
|
+
commands: [
|
|
44
|
+
...points.flatMap((p) => p.toGGBCommand({
|
|
45
|
+
isFixed: true,
|
|
46
|
+
isSelectionnable: false,
|
|
47
|
+
showLabel: false,
|
|
48
|
+
})),
|
|
49
|
+
],
|
|
50
|
+
});
|
|
51
|
+
return ggb.getOptions({
|
|
52
|
+
coords: [-1, 11, -1, 11],
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
const getKeys = () => {
|
|
56
|
+
return [];
|
|
57
|
+
};
|
|
58
|
+
const isAnswerTableValid = (ans, { answerTable }) => {
|
|
59
|
+
return valueTableVEA(ans, answerTable);
|
|
60
|
+
};
|
|
61
|
+
const getBuildDataTableFromScatterplotQuestion = () => {
|
|
62
|
+
const xs = randTupleInt(4, {
|
|
63
|
+
from: 0,
|
|
64
|
+
to: 10,
|
|
65
|
+
allDifferent: true,
|
|
66
|
+
sorted: true,
|
|
67
|
+
});
|
|
68
|
+
const ys = randTupleInt(4, {
|
|
69
|
+
from: 0,
|
|
70
|
+
to: 10,
|
|
71
|
+
allDifferent: true,
|
|
72
|
+
sorted: true,
|
|
73
|
+
});
|
|
74
|
+
const identifiers = {
|
|
75
|
+
xs,
|
|
76
|
+
ys,
|
|
77
|
+
};
|
|
78
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
79
|
+
};
|
|
80
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
81
|
+
return {
|
|
82
|
+
answerTable: getAnswerTable(identifiers),
|
|
83
|
+
instruction: getInstruction(identifiers),
|
|
84
|
+
keys: getKeys(identifiers),
|
|
85
|
+
answerFormat: "tex",
|
|
86
|
+
identifiers,
|
|
87
|
+
hint: getHint(identifiers),
|
|
88
|
+
correction: getCorrection(identifiers),
|
|
89
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
90
|
+
initTable: [
|
|
91
|
+
["\\text{Temps de révision}", "", "", "", ""],
|
|
92
|
+
["\\text{Note}", "", "", "", ""],
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
export const buildDataTableFromScatterplot = {
|
|
97
|
+
id: "buildDataTableFromScatterplot",
|
|
98
|
+
label: "Construire le tableau de valeurs associé à un nuage de points",
|
|
99
|
+
isSingleStep: true,
|
|
100
|
+
generator: (nb, opts) => getDistinctQuestions(() => getBuildDataTableFromScatterplotQuestion(opts), nb),
|
|
101
|
+
qcmTimer: 60,
|
|
102
|
+
freeTimer: 60,
|
|
103
|
+
isAnswerTableValid,
|
|
104
|
+
subject: "Mathématiques",
|
|
105
|
+
getHint,
|
|
106
|
+
getCorrection,
|
|
107
|
+
getInstruction,
|
|
108
|
+
getAnswerTable,
|
|
109
|
+
getGGBOptions,
|
|
110
|
+
hasGeogebra: true,
|
|
111
|
+
getQuestionFromIdentifiers,
|
|
112
|
+
answerType: "valueTable",
|
|
113
|
+
hasHintAndCorrection: true,
|
|
114
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
xs: number[];
|
|
4
|
+
ys: number[];
|
|
5
|
+
};
|
|
6
|
+
export declare const buildScatterPlotFromDataTable: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=buildScatterPlotFromDataTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildScatterPlotFromDataTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats2var/buildScatterPlotFromDataTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,EAAE,CAAC;IACb,EAAE,EAAE,MAAM,EAAE,CAAC;CACd,CAAC;AA8GF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAoB/D,CAAC"}
|