math-exercises 3.0.191 → 3.0.193

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.
Files changed (94) hide show
  1. package/lib/exercises/math/dataRepresentations/barChart/barChartInterpreting.d.ts +53 -0
  2. package/lib/exercises/math/dataRepresentations/barChart/barChartInterpreting.d.ts.map +1 -0
  3. package/lib/exercises/math/dataRepresentations/barChart/barChartInterpreting.js +543 -0
  4. package/lib/exercises/math/dataRepresentations/barChart/barChartReading.d.ts +94 -0
  5. package/lib/exercises/math/dataRepresentations/barChart/barChartReading.d.ts.map +1 -0
  6. package/lib/exercises/math/dataRepresentations/barChart/barChartReading.js +280 -0
  7. package/lib/exercises/math/dataRepresentations/barChart/index.d.ts +3 -0
  8. package/lib/exercises/math/dataRepresentations/barChart/index.d.ts.map +1 -0
  9. package/lib/exercises/math/dataRepresentations/barChart/index.js +2 -0
  10. package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotInterpreting.d.ts +7 -0
  11. package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotInterpreting.d.ts.map +1 -0
  12. package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotInterpreting.js +223 -0
  13. package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReading.d.ts +9 -0
  14. package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReading.d.ts.map +1 -0
  15. package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReading.js +133 -0
  16. package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReadingPercentages.d.ts +11 -0
  17. package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReadingPercentages.d.ts.map +1 -0
  18. package/lib/exercises/math/dataRepresentations/boxPlot/boxPlotReadingPercentages.js +198 -0
  19. package/lib/exercises/math/dataRepresentations/boxPlot/compareBoxPlot.d.ts +13 -0
  20. package/lib/exercises/math/dataRepresentations/boxPlot/compareBoxPlot.d.ts.map +1 -0
  21. package/lib/exercises/math/dataRepresentations/boxPlot/compareBoxPlot.js +192 -0
  22. package/lib/exercises/math/dataRepresentations/boxPlot/index.d.ts +5 -0
  23. package/lib/exercises/math/dataRepresentations/boxPlot/index.d.ts.map +1 -0
  24. package/lib/exercises/math/dataRepresentations/boxPlot/index.js +4 -0
  25. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts.map +1 -1
  26. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +1 -1
  27. package/lib/exercises/math/dataRepresentations/index.d.ts +4 -7
  28. package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
  29. package/lib/exercises/math/dataRepresentations/index.js +4 -11
  30. package/lib/exercises/math/dataRepresentations/tables/buildDoubleTableFromContext.d.ts +7 -0
  31. package/lib/exercises/math/dataRepresentations/tables/buildDoubleTableFromContext.d.ts.map +1 -0
  32. package/lib/exercises/math/dataRepresentations/tables/buildDoubleTableFromContext.js +222 -0
  33. package/lib/exercises/math/dataRepresentations/tables/fillDoubleTable.d.ts +7 -0
  34. package/lib/exercises/math/dataRepresentations/tables/fillDoubleTable.d.ts.map +1 -0
  35. package/lib/exercises/math/dataRepresentations/tables/fillDoubleTable.js +187 -0
  36. package/lib/exercises/math/dataRepresentations/tables/index.d.ts +4 -0
  37. package/lib/exercises/math/dataRepresentations/tables/index.d.ts.map +1 -0
  38. package/lib/exercises/math/dataRepresentations/tables/index.js +3 -0
  39. package/lib/exercises/math/dataRepresentations/tables/tableReading.d.ts +8 -0
  40. package/lib/exercises/math/dataRepresentations/tables/tableReading.d.ts.map +1 -0
  41. package/lib/exercises/math/dataRepresentations/tables/tableReading.js +109 -0
  42. package/lib/exercises/math/derivation/applications/findYearForDecreasingPopulation.d.ts +8 -0
  43. package/lib/exercises/math/derivation/applications/findYearForDecreasingPopulation.d.ts.map +1 -0
  44. package/lib/exercises/math/derivation/applications/findYearForDecreasingPopulation.js +145 -0
  45. package/lib/exercises/math/derivation/applications/index.d.ts +1 -0
  46. package/lib/exercises/math/derivation/applications/index.d.ts.map +1 -1
  47. package/lib/exercises/math/derivation/applications/index.js +1 -0
  48. package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.d.ts +10 -0
  49. package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.d.ts.map +1 -0
  50. package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.js +96 -0
  51. package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionWithUnitChange.d.ts +11 -0
  52. package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionWithUnitChange.d.ts.map +1 -0
  53. package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionWithUnitChange.js +116 -0
  54. package/lib/exercises/math/functions/exponentials/index.d.ts +3 -0
  55. package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -1
  56. package/lib/exercises/math/functions/exponentials/index.js +3 -0
  57. package/lib/exercises/math/functions/exponentials/modelizeSituationByExponentialFunction.d.ts +9 -0
  58. package/lib/exercises/math/functions/exponentials/modelizeSituationByExponentialFunction.d.ts.map +1 -0
  59. package/lib/exercises/math/functions/exponentials/modelizeSituationByExponentialFunction.js +105 -0
  60. package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.js +2 -2
  61. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts.map +1 -1
  62. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.js +7 -2
  63. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  64. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +131 -61
  65. package/lib/exercises/math/probaStat/stats2var/buildDataTableFromScatterplot.d.ts +8 -0
  66. package/lib/exercises/math/probaStat/stats2var/buildDataTableFromScatterplot.d.ts.map +1 -0
  67. package/lib/exercises/math/probaStat/stats2var/buildDataTableFromScatterplot.js +114 -0
  68. package/lib/exercises/math/probaStat/stats2var/buildScatterPlotFromDataTable.d.ts +8 -0
  69. package/lib/exercises/math/probaStat/stats2var/buildScatterPlotFromDataTable.d.ts.map +1 -0
  70. package/lib/exercises/math/probaStat/stats2var/buildScatterPlotFromDataTable.js +110 -0
  71. package/lib/exercises/math/probaStat/stats2var/index.d.ts +2 -0
  72. package/lib/exercises/math/probaStat/stats2var/index.d.ts.map +1 -1
  73. package/lib/exercises/math/probaStat/stats2var/index.js +2 -0
  74. package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.d.ts +8 -0
  75. package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.d.ts.map +1 -0
  76. package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.js +87 -0
  77. package/lib/exercises/math/sequences/geometric/graph/index.d.ts +4 -1
  78. package/lib/exercises/math/sequences/geometric/graph/index.d.ts.map +1 -1
  79. package/lib/exercises/math/sequences/geometric/graph/index.js +4 -1
  80. package/lib/exercises/math/sequences/geometric/graph/plausibleGeometricSequenceExpressionFromGraph.d.ts +12 -0
  81. package/lib/exercises/math/sequences/geometric/graph/plausibleGeometricSequenceExpressionFromGraph.d.ts.map +1 -0
  82. package/lib/exercises/math/sequences/geometric/graph/plausibleGeometricSequenceExpressionFromGraph.js +133 -0
  83. package/lib/exercises/math/sequences/geometric/graph/readGeometricExpressionFromGraph.d.ts +8 -0
  84. package/lib/exercises/math/sequences/geometric/graph/readGeometricExpressionFromGraph.d.ts.map +1 -0
  85. package/lib/exercises/math/sequences/geometric/graph/readGeometricExpressionFromGraph.js +132 -0
  86. package/lib/exercises/math/sequences/geometric/graph/recognizeGeometricFromGraph.d.ts +11 -0
  87. package/lib/exercises/math/sequences/geometric/graph/recognizeGeometricFromGraph.d.ts.map +1 -0
  88. package/lib/exercises/math/sequences/geometric/graph/recognizeGeometricFromGraph.js +137 -0
  89. package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
  90. package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
  91. package/lib/exercises/math/sequences/geometric/index.js +1 -0
  92. package/lib/index.d.ts +71 -25
  93. package/lib/index.d.ts.map +1 -1
  94. package/package.json +1 -1
