math-exercises 3.0.172 → 3.0.173

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 (172) hide show
  1. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -1
  2. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +12 -0
  3. package/lib/exercises/math/functions/trinoms/parabole/index.d.ts +2 -0
  4. package/lib/exercises/math/functions/trinoms/parabole/index.d.ts.map +1 -1
  5. package/lib/exercises/math/functions/trinoms/parabole/index.js +2 -0
  6. package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.d.ts +8 -0
  7. package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.d.ts.map +1 -0
  8. package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.js +106 -0
  9. package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.d.ts +14 -0
  10. package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.d.ts.map +1 -0
  11. package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.js +186 -0
  12. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts +6 -2
  13. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts.map +1 -1
  14. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js +98 -13
  15. package/lib/exercises/math/geometry/lines/index.d.ts +1 -0
  16. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  17. package/lib/exercises/math/geometry/lines/index.js +1 -0
  18. package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.d.ts +13 -0
  19. package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.d.ts.map +1 -0
  20. package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.js +195 -0
  21. package/lib/exercises/math/probaStat/randomVariable/index.d.ts +1 -0
  22. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  23. package/lib/exercises/math/probaStat/randomVariable/index.js +1 -0
  24. package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.d.ts +9 -0
  25. package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.d.ts.map +1 -0
  26. package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.js +119 -0
  27. package/lib/exercises/math/python/sequences/index.d.ts +8 -0
  28. package/lib/exercises/math/python/sequences/index.d.ts.map +1 -0
  29. package/lib/exercises/math/python/sequences/index.js +7 -0
  30. package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.d.ts +11 -0
  31. package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.d.ts.map +1 -0
  32. package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.js +274 -0
  33. package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.d.ts +12 -0
  34. package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.d.ts.map +1 -0
  35. package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.js +368 -0
  36. package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.d.ts +13 -0
  37. package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.d.ts.map +1 -0
  38. package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.js +254 -0
  39. package/lib/exercises/math/python/sequences/pySequenceProgramReading.d.ts +14 -0
  40. package/lib/exercises/math/python/sequences/pySequenceProgramReading.d.ts.map +1 -0
  41. package/lib/exercises/math/python/sequences/pySequenceProgramReading.js +365 -0
  42. package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.d.ts +11 -0
  43. package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.d.ts.map +1 -0
  44. package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.js +298 -0
  45. package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.d.ts +12 -0
  46. package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.d.ts.map +1 -0
  47. package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.js +408 -0
  48. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts +17 -0
  49. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts.map +1 -0
  50. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.js +498 -0
  51. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts +12 -0
  52. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map +1 -0
  53. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.js +191 -0
  54. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts +14 -0
  55. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts.map +1 -0
  56. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.js +153 -0
  57. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts +15 -0
  58. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -0
  59. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +184 -0
  60. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts +14 -0
  61. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts.map +1 -0
  62. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.js +210 -0
  63. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.d.ts +15 -0
  64. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.d.ts.map +1 -0
  65. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.js +161 -0
  66. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts +17 -0
  67. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts.map +1 -0
  68. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.js +188 -0
  69. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts +6 -0
  70. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts.map +1 -0
  71. package/lib/exercises/math/sequences/arithmetic/situations/index.js +5 -0
  72. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts +15 -0
  73. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts.map +1 -0
  74. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.js +233 -0
  75. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.d.ts +13 -0
  76. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.d.ts.map +1 -0
  77. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.js +111 -0
  78. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.d.ts +13 -0
  79. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.d.ts.map +1 -0
  80. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.js +216 -0
  81. package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.d.ts +7 -0
  82. package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.d.ts.map +1 -0
  83. package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.js +94 -0
  84. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts +5 -0
  85. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts.map +1 -0
  86. package/lib/exercises/math/sequences/arithmetic/sum/index.js +4 -0
  87. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts +14 -0
  88. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts.map +1 -0
  89. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.js +301 -0
  90. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.d.ts +15 -0
  91. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.d.ts.map +1 -0
  92. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +260 -0
  93. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts +14 -0
  94. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts.map +1 -0
  95. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.js +186 -0
  96. package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.d.ts +15 -0
  97. package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.d.ts.map +1 -0
  98. package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.js +142 -0
  99. package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.d.ts +14 -0
  100. package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.d.ts.map +1 -0
  101. package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.js +205 -0
  102. package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.d.ts +15 -0
  103. package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.d.ts.map +1 -0
  104. package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.js +208 -0
  105. package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.d.ts +17 -0
  106. package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.d.ts.map +1 -0
  107. package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.js +152 -0
  108. package/lib/exercises/math/sequences/geometric/situations/index.d.ts +4 -0
  109. package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -0
  110. package/lib/exercises/math/sequences/geometric/situations/index.js +5 -0
  111. package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.d.ts +15 -0
  112. package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.d.ts.map +1 -0
  113. package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.js +248 -0
  114. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.d.ts +14 -0
  115. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.d.ts.map +1 -0
  116. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.js +126 -0
  117. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.d.ts +8 -0
  118. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.d.ts.map +1 -0
  119. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.js +91 -0
  120. package/lib/exercises/math/sequences/geometric/sum/index.d.ts +4 -0
  121. package/lib/exercises/math/sequences/geometric/sum/index.d.ts.map +1 -0
  122. package/lib/exercises/math/sequences/geometric/sum/index.js +3 -0
  123. package/lib/exercises/math/sequences/seqArithmGeom/index.d.ts +2 -0
  124. package/lib/exercises/math/sequences/seqArithmGeom/index.d.ts.map +1 -0
  125. package/lib/exercises/math/sequences/seqArithmGeom/index.js +1 -0
  126. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts +14 -0
  127. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts.map +1 -0
  128. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.js +202 -0
  129. package/lib/exercises/options/optionFirstTermRankOne.d.ts +16 -0
  130. package/lib/exercises/options/optionFirstTermRankOne.d.ts.map +1 -0
  131. package/lib/exercises/options/optionFirstTermRankOne.js +17 -0
  132. package/lib/exercises/options/optionIsUsePythonDef.d.ts +16 -0
  133. package/lib/exercises/options/optionIsUsePythonDef.d.ts.map +1 -0
  134. package/lib/exercises/options/optionIsUsePythonDef.js +17 -0
  135. package/lib/exercises/options/optionIsWithSuperfluousData.d.ts +16 -0
  136. package/lib/exercises/options/optionIsWithSuperfluousData.d.ts.map +1 -0
  137. package/lib/exercises/options/optionIsWithSuperfluousData.js +17 -0
  138. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
  139. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
  140. package/lib/exercises/vea/colinearVectorVEA.d.ts +2 -0
  141. package/lib/exercises/vea/colinearVectorVEA.d.ts.map +1 -0
  142. package/lib/exercises/vea/colinearVectorVEA.js +11 -0
  143. package/lib/exercises/vea/varLineVEA.d.ts.map +1 -1
  144. package/lib/exercises/vea/varLineVEA.js +5 -2
  145. package/lib/index.d.ts +25 -2
  146. package/lib/index.d.ts.map +1 -1
  147. package/lib/math/geometry/line.d.ts +1 -1
  148. package/lib/math/geometry/line.d.ts.map +1 -1
  149. package/lib/math/geometry/line.js +3 -3
  150. package/lib/math/geometry/point.d.ts +1 -1
  151. package/lib/math/geometry/point.d.ts.map +1 -1
  152. package/lib/math/geometry/point.js +4 -1
  153. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts +53 -0
  154. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -0
  155. package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +1928 -0
  156. package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts +15 -0
  157. package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -0
  158. package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +136 -0
  159. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts +42 -0
  160. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -0
  161. package/lib/math/utils/sequences/situations/seqGeometricSituations.js +932 -0
  162. package/lib/math/utils/sequences/situations/seqGeometricUtils.d.ts +12 -0
  163. package/lib/math/utils/sequences/situations/seqGeometricUtils.d.ts.map +1 -0
  164. package/lib/math/utils/sequences/situations/seqGeometricUtils.js +90 -0
  165. package/lib/tests/exosTest.d.ts.map +1 -1
  166. package/lib/tests/exosTest.js +0 -2
  167. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +3 -3
  168. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -1
  169. package/lib/tree/nodes/operators/binomialCoefficientNode.js +6 -3
  170. package/lib/tree/parsers/vectorParser.d.ts.map +1 -1
  171. package/lib/tree/parsers/vectorParser.js +8 -0
  172. package/package.json +1 -1