@@ -0,0 +1,145 @@
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 { Affine } from "../../../../math/polynomials/affine.js";
5
+ import { TrinomConstructor } from "../../../../math/polynomials/trinom.js";
6
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
7
+ import { randint } from "../../../../math/utils/random/randint.js";
8
+ import { round } from "../../../../math/utils/round.js";
9
+ import { firstDegreeInequationResolutionTex } from "../../../../tree/nodes/inequations/inequationNode.js";
10
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
11
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
12
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
13
+ const getPropositions = (n, { answer, coeffs, isAskingX }) => {
14
+ const propositions = [];
15
+ addValidProp(propositions, answer);
16
+ const trinom = TrinomConstructor.fromCoeffs(coeffs);
17
+ propWhile(propositions, n, () => {
18
+ if (isAskingX)
19
+ tryToAddWrongProp(propositions, (2013 + randint(1, 20)).frenchify());
20
+ else
21
+ tryToAddWrongProp(propositions, trinom
22
+ .toTree()
23
+ .toDetailedEvaluation({
24
+ x: randint(1, 20).toTree(),
25
+ })
26
+ .simplify()
27
+ .toTex());
28
+ });
29
+ return shuffleProps(propositions, n);
30
+ };
31
+ const getAnswer = (identifiers) => {
32
+ const { coeffs, isAskingX } = identifiers;
33
+ const trinom = TrinomConstructor.fromCoeffs(coeffs);
34
+ const a = round(2 * coeffs[2], 4);
35
+ const b = coeffs[1];
36
+ const root = frac(-b, a).simplify();
37
+ if (isAskingX) {
38
+ return round(2013 + root.evaluate(), 4).frenchify();
39
+ }
40
+ return trinom
41
+ .toTree()
42
+ .toDetailedEvaluation({
43
+ x: root,
44
+ })
45
+ .simplify()
46
+ .toTex();
47
+ };
48
+ const getInstruction = (identifiers) => {
49
+ const { coeffs, isAskingX } = identifiers;
50
+ const trinom = TrinomConstructor.fromCoeffs(coeffs);
51
+ return `On estime que la population d'une ville, exprimée en milliers d'habitants, peut être modélisée par la fonction $f$ définie sur $[0; +\\infty[$ par :
52
+
53
+ $$
54
+ f(x) = ${trinom.toTree().toTex()}
55
+ $$
56
+
57
+ où $x$ est la durée, en année, écoulée depuis $2013$.
58
+
59
+ ${isAskingX
60
+ ? `En quelle année la population de la ville est-elle maximale ?`
61
+ : `Quelle est la population maximale de la ville ?`}`;
62
+ };
63
+ const getHint = () => {
64
+ return `Calcule la dérivée $f'$ de $f$, puis étudie son signe. Le maximum de $f$ est atteint pour la valeur de $x$ telle que $f'(x) = 0$ et telle que $f'$ change de signe en $x$.`;
65
+ };
66
+ const getCorrection = (identifiers) => {
67
+ const { coeffs } = identifiers;
68
+ const trinom = TrinomConstructor.fromCoeffs(coeffs);
69
+ const a = round(2 * coeffs[2], 4);
70
+ const b = coeffs[1];
71
+ const affine = new Affine(a, b);
72
+ const root = frac(-b, a).simplify();
73
+ const froot = trinom.toTree().toDetailedEvaluation({ x: root }).simplify();
74
+ return `On calcule $f'(x)$ :
75
+
76
+ $$
77
+ f'(x) = ${trinom.derivate().toTree().toTex()}
78
+ $$
79
+
80
+ On étudie ensuite le signe de $f'(x)$ :
81
+
82
+ $$
83
+ ${firstDegreeInequationResolutionTex(affine, "\\ge", (0).toTree())}
84
+ $$
85
+
86
+ On en déduit donc que $f$ atteint son maximum pour $x = ${root.toTex()}$, et on a alors :
87
+
88
+ $$
89
+ f(${root.toTex()}) = ${froot.toTex()}
90
+ $$
91
+
92
+ La population de la ville est donc maximale à l'année $${round(2013 + root.evaluate(), 4)}$, et elle est alors de $${froot.toTex()}$ milliers d'habitants.`;
93
+ };
94
+ const getKeys = () => {
95
+ return [];
96
+ };
97
+ const isAnswerValid = (ans, { answer }) => {
98
+ try {
99
+ return numberVEA(ans, answer);
100
+ }
101
+ catch (err) {
102
+ return handleVEAError(err);
103
+ }
104
+ };
105
+ const getFindYearForDecreasingPopulationQuestion = () => {
106
+ const alpha = randint(1, 20);
107
+ const beta = randfloat(10, 100, 2);
108
+ const a = randfloat(-0.9, -0.1, 2);
109
+ const b = round(-2 * a * alpha, 4);
110
+ const c = round((beta + a * alpha) ^ 2, 4);
111
+ const identifiers = {
112
+ isAskingX: coinFlip(),
113
+ coeffs: [c, b, a],
114
+ };
115
+ return getQuestionFromIdentifiers(identifiers);
116
+ };
117
+ const getQuestionFromIdentifiers = (identifiers) => {
118
+ return {
119
+ answer: getAnswer(identifiers),
120
+ instruction: getInstruction(identifiers),
121
+ keys: getKeys(identifiers),
122
+ answerFormat: "tex",
123
+ identifiers,
124
+ hint: getHint(identifiers),
125
+ correction: getCorrection(identifiers),
126
+ };
127
+ };
128
+ export const findYearForDecreasingPopulation = {
129
+ id: "findYearForDecreasingPopulation",
130
+ connector: "=",
131
+ label: "Déterminer le maximum d'une population (dérivation)",
132
+ isSingleStep: true,
133
+ generator: (nb, opts) => getDistinctQuestions(() => getFindYearForDecreasingPopulationQuestion(opts), nb),
134
+ qcmTimer: 60,
135
+ freeTimer: 60,
136
+ getPropositions,
137
+ isAnswerValid,
138
+ subject: "Mathématiques",
139
+ getInstruction,
140
+ getHint,
141
+ getCorrection,
142
+ getAnswer,
143
+ getQuestionFromIdentifiers,
144
+ hasHintAndCorrection: true,
145
+ };
@@ -1,3 +1,4 @@
1
1
  export * from "./maxBenefice.js";
2
2
  export * from "./minimalCost.js";
3
+ export * from "./findYearForDecreasingPopulation.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/applications/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/applications/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sCAAsC,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from "./maxBenefice.js";
2
2
  export * from "./minimalCost.js";
3
+ export * from "./findYearForDecreasingPopulation.js";
@@ -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"}
@@ -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"}
@@ -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
@@ -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
+ };
@@ -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 },
@@ -1 +1 @@
1
- {"version":3,"file":"fillTableConditionalProbabilitySituation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAGL,wBAAwB,EACzB,MAAM,iCAAiC,CAAC;AAEzC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,wBAAwB,CAAC;CAClC,CAAC;AAsOF,eAAO,MAAM,wCAAwC,EAAE,QAAQ,CAAC,WAAW,CAqB1E,CAAC"}
1
+ {"version":3,"file":"fillTableConditionalProbabilitySituation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAGL,wBAAwB,EACzB,MAAM,iCAAiC,CAAC;AAEzC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,wBAAwB,CAAC;CAClC,CAAC;AA2OF,eAAO,MAAM,wCAAwC,EAAE,QAAQ,CAAC,WAAW,CAqB1E,CAAC"}
@@ -37,7 +37,12 @@ const getAnswerTable = (identifiers) => {
37
37
  .toTex()}`,
38
38
  `${substract(1, mainEventProbaDec).simplify().toTex()}`,
39
39
  ],
40
- ["Total", `${pb.toTex()}`, `${substract(1, pb).simplify().toTex()}`, "1"],
40
+ [
41
+ "\\text{Total}",
42
+ `${pb.toTex()}`,
43
+ `${substract(1, pb).simplify().toTex()}`,
44
+ "1",
45
+ ],
41
46
  ];
42
47
  };
43
48
  const getInstruction = (identifiers) => {
@@ -199,7 +204,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
199
204
  ],
200
205
  [`$${situation.mainEvent}$`, "", "", ""],
201
206
  [`$\\overline{${situation.mainEvent}}$`, "", "", ""],
202
- ["Total", "", "", "1"],
207
+ ["\\text{Total}", "", "", "1"],
203
208
  ],
204
209
  };
205
210
  };
@@ -1 +1 @@
1
- {"version":3,"file":"marginalAndConditionalFrequency.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,QAAQ,EAYT,MAAM,sBAAsB,CAAC;AAG9B,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAmMF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAajE,CAAC"}
1
+ {"version":3,"file":"marginalAndConditionalFrequency.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,QAAQ,EAcT,MAAM,sBAAsB,CAAC;AAG9B,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAyPF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAcjE,CAAC"}