@@ -0,0 +1,932 @@
1
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
2
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
3
+ import { randfloat } from "../../random/randfloat.js";
4
+ import { randint } from "../../random/randint.js";
5
+ import { seqGeometricUtils } from "./seqGeometricUtils.js";
6
+ const getStrFactor = (firstRank) => {
7
+ return firstRank === 0 ? "n" : "(n-1)";
8
+ };
9
+ //decoration
10
+ const createSituationGeometricFromTemplate = (templateSituationsGeometric) => {
11
+ const { variationFindExplicitFormula, variationFindRecurrenceFormula, variationFindRandomTerm,
12
+ // variationFindRank,
13
+ // variationFindThreshold,
14
+ } = templateSituationsGeometric;
15
+ return Object.assign({}, templateSituationsGeometric, {
16
+ variationFindExplicitFormula: Object.assign({}, variationFindExplicitFormula, {
17
+ getCorrectionStuff: (initial, reason, firstRank, ...otherArgs) => {
18
+ const { str: strRaw } = variationFindExplicitFormula.getCorrectionStuff(initial, reason, firstRank, ...otherArgs);
19
+ const str = `${strRaw}
20
+
21
+ $$
22
+ ${seqGeometricUtils
23
+ .getAnswerNodeExplicitFormula(initial, reason, firstRank)
24
+ .toTex()}
25
+ $$
26
+
27
+ `;
28
+ return { str };
29
+ },
30
+ }),
31
+ variationFindRecurrenceFormula: Object.assign({}, variationFindRecurrenceFormula, {
32
+ getCorrectionStuff: (initial, reason, firstRank, ...otherArgs) => {
33
+ const { str: strRaw, rank1, rank2, } = variationFindRecurrenceFormula.getCorrectionStuff(initial, reason, firstRank, ...otherArgs);
34
+ const str = `${strRaw}
35
+
36
+ $$
37
+ u_{${rank2.frenchify()}} = (${reason.frenchify()}) \\times u_{${rank1.frenchify()}}
38
+ $$
39
+
40
+ La relation de récurrence est, pour $n \\geq ${firstRank.frenchify()}$ :
41
+
42
+ $$
43
+ ${seqGeometricUtils
44
+ .getAnswerNodeRecurrenceFormula(initial, reason, firstRank)
45
+ .toTex()}
46
+ $$
47
+
48
+ `;
49
+ return { str, rank1, rank2 };
50
+ },
51
+ }),
52
+ variationFindRandomTerm: Object.assign({}, variationFindRandomTerm, {
53
+ getCorrectionStuff: (initial, reason, firstRank, ...otherArgs) => {
54
+ const [rankAsked] = otherArgs;
55
+ const { str: strRaw } = variationFindRandomTerm.getCorrectionStuff(initial, reason, firstRank, ...otherArgs);
56
+ const answerNode = variationFindRandomTerm.getAnswerNode(initial, reason, firstRank, ...otherArgs);
57
+ const str = `${strRaw}
58
+
59
+ Le terme général est :
60
+
61
+ $$
62
+ ${seqGeometricUtils
63
+ .getAnswerNodeExplicitFormula(initial, reason, firstRank)
64
+ .toTex()}
65
+ $$
66
+
67
+ En particulier :
68
+
69
+ ${alignTex([
70
+ [`u_{${rankAsked}}`, "=", answerNode.toTex()],
71
+ ["", "=", answerNode.simplify().toTex()],
72
+ ])}
73
+
74
+ `;
75
+ return { str };
76
+ },
77
+ }),
78
+ });
79
+ };
80
+ //raw material
81
+ const templatesSituationsGeometric = [
82
+ //Armand
83
+ {
84
+ type: "evoPercentage",
85
+ randInitial: () => randint(20, 51) * 100,
86
+ randReason: () => 1 + randfloat(0, 4, 2, [0]) / 100, //expl: 1,0331
87
+ randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
88
+ randSuperfluousData: () => {
89
+ const rand = randint(0, 2);
90
+ const values = [];
91
+ switch (rand) {
92
+ case 0:
93
+ {
94
+ const mockeponCardsPrice = 10 * randint(50, 150);
95
+ values.push(mockeponCardsPrice);
96
+ }
97
+ break;
98
+ case 1:
99
+ {
100
+ const factorFriendWrtArmand = randint(2, 6);
101
+ values.push(factorFriendWrtArmand);
102
+ }
103
+ break;
104
+ }
105
+ return {
106
+ rand,
107
+ values,
108
+ };
109
+ },
110
+ getStrSituation: (initial, reason, firstRank, superfluousData) => {
111
+ const evoPercentage = (reason - 1) * 100;
112
+ const strEvoPercentage = evoPercentage.frPretty(2);
113
+ if (superfluousData === undefined) {
114
+ return `Au premier janvier $2026$, Armand dépose $${initial.frenchify()} \\textrm{€}$ sur un compte épargne rémunéré au taux de $${strEvoPercentage}\\%$.
115
+ On note $u_n$ le capital disponible sur son compte épargne au premier janvier de l'année $2026+${substract("n".toTree(), firstRank)
116
+ .simplify()
117
+ .toTex()}$.`;
118
+ }
119
+ else {
120
+ switch (superfluousData.rand) {
121
+ case 0:
122
+ {
123
+ const [mockeponCardsPrice] = superfluousData.values;
124
+ return `Au premier janvier $2026$, Armand dépose $${initial.frenchify()} \\textrm{€}$ sur un compte épargne rémunéré au taux de $${strEvoPercentage}\\%$.
125
+ La même journée, il a acheté pour $${mockeponCardsPrice} \\textrm{€}$ de cartes MockéPon.
126
+ On note $u_n$ le capital disponible sur son compte épargne au premier janvier de l'année $2026+${substract("n".toTree(), firstRank)
127
+ .simplify()
128
+ .toTex()}$.`;
129
+ }
130
+ break;
131
+ case 1:
132
+ {
133
+ const [factorFriendWrtArmand] = superfluousData.values;
134
+ return `Au premier janvier $2026$, Armand dépose $${initial.frenchify()} \\textrm{€}$ sur un compte épargne rémunéré au taux de $${strEvoPercentage}\\%$.
135
+ La même journée, son ami Mustapha lui apprend que la rémunération du compte épargne de son père est $${factorFriendWrtArmand.frenchify()}$ fois plus grande.
136
+ On note $u_n$ le capital disponible sur son compte épargne au premier janvier de l'année $2026+${substract("n".toTree(), firstRank)
137
+ .simplify()
138
+ .toTex()}$.`;
139
+ }
140
+ break;
141
+ default:
142
+ throw new Error("Unsupported superfluousData.rand: " + superfluousData.rand);
143
+ }
144
+ }
145
+ },
146
+ variationFindExplicitFormula: {
147
+ getAnswerNode: seqGeometricUtils.getAnswerNodeExplicitFormula,
148
+ getHint: (firstRank) => `Quel calcul permet de trouver le capital au bout de $2$ ans ?
149
+
150
+ Inspire toi de ce calcul pour déterminer le capital au bout de $${getStrFactor(firstRank)}$ ans.`,
151
+ getCorrectionStuff: (initial, reason, firstRank) => {
152
+ const evoPercentage = (reason - 1) * 100;
153
+ const strEvoPercentage = evoPercentage.frPretty(2);
154
+ return {
155
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque année, le capital est multiplié par $${reason.frenchify()}$.
156
+ Le capital en $\\textrm{€}$, au premier janvier de l'année $2026+${substract("n".toTree(), firstRank)
157
+ .simplify()
158
+ .toTex()}$, est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
159
+ };
160
+ },
161
+ },
162
+ variationFindRecurrenceFormula: {
163
+ getAnswerNode: seqGeometricUtils.getAnswerNodeRecurrenceFormula,
164
+ getHint: (_firstRank) => `Si tu connais le capital à la dixième année, comment fais-tu pour calculer le capital à la onzième année ?
165
+
166
+ Déduis-en comment calculer $u_{n+1}$ à partir de $u_n$.`,
167
+ getCorrectionStuff: (_initial, reason, firstRank) => {
168
+ const target1 = 10;
169
+ const target2 = 11;
170
+ const [rank1, rank2] = [target1, target2].map((target) => target + firstRank);
171
+ const evoPercentage = (reason - 1) * 100;
172
+ const strEvoPercentage = evoPercentage.frPretty(2);
173
+ return {
174
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque année, le capital est multiplié par $${reason.frenchify()}$.
175
+ Par exemple, le capital à la onzième année est égal à celui de la dixième année multiplié par $${reason.frenchify()}$.`,
176
+ rank1,
177
+ rank2,
178
+ };
179
+ },
180
+ },
181
+ variationFindRandomTerm: {
182
+ getAnswerNode: (initial, reason, firstRank, ...otherArgs) => {
183
+ const [rankAsked] = otherArgs;
184
+ return seqGeometricUtils.getAnswerNodeRandomTerm(initial, reason, firstRank, rankAsked);
185
+ },
186
+ getHint: (firstRank, ...otherArgs) => {
187
+ const [rankAsked] = otherArgs;
188
+ const target = rankAsked - firstRank;
189
+ return `Quelle est la nature de la suite $u_n$ ?
190
+
191
+ Utilise le terme général de $u_n$ pour déterminer le capital pour l'année $2026+${target.frenchify()}$.`;
192
+ },
193
+ getCorrectionStuff: (initial, reason, firstRank) => {
194
+ const evoPercentage = (reason - 1) * 100;
195
+ const strEvoPercentage = evoPercentage.frPretty(2);
196
+ return {
197
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque année, le capital est multiplié par $${reason.frenchify()}$.
198
+ Le capital en $\\textrm{€}$, au premier janvier de l'année $2026+${substract("n".toTree(), firstRank)
199
+ .simplify()
200
+ .toTex()}$, est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
201
+ };
202
+ },
203
+ },
204
+ },
205
+ //Killian
206
+ {
207
+ type: "evoPercentage",
208
+ randInitial: () => randint(13, 30) * 1000,
209
+ randReason: () => 1 - (randint(10, 26, [0]) * 1.0) / 100, //expl: 0,80
210
+ randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
211
+ randSuperfluousData: () => {
212
+ const rand = randint(0, 2);
213
+ const values = [];
214
+ switch (rand) {
215
+ case 0:
216
+ {
217
+ const equipmentPercentage = randint(5, 25);
218
+ values.push(equipmentPercentage);
219
+ }
220
+ break;
221
+ case 1:
222
+ {
223
+ const friendsCarPrice = randint(25, 50) * 1000;
224
+ values.push(friendsCarPrice);
225
+ }
226
+ break;
227
+ }
228
+ return {
229
+ rand,
230
+ values,
231
+ };
232
+ },
233
+ getStrSituation: (initial, reason, firstRank, superfluousData) => {
234
+ const evoPercentage = (reason - 1) * 100;
235
+ const strMinusEvoPercentage = (-evoPercentage).frPretty(0);
236
+ if (superfluousData === undefined) {
237
+ return `Au premier juillet $2025$, Killian a acheté une voiture au prix de $${initial.frenchify()} \\ \\textrm{€}$.
238
+ On estime que la valeur d'une voiture diminue de $${strMinusEvoPercentage}\\%$ par an.
239
+ Pour tout entier naturel $n>=${firstRank}$, on note $u_n$ la valeur estimée de la voiture de Killian au premier juillet de l'année $2025 + ${substract("n".toTree(), firstRank)
240
+ .simplify()
241
+ .toTex()}$.`;
242
+ }
243
+ else {
244
+ switch (superfluousData.rand) {
245
+ case 0:
246
+ {
247
+ const [equipmentPercentage] = superfluousData.values;
248
+ return `Au premier juillet $2025$, Killian a acheté une voiture au prix de $${initial.frenchify()} \\ \\textrm{€}$.
249
+ Les options représentent $${equipmentPercentage.frenchify()}\\%$ de la valeur du véhicule.
250
+ On estime que la valeur d'une voiture diminue de $${strMinusEvoPercentage}\\%$ par an.
251
+ Pour tout entier naturel $n>=${firstRank}$, on note $u_n$ la valeur estimée de la voiture de Killian au premier juillet de l'année $2025 + ${substract("n".toTree(), firstRank)
252
+ .simplify()
253
+ .toTex()}$.`;
254
+ }
255
+ break;
256
+ case 1:
257
+ {
258
+ const [friendsCarPrice] = superfluousData.values;
259
+ return `Au premier juillet $2025$, Nahel a acheté une voiture au prix de $${friendsCarPrice.frenchify()} \\ \\textrm{€}$.
260
+ Le même jour, Killian a acheté une voiture au prix de $${initial.frenchify()} \\ \\textrm{€}$.
261
+ On estime que la valeur d'une voiture diminue de $${strMinusEvoPercentage}\\%$ par an.
262
+ Pour tout entier naturel $n>=${firstRank}$, on note $u_n$ la valeur estimée de la voiture de Killian au premier juillet de l'année $2025 + ${substract("n".toTree(), firstRank)
263
+ .simplify()
264
+ .toTex()}$.`;
265
+ }
266
+ break;
267
+ default:
268
+ throw new Error("Unsupported superfluousData.rand: " + superfluousData.rand);
269
+ }
270
+ }
271
+ },
272
+ variationFindExplicitFormula: {
273
+ getAnswerNode: seqGeometricUtils.getAnswerNodeExplicitFormula,
274
+ getHint: (firstRank) => `Quel calcul permet de trouver la valeur de la voiture de Killian au bout de $2$ ans ?
275
+
276
+ Inspire toi de ce calcul pour déterminer la valeur de la voiture de Killian au bout de $${getStrFactor(firstRank)}$ ans.`,
277
+ getCorrectionStuff: (initial, reason, _firstRank) => {
278
+ const evoPercentage = (reason - 1) * 100;
279
+ const strEvoPercentage = evoPercentage.frPretty(0);
280
+ return {
281
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque année, la valeur de la voiture de Killian est multipliée par $${reason.frenchify()}$.
282
+ La valeur de la voiture de Killian en $\\textrm{€}$, au premier juillet de l'année $2026+n$, est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
283
+ };
284
+ },
285
+ },
286
+ variationFindRecurrenceFormula: {
287
+ getAnswerNode: seqGeometricUtils.getAnswerNodeRecurrenceFormula,
288
+ getHint: (_firstRank) => `Si tu connais la valeur de la voiture de Killian à la dixième année, comment fais-tu pour calculer la valeur de la voiture de Killian à la onzième année ?
289
+
290
+ Déduis-en comment calculer $u_{n+1}$ à partir de $u_n$.`,
291
+ getCorrectionStuff: (_initial, reason, firstRank) => {
292
+ const target1 = 10;
293
+ const target2 = 11;
294
+ const [rank1, rank2] = [target1, target2].map((target) => target + firstRank);
295
+ const evoPercentage = (reason - 1) * 100;
296
+ const strEvoPercentage = evoPercentage.frPretty(0);
297
+ return {
298
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque année, la valeur de la voiture de Killian est multipliée par $${reason.frenchify()}$.
299
+ Par exemple, la valeur à la onzième année est égale à celle de la dixième année multipliée par $${reason.frenchify()}$.`,
300
+ rank1,
301
+ rank2,
302
+ };
303
+ },
304
+ },
305
+ variationFindRandomTerm: {
306
+ getAnswerNode: (initial, reason, firstRank, ...otherArgs) => {
307
+ const [rankAsked] = otherArgs;
308
+ return seqGeometricUtils.getAnswerNodeRandomTerm(initial, reason, firstRank, rankAsked);
309
+ },
310
+ getHint: (firstRank, ...otherArgs) => {
311
+ const [rankAsked] = otherArgs;
312
+ const target = rankAsked - firstRank;
313
+ return `Quelle est la nature de la suite $u_n$ ?
314
+
315
+ Utilise le terme général de $u_n$ pour déterminer la valeur de la voiture de Killian au premier juillet de l'année $2025+${target.frenchify()}$.`;
316
+ },
317
+ getCorrectionStuff: (initial, reason, _firstRank) => {
318
+ const evoPercentage = (reason - 1) * 100;
319
+ const strEvoPercentage = evoPercentage.frPretty(0);
320
+ return {
321
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque année, la valeur de la voiture de Killian est multipliée par $${reason.frenchify()}$.
322
+ La valeur de la voiture de Killian en $\\textrm{€}$, au premier juillet de l'année $2026+n$, est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
323
+ };
324
+ },
325
+ },
326
+ },
327
+ //Balle rebondissante
328
+ {
329
+ type: "factorPercentage",
330
+ randInitial: () => randfloat(1, 2, 2),
331
+ randReason: () => 1 - (randint(10, 26, [0]) * 1.0) / 100, //expl: 0,80
332
+ randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
333
+ randSuperfluousData: () => {
334
+ const rand = randint(0, 2);
335
+ const values = [];
336
+ switch (rand) {
337
+ case 0:
338
+ {
339
+ const phoneHeight = randfloat(0.1, 1, 2);
340
+ values.push(phoneHeight);
341
+ }
342
+ break;
343
+ case 1:
344
+ {
345
+ const diameterOfBallInCm = randint(4, 12);
346
+ values.push(diameterOfBallInCm);
347
+ }
348
+ break;
349
+ }
350
+ return {
351
+ rand,
352
+ values,
353
+ };
354
+ },
355
+ getStrSituation: (initial, reason, firstRank, superfluousData) => {
356
+ const factorPercentage = reason * 100;
357
+ const strFactorPercentage = factorPercentage.frPretty(0);
358
+ if (superfluousData === undefined) {
359
+ return `Une balle rebondissante est lachée d'une hauteur de $${initial.frenchify()} \\ \\textrm{m}$.
360
+ À chaque rebond, elle atteint une hauteur égale à $${strFactorPercentage} \\%$ de la hauteur du rebond précédent.
361
+ On note $u_{${firstRank}} = ${initial.frenchify()}$, et pour tout entier $n>=${firstRank + 1}$, $u_{n}$ la hauteur de la balle au $${substract("n".toTree(), firstRank)
362
+ .simplify()
363
+ .toTex()}$-ième rebond.`;
364
+ }
365
+ else {
366
+ switch (superfluousData.rand) {
367
+ case 0:
368
+ {
369
+ const [phoneHeight] = superfluousData.values;
370
+ return `Une balle rebondissante est lachée d'une hauteur de $${initial.frenchify()} \\ \\textrm{m}$.
371
+ On la filme avec un téléphone placé à une hauteur de $${phoneHeight.frenchify()} \\ \\textrm{m}$.
372
+ À chaque rebond, elle atteint une hauteur égale à $${strFactorPercentage} \\%$ de la hauteur du rebond précédent.
373
+ On note $u_{${firstRank}} = ${initial.frenchify()}$, et pour tout entier $n>=${firstRank + 1}$, $u_{n}$ la hauteur de la balle au $${substract("n".toTree(), firstRank)
374
+ .simplify()
375
+ .toTex()}$-ième rebond.`;
376
+ }
377
+ break;
378
+ case 1:
379
+ {
380
+ const [diameterOfBallInCm] = superfluousData.values;
381
+ return `Une balle rebondissante de diamètre $${diameterOfBallInCm.frenchify()} \\ \\textrm{cm}$ est lachée d'une hauteur de $${initial.frenchify()} \\ \\textrm{m}$.
382
+ À chaque rebond, elle atteint une hauteur égale à $${strFactorPercentage} \\%$ de la hauteur du rebond précédent.
383
+ On note $u_{${firstRank}} = ${initial.frenchify()}$, et pour tout entier $n>=${firstRank + 1}$, $u_{n}$ la hauteur de la balle au $${substract("n".toTree(), firstRank)
384
+ .simplify()
385
+ .toTex()}$-ième rebond.`;
386
+ }
387
+ break;
388
+ default:
389
+ throw new Error("Unsupported superfluousData.rand: " + superfluousData.rand);
390
+ }
391
+ }
392
+ },
393
+ variationFindExplicitFormula: {
394
+ getAnswerNode: seqGeometricUtils.getAnswerNodeExplicitFormula,
395
+ getHint: (firstRank) => `Quel calcul permet de trouver la hauteur de la balle après $2$ rebonds ?
396
+
397
+ Inspire toi de ce calcul pour déterminer la hauteur de la balle au $${substract("n".toTree(), firstRank)
398
+ .simplify()
399
+ .toTex()}$-ième rebond.`,
400
+ getCorrectionStuff: (initial, reason, _firstRank) => {
401
+ const factorPercentage = reason * 100;
402
+ const strFactorPercentage = factorPercentage.frPretty(0);
403
+ return {
404
+ str: `Le coefficient multiplicateur est $${strFactorPercentage} \\%$ donc à chaque rebond, la hauteur de la balle est multipliée par $${reason.frenchify()}$.
405
+ La hauteur de la balle est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
406
+ };
407
+ },
408
+ },
409
+ variationFindRecurrenceFormula: {
410
+ getAnswerNode: seqGeometricUtils.getAnswerNodeRecurrenceFormula,
411
+ getHint: (_firstRank) => `Si tu connais la hauteur après le dixième rebond, comment fais-tu pour calculer la hauteur après le onzième rebond ?
412
+
413
+ Déduis-en comment calculer $u_{n+1}$ à partir de $u_n$.`,
414
+ getCorrectionStuff: (_initial, reason, firstRank) => {
415
+ const target1 = 10;
416
+ const target2 = 11;
417
+ const [rank1, rank2] = [target1, target2].map((target) => target + firstRank);
418
+ const factorPercentage = reason * 100;
419
+ const strFactorPercentage = factorPercentage.frPretty(0);
420
+ return {
421
+ str: `Le coefficient multiplicateur est $${strFactorPercentage} \\%$ donc à chaque rebond, la hauteur de la balle est multipliée par $${reason.frenchify()}$.
422
+ Par exemple, la hauteur après le onzième rebond est égale à celle après le dixième rebond multipliée par $${reason.frenchify()}$.`,
423
+ rank1,
424
+ rank2,
425
+ };
426
+ },
427
+ },
428
+ variationFindRandomTerm: {
429
+ getAnswerNode: (initial, reason, firstRank, ...otherArgs) => {
430
+ const [rankAsked] = otherArgs;
431
+ return seqGeometricUtils.getAnswerNodeRandomTerm(initial, reason, firstRank, rankAsked);
432
+ },
433
+ getHint: (firstRank, ...otherArgs) => {
434
+ const [rankAsked] = otherArgs;
435
+ const target = rankAsked - firstRank;
436
+ return `Quelle est la nature de la suite $u_n$ ?
437
+
438
+ Utilise le terme général de $u_n$ pour déterminer la hauteur de la balle au $${target}$-ième rebond.`;
439
+ },
440
+ getCorrectionStuff: (initial, reason, _firstRank) => {
441
+ const factorPercentage = reason * 100;
442
+ const strFactorPercentage = factorPercentage.frPretty(0);
443
+ return {
444
+ str: `Le coefficient multiplicateur est $${strFactorPercentage} \\%$ donc à chaque rebond, la hauteur de la balle est multipliée par $${reason.frenchify()}$.
445
+ La hauteur de la balle est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
446
+ };
447
+ },
448
+ },
449
+ },
450
+ //Bactéries
451
+ {
452
+ type: "evoPercentage",
453
+ randInitial: () => randint(50, 101) * 100,
454
+ randReason: () => 1 + (randint(10, 40) * 1.0) / 100, //expl: 1,25
455
+ randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
456
+ randSuperfluousData: () => {
457
+ const rand = randint(0, 2);
458
+ const values = [];
459
+ switch (rand) {
460
+ case 0:
461
+ {
462
+ const percentageMutantBacteria = randint(10, 60);
463
+ values.push(percentageMutantBacteria);
464
+ }
465
+ break;
466
+ case 1:
467
+ {
468
+ const lightIntervalInMin = randint(15, 60);
469
+ values.push(lightIntervalInMin);
470
+ }
471
+ break;
472
+ }
473
+ return {
474
+ rand,
475
+ values,
476
+ };
477
+ },
478
+ getStrSituation: (initial, reason, firstRank, superfluousData) => {
479
+ const evoPercentage = (reason - 1) * 100;
480
+ const strEvoPercentage = evoPercentage.frPretty(0);
481
+ if (superfluousData === undefined) {
482
+ return `Un biologiste étudie une population de bactéries.
483
+ La première heure, la population compte $${initial.frenchify()}$ individus.
484
+ Chaque heure, le nombre de bactéries augmente de $${strEvoPercentage}\\%$.
485
+ Pour tout entier naturel $n$, on note $u_n$ le nombre de bactéries au bout de $${getStrFactor(firstRank)}$ heures.`;
486
+ }
487
+ else {
488
+ switch (superfluousData.rand) {
489
+ case 0:
490
+ {
491
+ const [percentageMutantBacteria] = superfluousData.values;
492
+ return `Un biologiste étudie une population de bactéries.
493
+ La première heure, la population compte $${initial.frenchify()}$ individus, dont $${percentageMutantBacteria}\\%$ sont mutantes.
494
+ Chaque heure, le nombre de bactéries augmente de $${strEvoPercentage}\\%$.
495
+ Pour tout entier naturel $n$, on note $u_n$ le nombre de bactéries au bout de $${getStrFactor(firstRank)}$ heures.`;
496
+ }
497
+ break;
498
+ case 1:
499
+ {
500
+ const [lightIntervalInMin] = superfluousData.values;
501
+ return `Un biologiste étudie une population de bactéries.
502
+ La première heure, la population compte $${initial.frenchify()}$ individus.
503
+ Chaque heure, le nombre de bactéries augmente de $${strEvoPercentage}\\%$.
504
+ On éclaire les bactéries toutes les $${lightIntervalInMin} \\ \\textrm{min}$ pendant $30 \\ \\textrm{s}$.
505
+ Pour tout entier naturel $n>=${firstRank}$, on note $u_n$ le nombre de bactéries au bout de $${getStrFactor(firstRank)}$ heures.`;
506
+ }
507
+ break;
508
+ default:
509
+ throw new Error("Unsupported superfluousData.rand: " + superfluousData.rand);
510
+ }
511
+ }
512
+ },
513
+ variationFindExplicitFormula: {
514
+ getAnswerNode: seqGeometricUtils.getAnswerNodeExplicitFormula,
515
+ getHint: (firstRank) => `Quel calcul permet de trouver le nombre de bactéries au bout de $2$ heures ?
516
+
517
+ Inspire toi de ce calcul pour déterminer le nombre de bactéries au bout de $${getStrFactor(firstRank)}$ heures.`,
518
+ getCorrectionStuff: (initial, reason, _firstRank) => {
519
+ const evoPercentage = (reason - 1) * 100;
520
+ const strEvoPercentage = evoPercentage.frPretty(0);
521
+ return {
522
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque heure, le nombre de bactéries est multiplié par $${reason.frenchify()}$.
523
+ Le nombre de bactéries est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
524
+ };
525
+ },
526
+ },
527
+ variationFindRecurrenceFormula: {
528
+ getAnswerNode: seqGeometricUtils.getAnswerNodeRecurrenceFormula,
529
+ getHint: (_firstRank) => `Si tu connais le nombre de bactéries après $10$ heures, comment fais-tu pour calculer le nombre de bactéries après $11$ heures ?
530
+
531
+ Déduis-en comment calculer $u_{n+1}$ à partir de $u_n$.`,
532
+ getCorrectionStuff: (_initial, reason, firstRank) => {
533
+ const target1 = 10;
534
+ const target2 = 11;
535
+ const [rank1, rank2] = [target1, target2].map((target) => target + firstRank);
536
+ const evoPercentage = (reason - 1) * 100;
537
+ const strEvoPercentage = evoPercentage.frPretty(2);
538
+ return {
539
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque heure, le nombre de bactéries est multiplié par $${reason.frenchify()}$.
540
+ Par exemple, le nombre de bactéries après $10$ heures est égal à celui de la dixième année multiplié par $${reason.frenchify()}$.`,
541
+ rank1,
542
+ rank2,
543
+ };
544
+ },
545
+ },
546
+ variationFindRandomTerm: {
547
+ getAnswerNode: (initial, reason, firstRank, ...otherArgs) => {
548
+ const [rankAsked] = otherArgs;
549
+ return seqGeometricUtils.getAnswerNodeRandomTerm(initial, reason, firstRank, rankAsked);
550
+ },
551
+ getHint: (firstRank, ...otherArgs) => {
552
+ const [rankAsked] = otherArgs;
553
+ const target = rankAsked - firstRank;
554
+ return `Quelle est la nature de la suite $u_n$ ?
555
+
556
+ Utilise le terme général de $u_n$ pour déterminer le nombre de bactéries après $${target.frenchify()}$ heures.`;
557
+ },
558
+ getCorrectionStuff: (initial, reason, _firstRank) => {
559
+ const evoPercentage = (reason - 1) * 100;
560
+ const strEvoPercentage = evoPercentage.frPretty(0);
561
+ return {
562
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque heure, le nombre de bactéries est multiplié par $${reason.frenchify()}$.
563
+ Le nombre de bactéries est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
564
+ };
565
+ },
566
+ },
567
+ },
568
+ //Secret
569
+ {
570
+ type: "factor",
571
+ randInitial: () => randint(2, 8),
572
+ randReason: () => randint(2, 8),
573
+ randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
574
+ randSuperfluousData: () => {
575
+ const rand = randint(0, 2);
576
+ const values = [];
577
+ switch (rand) {
578
+ case 0:
579
+ {
580
+ const numberOfFriends = randint(10, 20);
581
+ values.push(numberOfFriends);
582
+ }
583
+ break;
584
+ case 1:
585
+ {
586
+ const numberOfUnreliable = randint(2, 5);
587
+ values.push(numberOfUnreliable);
588
+ }
589
+ break;
590
+ }
591
+ return {
592
+ rand,
593
+ values,
594
+ };
595
+ },
596
+ getStrSituation: (initial, reason, firstRank, superfluousData) => {
597
+ if (superfluousData === undefined) {
598
+ return `Justine dévoile un secret à $${initial}$ de ses amies.
599
+ On estime que chaque jour, chaque personne connaissant le secret le révèle à $${reason}$ nouvelles personnes qui ne connaissent pas encore le secret.
600
+ Pour tout entier naturel $n>=${firstRank}$, on note $u_n$ le nombre de nouvelles personnes qui sont informées le jour $${substract("n".toTree(), firstRank)
601
+ .simplify()
602
+ .toTex()}$.`;
603
+ }
604
+ else {
605
+ switch (superfluousData.rand) {
606
+ case 0:
607
+ {
608
+ const [numberOfFriends] = superfluousData.values;
609
+ return `Justine a $${numberOfFriends}$ amies.
610
+ Justine dévoile un secret à $${initial}$ de ses amies.
611
+ On estime que chaque jour, chaque personne connaissant le secret le révèle à $${reason}$ nouvelles personnes qui ne connaissent pas encore le secret.
612
+ Pour tout entier naturel $n>=${firstRank}$, on note $u_n$ le nombre de nouvelles personnes qui sont informées le jour $${substract("n".toTree(), firstRank)
613
+ .simplify()
614
+ .toTex()}$.`;
615
+ }
616
+ break;
617
+ case 1:
618
+ {
619
+ const [numberOfUnreliable] = superfluousData.values;
620
+ return `Justine dévoile un secret à $${initial}$ de ses amies.
621
+ Elle ne le dévoile pas aux $${numberOfUnreliable}$ autres car elle ne leur fait pas trop confiance.
622
+ On estime que chaque jour, chaque personne connaissant le secret le révèle à $${reason}$ nouvelles personnes qui ne connaissent pas encore le secret.
623
+ Pour tout entier naturel $n>=${firstRank}$, on note $u_n$ le nombre de nouvelles personnes qui sont informées le jour $${substract("n".toTree(), firstRank)
624
+ .simplify()
625
+ .toTex()}$.`;
626
+ }
627
+ break;
628
+ default:
629
+ throw new Error("Unsupported superfluousData.rand: " + superfluousData.rand);
630
+ }
631
+ }
632
+ },
633
+ variationFindExplicitFormula: {
634
+ getAnswerNode: seqGeometricUtils.getAnswerNodeExplicitFormula,
635
+ getHint: (firstRank) => `Quel calcul permet de trouver le nombre de personnes informées le jour $2$ ?
636
+
637
+ Inspire toi de ce calcul pour déterminer le nombre de personnes informées le jour $${substract("n".toTree(), firstRank)
638
+ .simplify()
639
+ .toTex()}$.`,
640
+ getCorrectionStuff: (initial, reason, _firstRank) => {
641
+ return {
642
+ str: `Le coefficient multiplicateur est $${reason}$ donc, chaque jour, le nombre de personnes informées est multiplié par $${reason.frenchify()}$.
643
+ Le nombre de personnes informées est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
644
+ };
645
+ },
646
+ },
647
+ variationFindRecurrenceFormula: {
648
+ getAnswerNode: seqGeometricUtils.getAnswerNodeRecurrenceFormula,
649
+ getHint: (_firstRank) => `Si tu connais le nombre de personnes informées le jour $10$ , comment fais-tu pour calculer le nombre de personnes informées le jour $11$ ?
650
+
651
+ Déduis-en comment calculer $u_{n+1}$ à partir de $u_n$.`,
652
+ getCorrectionStuff: (_initial, reason, firstRank) => {
653
+ const target1 = 10;
654
+ const target2 = 11;
655
+ const [rank1, rank2] = [target1, target2].map((target) => target + firstRank);
656
+ return {
657
+ str: `Le coefficient multiplicateur est $${reason}$ donc, chaque jour, le nombre de personnes informées est multiplié par $${reason.frenchify()}$.
658
+ Par exemple, le nombre de personnes informées le jour $11$ est égal à celui du jour $10$ multiplié par $${reason.frenchify()}$.`,
659
+ rank1,
660
+ rank2,
661
+ };
662
+ },
663
+ },
664
+ variationFindRandomTerm: {
665
+ getAnswerNode: (initial, reason, firstRank, ...otherArgs) => {
666
+ const [rankAsked] = otherArgs;
667
+ return seqGeometricUtils.getAnswerNodeRandomTerm(initial, reason, firstRank, rankAsked);
668
+ },
669
+ getHint: (firstRank, ...otherArgs) => {
670
+ const [rankAsked] = otherArgs;
671
+ const target = rankAsked - firstRank;
672
+ return `Quelle est la nature de la suite $u_n$ ?
673
+
674
+ Utilise le terme général de $u_n$ pour déterminer le nombre de personnes informées le jour $${target}$.`;
675
+ },
676
+ getCorrectionStuff: (initial, reason, _firstRank) => {
677
+ return {
678
+ str: `Le coefficient multiplicateur est $${reason}$ donc, chaque jour, le nombre de personnes informées est multiplié par $${reason.frenchify()}$.
679
+ Le nombre de personnes informées est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
680
+ };
681
+ },
682
+ },
683
+ },
684
+ //salaire de Sofiane
685
+ {
686
+ type: "evoPercentage",
687
+ randInitial: () => randint(28, 44) * 1000,
688
+ randReason: () => 1 + randint(2, 7) / 100, //expl: 1,05
689
+ randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
690
+ randSuperfluousData: () => {
691
+ const rand = randint(0, 2);
692
+ const values = [];
693
+ switch (rand) {
694
+ case 0:
695
+ {
696
+ const offsetSalaryOfFriend = randint(1, 10) * 1000;
697
+ values.push(offsetSalaryOfFriend);
698
+ }
699
+ break;
700
+ case 1:
701
+ {
702
+ const offsetEvoPercentageOfFriend = -1;
703
+ values.push(offsetEvoPercentageOfFriend);
704
+ }
705
+ break;
706
+ }
707
+ return {
708
+ rand,
709
+ values,
710
+ };
711
+ },
712
+ getStrSituation: (initial, reason, firstRank, superfluousData) => {
713
+ const evoPercentage = (reason - 1) * 100;
714
+ const strEvoPercentage = evoPercentage.frPretty(0);
715
+ if (superfluousData === undefined) {
716
+ return `Durant l'année $2025$, Sofiane a reçu un salaire de $${initial} \\ \\textrm{€}$.
717
+ Son contrat prévoit une augmentation annuelle de $${strEvoPercentage}\\%$.
718
+ On note $u_n$ le salaire perçu par Sofiane au cours de l'année $2025+${substract("n".toTree(), firstRank)
719
+ .simplify()
720
+ .toTex()}$.`;
721
+ }
722
+ else {
723
+ switch (superfluousData.rand) {
724
+ case 0:
725
+ {
726
+ const [offsetSalaryOfFriend] = superfluousData.values;
727
+ const salaryOfFriend = initial + offsetSalaryOfFriend;
728
+ return `Durant l'année $2025$, Sofiane a reçu un salaire de $${initial} \\ \\textrm{€}$.
729
+ Son contrat prévoit une augmentation annuelle de $${strEvoPercentage}\\%$.
730
+ Son ami Hector a reçu un salaire de $${salaryOfFriend} \\ \\textrm{€}$ en $2025$.
731
+ On note $u_n$ le salaire perçu par Sofiane au cours de l'année $2025+${substract("n".toTree(), firstRank)
732
+ .simplify()
733
+ .toTex()}$.`;
734
+ }
735
+ break;
736
+ case 1:
737
+ {
738
+ const [offsetEvoPercentageOfFriend] = superfluousData.values;
739
+ const evoPercentageOfFriend = evoPercentage + offsetEvoPercentageOfFriend;
740
+ const strEvoPercentageOfFriend = evoPercentageOfFriend.frPretty(0);
741
+ return `Durant l'année $2025$, Sofiane a reçu un salaire de $${initial} \\ \\textrm{€}$.
742
+ Son contrat prévoit une augmentation annuelle de $${strEvoPercentage}\\%$.
743
+ Le contrat de son ami Hector prévoit pour Hector une augmentation annuelle de $${strEvoPercentageOfFriend}\\%$.
744
+ On note $u_n$ le salaire perçu par Sofiane au cours de l'année $2025+${substract("n".toTree(), firstRank)
745
+ .simplify()
746
+ .toTex()}$.`;
747
+ }
748
+ break;
749
+ default:
750
+ throw new Error("Unsupported superfluousData.rand: " + superfluousData.rand);
751
+ }
752
+ }
753
+ },
754
+ variationFindExplicitFormula: {
755
+ getAnswerNode: seqGeometricUtils.getAnswerNodeExplicitFormula,
756
+ getHint: (firstRank) => `Quel calcul permet de trouver le salaire pour l'année $2027$ ?
757
+
758
+ Inspire toi de ce calcul pour déterminer le salaire pour l'année $2025+${substract("n".toTree(), firstRank)
759
+ .simplify()
760
+ .toTex()}$.`,
761
+ getCorrectionStuff: (initial, reason, firstRank) => {
762
+ const evoPercentage = (reason - 1) * 100;
763
+ const strEvoPercentage = evoPercentage.frPretty(2);
764
+ return {
765
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque année, le salaire est multiplié par $${reason.frenchify()}$.
766
+ Le salaire en $\\textrm{€}$ pour l'année $2025+${substract("n".toTree(), firstRank)
767
+ .simplify()
768
+ .toTex()}$, est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
769
+ };
770
+ },
771
+ },
772
+ variationFindRecurrenceFormula: {
773
+ getAnswerNode: seqGeometricUtils.getAnswerNodeRecurrenceFormula,
774
+ getHint: (_firstRank) => `Si tu connais le salaire pour la dixième année, comment fais-tu pour calculer le salaire pour la onzième année ?
775
+
776
+ Déduis-en comment calculer $u_{n+1}$ à partir de $u_n$.`,
777
+ getCorrectionStuff: (_initial, reason, firstRank) => {
778
+ const target1 = 10;
779
+ const target2 = 11;
780
+ const [rank1, rank2] = [target1, target2].map((target) => target + firstRank);
781
+ const evoPercentage = (reason - 1) * 100;
782
+ const strEvoPercentage = evoPercentage.frPretty(2);
783
+ return {
784
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque année, le salaire est multiplié par $${reason.frenchify()}$.
785
+ Par exemple, le salaire à la onzième année est égal à celui de la dixième année multiplié par $${reason.frenchify()}$.`,
786
+ rank1,
787
+ rank2,
788
+ };
789
+ },
790
+ },
791
+ variationFindRandomTerm: {
792
+ getAnswerNode: (initial, reason, firstRank, ...otherArgs) => {
793
+ const [rankAsked] = otherArgs;
794
+ return seqGeometricUtils.getAnswerNodeRandomTerm(initial, reason, firstRank, rankAsked);
795
+ },
796
+ getHint: (firstRank, ...otherArgs) => {
797
+ const [rankAsked] = otherArgs;
798
+ const target = rankAsked - firstRank;
799
+ return `Quelle est la nature de la suite $u_n$ ?
800
+
801
+ Utilise le terme général de $u_n$ pour déterminer le salaire pour l'année $2025+${target.frenchify()}$.`;
802
+ },
803
+ getCorrectionStuff: (initial, reason, firstRank) => {
804
+ const evoPercentage = (reason - 1) * 100;
805
+ const strEvoPercentage = evoPercentage.frPretty(2);
806
+ return {
807
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque année, le salaire est multiplié par $${reason.frenchify()}$.
808
+ Le salaire en $\\textrm{€}$ pour l'année $2025+${substract("n".toTree(), firstRank)
809
+ .simplify()
810
+ .toTex()}$, est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
811
+ };
812
+ },
813
+ },
814
+ },
815
+ //voiture de location
816
+ {
817
+ type: "evoPercentage",
818
+ randInitial: () => randint(28, 44) * 1000,
819
+ randReason: () => 1 + randint(2, 7) / 100, //expl: 1,05
820
+ randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
821
+ randSuperfluousData: () => {
822
+ const rand = randint(0, 2);
823
+ const values = [];
824
+ switch (rand) {
825
+ case 0:
826
+ {
827
+ const fostipySubscription = randint(5, 10) + 0.99;
828
+ values.push(fostipySubscription);
829
+ }
830
+ break;
831
+ case 1:
832
+ {
833
+ const priceOfCar = randint(8, 30) * 1000;
834
+ values.push(priceOfCar);
835
+ }
836
+ break;
837
+ }
838
+ return {
839
+ rand,
840
+ values,
841
+ };
842
+ },
843
+ getStrSituation: (initial, reason, _firstRank, superfluousData) => {
844
+ const evoPercentage = (reason - 1) * 100;
845
+ const strEvoPercentage = evoPercentage.frPretty(0);
846
+ if (superfluousData === undefined) {
847
+ return `Pour sa voiture, Saïda paye un loyer mensuel de $${initial} \\ \\textrm{€}$.
848
+ Son contrat prévoit une augmentation mensuelle de $${strEvoPercentage}\\%$.
849
+ On note $u_n$ le loyer à payer le mois $n$.`;
850
+ }
851
+ else {
852
+ switch (superfluousData.rand) {
853
+ case 0:
854
+ {
855
+ const [fostipySubscription] = superfluousData.values;
856
+ return `Pour sa voiture, Saïda paye un loyer mensuel de $${initial} \\ \\textrm{€}$.
857
+ Son contrat prévoit une augmentation mensuelle de $${strEvoPercentage}\\%$.
858
+ Pour écouter la musique dans la voiture, Saïda a souscrit un abonnement à Fostipy à $${fostipySubscription} \\ \\textrm{€}$.
859
+ On note $u_n$ le loyer à payer le mois $n$.`;
860
+ }
861
+ break;
862
+ case 1:
863
+ {
864
+ const [priceOfCar] = superfluousData.values;
865
+ return `Pour sa voiture, Saïda paye un loyer mensuel de $${initial} \\ \\textrm{€}$.
866
+ Le prix à l'achat de la voiture est $${priceOfCar} \\ \\textrm{€}$.
867
+ Son contrat prévoit une augmentation mensuelle de $${strEvoPercentage}\\%$.
868
+ On note $u_n$ le loyer à payer le mois $n$.`;
869
+ }
870
+ break;
871
+ default:
872
+ throw new Error("Unsupported superfluousData.rand: " + superfluousData.rand);
873
+ }
874
+ }
875
+ },
876
+ variationFindExplicitFormula: {
877
+ getAnswerNode: seqGeometricUtils.getAnswerNodeExplicitFormula,
878
+ getHint: (_firstRank) => `Quel calcul permet de trouver le loyer pour le mois $2$ ?
879
+
880
+ Inspire toi de ce calcul pour déterminer le loyer pour le mois $n$.`,
881
+ getCorrectionStuff: (initial, reason, _firstRank) => {
882
+ const evoPercentage = (reason - 1) * 100;
883
+ const strEvoPercentage = evoPercentage.frPretty(0);
884
+ return {
885
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque mois, le loyer est multiplié par $${reason.frenchify()}$.
886
+ Le loyer en $\\textrm{€}$ pour le mois $n$ est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
887
+ };
888
+ },
889
+ },
890
+ variationFindRecurrenceFormula: {
891
+ getAnswerNode: seqGeometricUtils.getAnswerNodeRecurrenceFormula,
892
+ getHint: (_firstRank) => `Si tu connais le loyer pour le mois $10$, comment fais-tu pour calculer le loyer pour le mois $11$ ?
893
+
894
+ Déduis-en comment calculer $u_{n+1}$ à partir de $u_n$.`,
895
+ getCorrectionStuff: (_initial, reason, firstRank) => {
896
+ const target1 = 10;
897
+ const target2 = 11;
898
+ const [rank1, rank2] = [target1, target2].map((target) => target + firstRank);
899
+ const evoPercentage = (reason - 1) * 100;
900
+ const strEvoPercentage = evoPercentage.frPretty(2);
901
+ return {
902
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque mois, le loyer est multiplié par $${reason.frenchify()}$.
903
+ Par exemple, le loyer du onzième mois est égal à celui du dixième mois multiplié par $${reason.frenchify()}$.`,
904
+ rank1,
905
+ rank2,
906
+ };
907
+ },
908
+ },
909
+ variationFindRandomTerm: {
910
+ getAnswerNode: (initial, reason, firstRank, ...otherArgs) => {
911
+ const [rankAsked] = otherArgs;
912
+ return seqGeometricUtils.getAnswerNodeRandomTerm(initial, reason, firstRank, rankAsked);
913
+ },
914
+ getHint: (firstRank, ...otherArgs) => {
915
+ const [rankAsked] = otherArgs;
916
+ const target = rankAsked - firstRank;
917
+ return `Quelle est la nature de la suite $u_n$ ?
918
+
919
+ Utilise le terme général de $u_n$ pour déterminer le loyer pour le mois $${target}$.`;
920
+ },
921
+ getCorrectionStuff: (initial, reason, _firstRank) => {
922
+ const evoPercentage = (reason - 1) * 100;
923
+ const strEvoPercentage = evoPercentage.frPretty(0);
924
+ return {
925
+ str: `Le pourcentage d'évolution est $${strEvoPercentage} \\%$ donc chaque mois, le loyer est multiplié par $${reason.frenchify()}$.
926
+ Le loyer en $\\textrm{€}$ pour le mois $n$ est donc une suite géométrique de premier terme $${initial.frenchify()}$ et de raison $${reason.frenchify()}$.`,
927
+ };
928
+ },
929
+ },
930
+ },
931
+ ];
932
+ export const situationsGeometric = templatesSituationsGeometric.map(createSituationGeometricFromTemplate);