math-exercises 3.0.201 → 3.0.203

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 (198) hide show
  1. package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts +2 -0
  2. package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts.map +1 -1
  3. package/lib/exercises/math/dataRepresentations/scatterPlot/index.js +2 -2
  4. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.js +2 -2
  5. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts.map +1 -1
  6. package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.js +9 -2
  7. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +1 -1
  8. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts +1 -0
  9. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts.map +1 -1
  10. package/lib/exercises/math/derivation/derivative/trigo/index.js +1 -1
  11. package/lib/exercises/math/derivation/derivative/trigo/productOfSinAXPlusBCosCXPlusDDerivative.js +1 -1
  12. package/lib/exercises/math/derivation/derivative/trigo/sinAndCosMixedWithSquareDerivative.js +1 -1
  13. package/lib/exercises/math/derivation/derivative/trigo/sinCosDerivativeRewriteUsingCos2PlusSin2Equals1.js +1 -1
  14. package/lib/exercises/math/derivation/problems/index.d.ts +1 -0
  15. package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -1
  16. package/lib/exercises/math/derivation/problems/index.js +1 -1
  17. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -1
  18. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +31 -21
  19. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -1
  20. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +8 -128
  21. package/lib/exercises/math/derivation/tangent/index.d.ts +1 -0
  22. package/lib/exercises/math/derivation/tangent/index.d.ts.map +1 -1
  23. package/lib/exercises/math/derivation/tangent/index.js +1 -1
  24. package/lib/exercises/math/derivation/variations/index.d.ts +1 -0
  25. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
  26. package/lib/exercises/math/derivation/variations/index.js +1 -1
  27. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -1
  28. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +47 -20
  29. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -1
  30. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +29 -6
  31. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  32. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +33 -0
  33. package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.d.ts +7 -0
  34. package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.d.ts.map +1 -0
  35. package/lib/exercises/math/equaDiff/exponentialDifferentialEquation.js +86 -0
  36. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -1
  37. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +35 -7
  38. package/lib/exercises/math/equaDiff/index.d.ts +1 -1
  39. package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
  40. package/lib/exercises/math/equaDiff/index.js +1 -1
  41. package/lib/exercises/math/functions/integral/integralExpU.d.ts.map +1 -1
  42. package/lib/exercises/math/functions/integral/integralExpU.js +48 -0
  43. package/lib/exercises/math/functions/integral/integralFractions.d.ts.map +1 -1
  44. package/lib/exercises/math/functions/integral/integralFractions.js +52 -0
  45. package/lib/exercises/math/functions/integral/integralTrinomials.d.ts.map +1 -1
  46. package/lib/exercises/math/functions/integral/integralTrinomials.js +40 -0
  47. package/lib/exercises/math/functions/logarithm/log10Simplifying.js +2 -2
  48. package/lib/exercises/math/functions/logarithm/powerEquation.js +1 -1
  49. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -1
  50. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +172 -51
  51. package/lib/exercises/math/geometry/angles/index.d.ts +1 -0
  52. package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -1
  53. package/lib/exercises/math/geometry/angles/index.js +1 -1
  54. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.d.ts.map +1 -1
  55. package/lib/exercises/math/geometry/parametric/extractVectorFromParametricLine.js +30 -25
  56. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.d.ts.map +1 -1
  57. package/lib/exercises/math/geometry/parametric/pointFromParametricLine.js +52 -5
  58. package/lib/exercises/math/integration/fromExpr/areaBetweenCrossingCurvesFixedPosFromExpr.d.ts.map +1 -1
  59. package/lib/exercises/math/integration/fromExpr/areaBetweenCrossingCurvesFixedPosFromExpr.js +26 -35
  60. package/lib/exercises/math/integration/fromExpr/index.d.ts +1 -0
  61. package/lib/exercises/math/integration/fromExpr/index.d.ts.map +1 -1
  62. package/lib/exercises/math/integration/fromExpr/index.js +1 -1
  63. package/lib/exercises/math/limits/index.d.ts +1 -5
  64. package/lib/exercises/math/limits/index.d.ts.map +1 -1
  65. package/lib/exercises/math/limits/index.js +1 -5
  66. package/lib/exercises/math/limits/limitReading.d.ts.map +1 -1
  67. package/lib/exercises/math/limits/limitReading.js +70 -0
  68. package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
  69. package/lib/exercises/math/limits/polynomLimit.js +55 -4
  70. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts.map +1 -1
  71. package/lib/exercises/math/limits/polynomLimitNoFI.js +35 -2
  72. package/lib/exercises/math/limits/sequenceGeometricLimit.d.ts.map +1 -1
  73. package/lib/exercises/math/limits/sequenceGeometricLimit.js +45 -9
  74. package/lib/exercises/math/limits/sequencePolynomLimit.d.ts.map +1 -1
  75. package/lib/exercises/math/limits/sequencePolynomLimit.js +56 -3
  76. package/lib/exercises/math/limits/sequencePolynomNoFILimit.d.ts.map +1 -1
  77. package/lib/exercises/math/limits/sequencePolynomNoFILimit.js +32 -0
  78. package/lib/exercises/math/limits/sequencePolynomProductLimit.d.ts.map +1 -1
  79. package/lib/exercises/math/limits/sequencePolynomProductLimit.js +33 -3
  80. package/lib/exercises/math/limits/sequenceRationalFracLimit.d.ts.map +1 -1
  81. package/lib/exercises/math/limits/sequenceRationalFracLimit.js +2 -2
  82. package/lib/exercises/math/limits/sequences/index.d.ts +6 -0
  83. package/lib/exercises/math/limits/sequences/index.d.ts.map +1 -0
  84. package/lib/exercises/math/limits/sequences/index.js +5 -0
  85. package/lib/exercises/math/limits/sequences/sequenceGeometricLimit.d.ts +9 -0
  86. package/lib/exercises/math/limits/sequences/sequenceGeometricLimit.d.ts.map +1 -0
  87. package/lib/exercises/math/limits/sequences/sequenceGeometricLimit.js +110 -0
  88. package/lib/exercises/math/limits/sequences/sequencePolynomLimit.d.ts +7 -0
  89. package/lib/exercises/math/limits/sequences/sequencePolynomLimit.d.ts.map +1 -0
  90. package/lib/exercises/math/limits/sequences/sequencePolynomLimit.js +116 -0
  91. package/lib/exercises/math/limits/sequences/sequencePolynomNoFILimit.d.ts +7 -0
  92. package/lib/exercises/math/limits/sequences/sequencePolynomNoFILimit.d.ts.map +1 -0
  93. package/lib/exercises/math/limits/sequences/sequencePolynomNoFILimit.js +95 -0
  94. package/lib/exercises/math/limits/sequences/sequencePolynomProductLimit.d.ts +8 -0
  95. package/lib/exercises/math/limits/sequences/sequencePolynomProductLimit.d.ts.map +1 -0
  96. package/lib/exercises/math/limits/sequences/sequencePolynomProductLimit.js +111 -0
  97. package/lib/exercises/math/limits/sequences/sequenceRationalFracLimit.d.ts +8 -0
  98. package/lib/exercises/math/limits/sequences/sequenceRationalFracLimit.d.ts.map +1 -0
  99. package/lib/exercises/math/limits/sequences/sequenceRationalFracLimit.js +114 -0
  100. package/lib/exercises/math/primitive/constantPrimitive.d.ts.map +1 -1
  101. package/lib/exercises/math/primitive/constantPrimitive.js +25 -1
  102. package/lib/exercises/math/primitive/exponentialPrimitive.d.ts.map +1 -1
  103. package/lib/exercises/math/primitive/exponentialPrimitive.js +17 -0
  104. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
  105. package/lib/exercises/math/primitive/polynomialPrimitive.js +17 -1
  106. package/lib/exercises/math/primitive/sinCosPrimitive.d.ts.map +1 -1
  107. package/lib/exercises/math/primitive/sinCosPrimitive.js +20 -1
  108. package/lib/exercises/math/primitive/usualPrimitives.d.ts.map +1 -1
  109. package/lib/exercises/math/primitive/usualPrimitives.js +1 -0
  110. package/lib/exercises/math/sequences/index.d.ts +1 -0
  111. package/lib/exercises/math/sequences/index.d.ts.map +1 -1
  112. package/lib/exercises/math/sequences/index.js +1 -0
  113. package/lib/exercises/math/sequences/proofByInduction/index.d.ts +5 -0
  114. package/lib/exercises/math/sequences/proofByInduction/index.d.ts.map +1 -0
  115. package/lib/exercises/math/sequences/proofByInduction/index.js +4 -0
  116. package/lib/exercises/math/sequences/proofByInduction/proofByInductionCheckInitialization.d.ts +10 -0
  117. package/lib/exercises/math/sequences/proofByInduction/proofByInductionCheckInitialization.d.ts.map +1 -0
  118. package/lib/exercises/math/sequences/proofByInduction/proofByInductionCheckInitialization.js +236 -0
  119. package/lib/exercises/math/sequences/proofByInduction/proofByInductionReorderProof.d.ts +13 -0
  120. package/lib/exercises/math/sequences/proofByInduction/proofByInductionReorderProof.d.ts.map +1 -0
  121. package/lib/exercises/math/sequences/proofByInduction/proofByInductionReorderProof.js +244 -0
  122. package/lib/exercises/math/sequences/proofByInduction/proofByInductionSituations.d.ts +98 -0
  123. package/lib/exercises/math/sequences/proofByInduction/proofByInductionSituations.d.ts.map +1 -0
  124. package/lib/exercises/math/sequences/proofByInduction/proofByInductionSituations.js +175 -0
  125. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWriteMissingStep.d.ts +13 -0
  126. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWriteMissingStep.d.ts.map +1 -0
  127. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWriteMissingStep.js +317 -0
  128. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWritePropAtRankKPlus1.d.ts +13 -0
  129. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWritePropAtRankKPlus1.d.ts.map +1 -0
  130. package/lib/exercises/math/sequences/proofByInduction/proofByInductionWritePropAtRankKPlus1.js +265 -0
  131. package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSets.js +4 -4
  132. package/lib/exercises/math/sets/cartesianProduct/findCardinalOfCartesianProductOfFiniteSetsFromSituation.js +3 -3
  133. package/lib/exercises/math/sets/cartesianProduct/proposeElementInCartesianProductOfFiniteSets.js +4 -4
  134. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesOfPointInCubeCoordSystemFromVecPath.js +1 -1
  135. package/lib/exercises/math/spaceGeometry/orthogonalProjection/findOrthogonalProjectionOfPointOnPlane.d.ts.map +1 -1
  136. package/lib/exercises/math/spaceGeometry/orthogonalProjection/findOrthogonalProjectionOfPointOnPlane.js +12 -25
  137. package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.d.ts +1 -1
  138. package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.d.ts.map +1 -1
  139. package/lib/exercises/math/spaceGeometry/orthogonalProjection/index.js +1 -2
  140. package/lib/exercises/math/spaceGeometry/planes/findNormalVectorFromPlanePointsCoords.d.ts.map +1 -1
  141. package/lib/exercises/math/spaceGeometry/planes/findNormalVectorFromPlanePointsCoords.js +11 -26
  142. package/lib/exercises/math/spaceGeometry/planes/index.d.ts +1 -0
  143. package/lib/exercises/math/spaceGeometry/planes/index.d.ts.map +1 -1
  144. package/lib/exercises/math/spaceGeometry/planes/index.js +1 -1
  145. package/lib/exercises/math/spaceGeometry/planes/planePlaneRelativePositions.d.ts.map +1 -1
  146. package/lib/exercises/math/spaceGeometry/planes/planePlaneRelativePositions.js +11 -25
  147. package/lib/exercises/math/spaceGeometry/scalarProduct/angleFromScalarProductFromSpacePointCoords.d.ts.map +1 -1
  148. package/lib/exercises/math/spaceGeometry/scalarProduct/angleFromScalarProductFromSpacePointCoords.js +25 -5
  149. package/lib/exercises/math/spaceGeometry/scalarProduct/index.d.ts +1 -0
  150. package/lib/exercises/math/spaceGeometry/scalarProduct/index.d.ts.map +1 -1
  151. package/lib/exercises/math/spaceGeometry/scalarProduct/index.js +1 -1
  152. package/lib/exercises/math/spaceGeometry/vectors/findLinearDecompositionWrtCoplanarUVFromCoords.js +2 -2
  153. package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.d.ts.map +1 -1
  154. package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.js +87 -24
  155. package/lib/exercises/pc/mathExosInPC.d.ts +1 -1
  156. package/lib/exercises/pc/mathExosInPC.d.ts.map +1 -1
  157. package/lib/exercises/pc/mathExosInPC.js +1 -1
  158. package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -1
  159. package/lib/exercises/vea/polynomialVEA.js +4 -0
  160. package/lib/index.d.ts +104 -13
  161. package/lib/index.d.ts.map +1 -1
  162. package/lib/math/geometry/point.d.ts.map +1 -1
  163. package/lib/math/geometry/point.js +1 -1
  164. package/lib/math/geometry/spaceVector.d.ts +2 -0
  165. package/lib/math/geometry/spaceVector.d.ts.map +1 -1
  166. package/lib/math/geometry/spaceVector.js +40 -0
  167. package/lib/math/utils/functions/functionDecomposition.d.ts +2 -2
  168. package/lib/math/utils/functions/functionDecomposition.d.ts.map +1 -1
  169. package/lib/math/utils/polynomial/polynomialUtils.d.ts +2 -2
  170. package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -1
  171. package/lib/math/utils/polynomial/polynomialUtils.js +5 -2
  172. package/lib/tests/exoTest.d.ts.map +1 -1
  173. package/lib/tests/exoTest.js +8 -12
  174. package/lib/tests/questionTest.d.ts.map +1 -1
  175. package/lib/tests/questionTest.js +14 -6
  176. package/lib/tests/singleExo.test.js +2 -2
  177. package/lib/tree/nodes/node.d.ts +2 -1
  178. package/lib/tree/nodes/node.d.ts.map +1 -1
  179. package/lib/tree/nodes/node.js +1 -0
  180. package/lib/tree/nodes/student/iDontKnowNode.d.ts +26 -0
  181. package/lib/tree/nodes/student/iDontKnowNode.d.ts.map +1 -0
  182. package/lib/tree/nodes/student/iDontKnowNode.js +63 -0
  183. package/lib/tree/parsers/latexParser.d.ts +3 -2
  184. package/lib/tree/parsers/latexParser.d.ts.map +1 -1
  185. package/lib/tree/parsers/latexParser.js +7 -0
  186. package/lib/tree/parsers/monomParser.d.ts +1 -1
  187. package/lib/tree/parsers/monomParser.d.ts.map +1 -1
  188. package/lib/tree/parsers/polynomialParser.d.ts +1 -1
  189. package/lib/tree/parsers/polynomialParser.d.ts.map +1 -1
  190. package/lib/tree/parsers/trinomParser.d.ts +1 -1
  191. package/lib/tree/parsers/trinomParser.d.ts.map +1 -1
  192. package/lib/tree/utilities/nodeComparator.d.ts +3 -1
  193. package/lib/tree/utilities/nodeComparator.d.ts.map +1 -1
  194. package/lib/tree/utilities/nodeComparator.js +68 -8
  195. package/lib/tree/utilities/nodeSimplifier.d.ts +1 -0
  196. package/lib/tree/utilities/nodeSimplifier.d.ts.map +1 -1
  197. package/lib/tree/utilities/nodeSimplifier.js +40 -0
  198. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"limitReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/limitReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;CACzB,CAAC;AAoKF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAa9C,CAAC"}
1
+ {"version":3,"file":"limitReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/limitReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtB,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;CACzB,CAAC;AAgPF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
@@ -79,6 +79,73 @@ const getAnswer = (identifiers) => {
79
79
  }
80
80
  }
81
81
  };
82
+ const getHint = (identifiers) => {
83
+ const { from, to } = identifiers;
84
+ switch (to) {
85
+ case "-\\infty":
86
+ return `Observe les valeurs de $f(x)$ lorsque $x$ se rapproche de $-\\infty$ (c'est à dire, lorsque $x$ prend des valeurs de plus en plus grande dans les négatifs). Si $f(x)$ semble se rapprocher d'une valeur, alors cette valeur est la limite recherchée. Si $f(x)$ semble devenir de plus en plus grand, alors la limite est $+\\infty$ (ou $-\\infty$ si les valeurs sont négatives).`;
87
+ break;
88
+ case "+\\infty":
89
+ return `Observe les valeurs de $f(x)$ lorsque $x$ se rapproche de $+\\infty$ (c'est à dire, lorsque $x$ prend des valeurs de plus en plus grande dans les positifs). Si $f(x)$ semble se rapprocher d'une valeur, alors cette valeur est la limite recherchée. Si $f(x)$ semble devenir de plus en plus grand, alors la limite est $+\\infty$ (ou $-\\infty$ si les valeurs sont négatives).`;
90
+ break;
91
+ default:
92
+ if (from === "+") {
93
+ return `On cherche la limite de $f(x)$ lorsque $x$ se rapproche de $${to}$, tout en restant supérieur à $${to}$. Observe donc les valeurs de $f(x)$ en partant des valeurs de $x$ supérieures à $${to}$, et en te rapprochant de plus en plus de $${to}$.`;
94
+ }
95
+ else {
96
+ return `On cherche la limite de $f(x)$ lorsque $x$ se rapproche de $${to}$, tout en restant inférieur à $${to}$. Observe donc les valeurs de $f(x)$ en partant des valeurs de $x$ inférieures à $${to}$, et en te rapprochant de plus en plus de $${to}$.`;
97
+ }
98
+ }
99
+ return ``;
100
+ };
101
+ const getCorrection = (identifiers) => {
102
+ const { from, to } = identifiers;
103
+ const answer = getAnswer(identifiers);
104
+ let corr = "";
105
+ switch (to) {
106
+ case "-\\infty":
107
+ corr += `On observe les valeurs de $f(x)$ lorsque $x$ se rapproche de $-\\infty$ (c'est à dire, lorsque $x$ prend des valeurs de plus en plus grande dans les négatifs).`;
108
+ break;
109
+ case "+\\infty":
110
+ corr += `On observe les valeurs de $f(x)$ lorsque $x$ se rapproche de $+\\infty$ (c'est à dire, lorsque $x$ prend des valeurs de plus en plus grande dans les positifs).`;
111
+ break;
112
+ default:
113
+ if (from === "+") {
114
+ corr += `On cherche la limite de $f(x)$ lorsque $x$ se rapproche de $${to}$, tout en restant supérieur à $${to}$. On observe donc les valeurs de $f(x)$ en partant des valeurs de $x$ supérieures à $${to}$, et en se rapprochant de plus en plus de $${to}$.`;
115
+ }
116
+ else {
117
+ corr += `On cherche la limite de $f(x)$ lorsque $x$ se rapproche de $${to}$, tout en restant inférieur à $${to}$. On observe donc les valeurs de $f(x)$ en partant des valeurs de $x$ inférieures à $${to}$, et en se rapprochant de plus en plus de $${to}$.`;
118
+ }
119
+ }
120
+ switch (answer) {
121
+ case "+\\infty":
122
+ corr += `
123
+
124
+ On lit graphiquement que $f(x)$ prend des valeurs de plus en plus grandes dans les positifs, c'est à dire que ces valeurs semblent se rapprocher de $+\\infty$.
125
+ `;
126
+ break;
127
+ case "-\\infty":
128
+ corr += `
129
+
130
+ On lit graphiquement que $f(x)$ prend des valeurs de plus en plus grandes dans les négatifs, c'est à dire que ces valeurs semblent se rapprocher de $-\\infty$.
131
+ `;
132
+ break;
133
+ default:
134
+ corr += `
135
+
136
+ On lit graphiquement que $f(x)$ prend des valeurs de plus en plus proches de $${answer}$.
137
+ `;
138
+ break;
139
+ }
140
+ return (corr +
141
+ `
142
+
143
+ On en conclut donc que :
144
+
145
+ $$
146
+ ${new LimitNode(parseLatex(to), new VariableNode("f(x)"), from).toTex()} = ${answer}
147
+ $$`);
148
+ };
82
149
  const getQuestionFromIdentifiers = (identifiers) => {
83
150
  const question = {
84
151
  answer: getAnswer(identifiers),
@@ -87,6 +154,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
87
154
  ggbOptions: getGGBOptions(identifiers),
88
155
  answerFormat: "tex",
89
156
  identifiers,
157
+ hint: getHint(identifiers),
158
+ correction: getCorrection(identifiers),
90
159
  };
91
160
  return question;
92
161
  };
@@ -176,4 +245,5 @@ export const limitReading = {
176
245
  hasGeogebra: true,
177
246
  subject: "Mathématiques",
178
247
  getQuestionFromIdentifiers,
248
+ hasHintAndCorrection: true,
179
249
  };
@@ -1 +1 @@
1
- {"version":3,"file":"polynomLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/polynomLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,EAAE,EAAE,UAAU,GAAG,UAAU,CAAC;CAC7B,CAAC;AA6DF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAY9C,CAAC"}
1
+ {"version":3,"file":"polynomLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/polynomLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,EAAE,EAAE,UAAU,GAAG,UAAU,CAAC;CAC7B,CAAC;AAiHF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAa9C,CAAC"}
@@ -2,6 +2,11 @@ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../exercises/
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { Polynomial, PolynomialConstructor, } from "../../../math/polynomials/polynomial.js";
4
4
  import { randint } from "../../../math/utils/random/randint.js";
5
+ import { AddNode } from "../../../tree/nodes/operators/addNode.js";
6
+ import { frac } from "../../../tree/nodes/operators/fractionNode.js";
7
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
8
+ import { power } from "../../../tree/nodes/operators/powerNode.js";
9
+ import { operatorComposition } from "../../../tree/utilities/operatorComposition.js";
5
10
  import { coinFlip } from "../../../utils/alea/coinFlip.js";
6
11
  import { shuffle } from "../../../utils/alea/shuffle.js";
7
12
  const getInstruction = (identifiers) => {
@@ -19,8 +24,44 @@ const getAnswer = (identifiers) => {
19
24
  const answer = poly.getLimit(to);
20
25
  return answer;
21
26
  };
22
- // const getHint: GetHint<Identifiers> = (identifiers) => {};
23
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
27
+ const getHint = () => {
28
+ return `Attention ! Ici, on est en présence d'une forme indéterminée du type "$\\infty - \\infty"$.
29
+
30
+ On ne peut pas immédiatemment déterminer la limite de $f(x)$.
31
+
32
+ Pour s'en sortir, il faut d'abord factoriser $f(x)$ par son terme de plus haut degré.`;
33
+ };
34
+ const getCorrection = (identifiers) => {
35
+ const { coeffs, to } = identifiers;
36
+ const order = coeffs.length - 1;
37
+ const highCoeff = coeffs[order];
38
+ const high = power("x", order);
39
+ const factoNodes = [...coeffs].reverse().map((e, i) => {
40
+ //coeff / n^(order-i)
41
+ return frac(e, power("x", i)).simplify();
42
+ });
43
+ const facto = operatorComposition(AddNode, factoNodes);
44
+ return `Ici, on est en présence d'une forme indéterminée du type "$\\infty - \\infty"$.
45
+
46
+ Pour déterminer la limite de $f(x)$, on factorise par son terme de plus haut degré :
47
+
48
+ $$
49
+ f(x) = ${multiply(high, facto).toTex()}
50
+ $$
51
+
52
+ On a alors :
53
+
54
+
55
+ - $\\displaystyle \\lim_{x \\to ${to}} ${high.toTex()} = ${to === "-\\infty" && order % 2 === 1 ? "-" : "+"}\\infty$
56
+
57
+ - $\\displaystyle \\lim_{x \\to ${to}} ${facto.toTex()} = ${highCoeff}$
58
+
59
+ Par produit des limites, on obtient donc :
60
+
61
+ $$
62
+ \\lim_{x \\to ${to}} f(x) = ${getAnswer(identifiers)}
63
+ $$`;
64
+ };
24
65
  const getQuestionFromIdentifiers = (identifiers) => {
25
66
  const question = {
26
67
  answer: getAnswer(identifiers),
@@ -28,11 +69,20 @@ const getQuestionFromIdentifiers = (identifiers) => {
28
69
  keys: ["infty"],
29
70
  answerFormat: "tex",
30
71
  identifiers,
72
+ hint: getHint(identifiers),
73
+ correction: getCorrection(identifiers),
31
74
  };
32
75
  return question;
33
76
  };
34
77
  const getPolynomLimitQuestion = () => {
35
- const poly = PolynomialConstructor.random(4);
78
+ const order = randint(2, 5);
79
+ const poly = PolynomialConstructor.randomWithOrder(order, "n");
80
+ const coeffs = [...poly.coefficients];
81
+ const signs = coeffs.slice(1).map((e) => (e > 0 ? "+" : "-"));
82
+ if (signs.every((s) => s === signs[0])) {
83
+ const index = randint(1, order);
84
+ coeffs[index] *= -1;
85
+ }
36
86
  const to = coinFlip() ? "+\\infty" : "-\\infty";
37
87
  const identifiers = { coeffs: poly.coefficients, to };
38
88
  return getQuestionFromIdentifiers(identifiers);
@@ -56,7 +106,7 @@ const isAnswerValid = (ans, { answer }) => {
56
106
  export const polynomLimit = {
57
107
  id: "polynomLimit",
58
108
  connector: "=",
59
- label: "Limite d'une fonction polynomiale",
109
+ label: "Limite d'une fonction polynomiale (avec F.I.)",
60
110
  isSingleStep: true,
61
111
  generator: (nb) => getDistinctQuestions(getPolynomLimitQuestion, nb),
62
112
  qcmTimer: 60,
@@ -65,4 +115,5 @@ export const polynomLimit = {
65
115
  isAnswerValid,
66
116
  subject: "Mathématiques",
67
117
  getQuestionFromIdentifiers,
118
+ hasHintAndCorrection: true,
68
119
  };
@@ -1 +1 @@
1
- {"version":3,"file":"polynomLimitNoFI.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/polynomLimitNoFI.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,EAAE,EAAE,UAAU,GAAG,UAAU,CAAC;CAC7B,CAAC;AAgEF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAalD,CAAC"}
1
+ {"version":3,"file":"polynomLimitNoFI.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/polynomLimitNoFI.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,EAAE,EAAE,UAAU,GAAG,UAAU,CAAC;CAC7B,CAAC;AAgGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
@@ -2,6 +2,8 @@ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../exercises/
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { Polynomial, PolynomialConstructor, } from "../../../math/polynomials/polynomial.js";
4
4
  import { randint } from "../../../math/utils/random/randint.js";
5
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
6
+ import { power } from "../../../tree/nodes/operators/powerNode.js";
5
7
  import { coinFlip } from "../../../utils/alea/coinFlip.js";
6
8
  import { shuffle } from "../../../utils/alea/shuffle.js";
7
9
  const getInstruction = (identifiers) => {
@@ -19,8 +21,36 @@ const getAnswer = (identifiers) => {
19
21
  const answer = poly.getLimit(to);
20
22
  return answer;
21
23
  };
22
- // const getHint: GetHint<Identifiers> = (identifiers) => {};
23
- // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {};
24
+ const getHint = (identifiers) => {
25
+ const { to } = identifiers;
26
+ return `Détermine la limite quand $x$ tend vers $${to}$ de chaque terme de la somme composant $f(x)$.
27
+
28
+ Puis, déduis-en la limite de $f(x)$ en "additionnant" les limites obtenues.`;
29
+ };
30
+ const getCorrection = (identifiers) => {
31
+ const { to, coeffs } = identifiers;
32
+ const texs = coeffs
33
+ .map((coeff, i) => {
34
+ if (coeff === 0)
35
+ return "";
36
+ if (i === 0)
37
+ return `$\\displaystyle \\lim_{x \\to ${to}} ${coeff} = ${coeff}$`;
38
+ const monom = multiply(coeff, power("x", i)).simplify();
39
+ const value = to === "+\\infty" ? 100 : -100;
40
+ const sign = monom.evaluate({ x: value }) > 0 ? "+" : "-";
41
+ return `$\\displaystyle \\lim_{x \\to ${to}} ${monom.toTex()} = ${sign}\\infty$`;
42
+ })
43
+ .filter(Boolean);
44
+ return `On détermine la limite de chaque terme de la somme composant $f(x)$ :
45
+
46
+ ${texs.reverse().join("\n \n")}
47
+
48
+ Par addition des limites, on obtient donc :
49
+
50
+ $$
51
+ \\lim_{x \\to ${to}} f(x) = ${getAnswer(identifiers)}
52
+ $$`;
53
+ };
24
54
  const getQuestionFromIdentifiers = (identifiers) => {
25
55
  const question = {
26
56
  answer: getAnswer(identifiers),
@@ -28,6 +58,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
28
58
  keys: ["infty"],
29
59
  answerFormat: "tex",
30
60
  identifiers,
61
+ hint: getHint(identifiers),
62
+ correction: getCorrection(identifiers),
31
63
  };
32
64
  return question;
33
65
  };
@@ -65,4 +97,5 @@ export const polynomLimitNoFI = {
65
97
  isAnswerValid,
66
98
  subject: "Mathématiques",
67
99
  getQuestionFromIdentifiers,
100
+ hasHintAndCorrection: true,
68
101
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceGeometricLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequenceGeometricLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAE7C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC;AA4EF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAgBxD,CAAC"}
1
+ {"version":3,"file":"sequenceGeometricLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequenceGeometricLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAG7C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC;AAoHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAgBxD,CAAC"}
@@ -2,6 +2,7 @@ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercis
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeometricSequence, GeometricSequenceConstructor, } from "../../../math/sequences/geometricSequence.js";
4
4
  import { reifyAlgebraic, } from "../../../tree/nodes/nodeConstructor.js";
5
+ import { power } from "../../../tree/nodes/operators/powerNode.js";
5
6
  const getInstruction = (identifiers) => {
6
7
  const { reason, firstTerm } = identifiers;
7
8
  const sequence = new GeometricSequence(reifyAlgebraic(firstTerm), reifyAlgebraic(reason));
@@ -17,12 +18,47 @@ const getAnswer = (identifiers) => {
17
18
  const answer = sequence.getLimit();
18
19
  return answer.toTex();
19
20
  };
20
- // const getHint: GetHint<Identifiers> = (identifiers)=>{
21
- // return ``
22
- // }
23
- // const getCorrection: GetCorrection<Identifiers> = (identifiers)=>{
24
- // return ``
25
- // }
21
+ const getHint = () => {
22
+ return `Soit $u$ la suite géométrique définie par :
23
+
24
+ $$
25
+ u_n = q^n
26
+ $$
27
+
28
+ Alors :
29
+
30
+ - si $q>1$, la limite de $u_n$ est $+\\infty$ ;
31
+ - si $-1<q<1$, la limite de $u_n$ est $0$.
32
+ - si $q<-1$, $u_n$ n'admet pas de limite.
33
+
34
+ `;
35
+ };
36
+ const getCorrection = (identifiers) => {
37
+ const { reason } = identifiers;
38
+ const reasonNode = reifyAlgebraic(reason);
39
+ const reasonEv = reasonNode.evaluate({});
40
+ const reasonTex = reasonEv > 1
41
+ ? `Puisque $${reasonNode.toTex()}>1$, on a :
42
+
43
+ $$
44
+ \\lim_{n \\to +\\infty} ${power(reasonNode, "n").toTex()} = +\\infty
45
+ $$
46
+
47
+ `
48
+ : `Puisque $-1<${reasonNode.toTex()}<1$, on a :
49
+
50
+ $$
51
+ \\lim_{n \\to +\\infty} ${power(reasonNode, "n").toTex()} = 0
52
+ $$`;
53
+ return (reasonTex +
54
+ `
55
+
56
+ On en déduit donc :
57
+
58
+ $$
59
+ \\lim_{n \\to +\\infty} u_n = ${getAnswer(identifiers)}
60
+ $$`);
61
+ };
26
62
  const getSequenceGeometricLimitQuestion = () => {
27
63
  const sequence = GeometricSequenceConstructor.randomWithLimit();
28
64
  const identifiers = {
@@ -38,8 +74,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
38
74
  keys: ["infty"],
39
75
  answerFormat: "tex",
40
76
  identifiers,
41
- // hint: getHint(identifiers),
42
- // correction: getCorrection(identifiers),
77
+ hint: getHint(identifiers),
78
+ correction: getCorrection(identifiers),
43
79
  };
44
80
  return question;
45
81
  };
@@ -70,5 +106,5 @@ export const sequenceGeometricLimit = {
70
106
  getAnswer,
71
107
  getInstruction,
72
108
  getQuestionFromIdentifiers,
73
- // hasHintAndCorrection: true,
109
+ hasHintAndCorrection: true,
74
110
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sequencePolynomLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequencePolynomLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAyDF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
1
+ {"version":3,"file":"sequencePolynomLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequencePolynomLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA2GF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
@@ -2,6 +2,11 @@ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../exercises/
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { Polynomial, PolynomialConstructor, } from "../../../math/polynomials/polynomial.js";
4
4
  import { randint } from "../../../math/utils/random/randint.js";
5
+ import { AddNode } from "../../../tree/nodes/operators/addNode.js";
6
+ import { frac } from "../../../tree/nodes/operators/fractionNode.js";
7
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
8
+ import { power } from "../../../tree/nodes/operators/powerNode.js";
9
+ import { operatorComposition } from "../../../tree/utilities/operatorComposition.js";
5
10
  import { shuffle } from "../../../utils/alea/shuffle.js";
6
11
  const getInstruction = (identifiers) => {
7
12
  const poly = new Polynomial(identifiers.coeffs, "n");
@@ -17,6 +22,44 @@ const getAnswer = (identifiers) => {
17
22
  const answer = poly.getLimit(to);
18
23
  return answer;
19
24
  };
25
+ const getHint = () => {
26
+ return `Attention ! Ici, on est en présence d'une forme indéterminée du type "$\\infty - \\infty"$.
27
+
28
+ On ne peut pas immédiatemment déterminer la limite de $u_n$.
29
+
30
+ Pour s'en sortir, il faut d'abord factoriser $u_n$ par son terme de plus haut degré.`;
31
+ };
32
+ const getCorrection = (identifiers) => {
33
+ const { coeffs } = identifiers;
34
+ const order = coeffs.length - 1;
35
+ const highCoeff = coeffs[order];
36
+ const high = power("n", order);
37
+ const factoNodes = [...coeffs].reverse().map((e, i) => {
38
+ //coeff / n^(order-i)
39
+ return frac(e, power("n", i)).simplify();
40
+ });
41
+ const facto = operatorComposition(AddNode, factoNodes);
42
+ return `Ici, on est en présence d'une forme indéterminée du type "$\\infty - \\infty"$.
43
+
44
+ Pour déterminer la limite de $u_n$, on factorise par son terme de plus haut degré :
45
+
46
+ $$
47
+ u_n = ${multiply(high, facto).toTex()}
48
+ $$
49
+
50
+ On a alors :
51
+
52
+
53
+ - $\\displaystyle \\lim_{n \\to +\\infty} ${high.toTex()} = +\\infty$
54
+
55
+ - $\\displaystyle \\lim_{n \\to +\\infty} ${facto.toTex()} = ${highCoeff}$
56
+
57
+ Par produit des limites, on obtient donc :
58
+
59
+ $$
60
+ \\lim_{n \\to +\\infty} u_{n} = ${getAnswer(identifiers)}
61
+ $$`;
62
+ };
20
63
  const getQuestionFromIdentifiers = (identifiers) => {
21
64
  const question = {
22
65
  answer: getAnswer(identifiers),
@@ -24,12 +67,21 @@ const getQuestionFromIdentifiers = (identifiers) => {
24
67
  keys: ["infty"],
25
68
  answerFormat: "tex",
26
69
  identifiers,
70
+ hint: getHint(identifiers),
71
+ correction: getCorrection(identifiers),
27
72
  };
28
73
  return question;
29
74
  };
30
75
  const getSequencePolynomLimitQuestion = () => {
31
- const poly = PolynomialConstructor.random(4, "n");
32
- const identifiers = { coeffs: poly.coefficients };
76
+ const order = randint(2, 5);
77
+ const poly = PolynomialConstructor.randomWithOrder(order, "n");
78
+ const coeffs = [...poly.coefficients];
79
+ const signs = coeffs.slice(1).map((e) => (e > 0 ? "+" : "-"));
80
+ if (signs.every((s) => s === signs[0])) {
81
+ const index = randint(1, order);
82
+ coeffs[index] *= -1;
83
+ }
84
+ const identifiers = { coeffs: coeffs };
33
85
  return getQuestionFromIdentifiers(identifiers);
34
86
  };
35
87
  const getPropositions = (n, { answer, coeffs }) => {
@@ -51,7 +103,7 @@ const isAnswerValid = (ans, { answer }) => {
51
103
  export const sequencePolynomLimit = {
52
104
  id: "sequencePolynomLimit",
53
105
  connector: "=",
54
- label: "Limite d'une suite polynomiale",
106
+ label: "Limite d'une suite polynomiale (avec F.I.)",
55
107
  isSingleStep: true,
56
108
  generator: (nb) => getDistinctQuestions(getSequencePolynomLimitQuestion, nb),
57
109
  qcmTimer: 60,
@@ -60,4 +112,5 @@ export const sequencePolynomLimit = {
60
112
  isAnswerValid,
61
113
  subject: "Mathématiques",
62
114
  getQuestionFromIdentifiers,
115
+ hasHintAndCorrection: true,
63
116
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sequencePolynomNoFILimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequencePolynomNoFILimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA+DF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAa1D,CAAC"}
1
+ {"version":3,"file":"sequencePolynomNoFILimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequencePolynomNoFILimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA4FF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAc1D,CAAC"}
@@ -2,6 +2,8 @@ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../exercises/
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { Polynomial, PolynomialConstructor, } from "../../../math/polynomials/polynomial.js";
4
4
  import { randint } from "../../../math/utils/random/randint.js";
5
+ import { multiply } from "../../../tree/nodes/operators/multiplyNode.js";
6
+ import { power } from "../../../tree/nodes/operators/powerNode.js";
5
7
  import { shuffle } from "../../../utils/alea/shuffle.js";
6
8
  const getInstruction = (identifiers) => {
7
9
  const poly = new Polynomial(identifiers.coeffs, "n");
@@ -17,6 +19,33 @@ const getAnswer = (identifiers) => {
17
19
  const answer = poly.getLimit(to);
18
20
  return answer;
19
21
  };
22
+ const getHint = () => {
23
+ return `Détermine la limite quand $n$ tend vers $+\\infty$ de chaque terme de la somme composant $u_n$.
24
+
25
+ Puis, déduis-en la limite de $u_n$ en "additionnant" les limites obtenues.`;
26
+ };
27
+ const getCorrection = (identifiers) => {
28
+ const texs = identifiers.coeffs
29
+ .map((coeff, i) => {
30
+ if (coeff === 0)
31
+ return "";
32
+ if (i === 0)
33
+ return `$\\displaystyle \\lim_{n \\to +\\infty} ${coeff} = ${coeff}$`;
34
+ const monom = multiply(coeff, power("n", i)).simplify().toTex();
35
+ const sign = coeff > 0 ? "+" : "-";
36
+ return `$\\displaystyle \\lim_{n \\to +\\infty} ${monom} = ${sign}\\infty$`;
37
+ })
38
+ .filter(Boolean);
39
+ return `On détermine la limite de chaque terme de la somme composant $u_n$ :
40
+
41
+ ${texs.reverse().join("\n \n")}
42
+
43
+ Par addition des limites, on obtient donc :
44
+
45
+ $$
46
+ \\lim_{n \\to +\\infty} u_{n} = ${getAnswer(identifiers)}
47
+ $$`;
48
+ };
20
49
  const getQuestionFromIdentifiers = (identifiers) => {
21
50
  const question = {
22
51
  answer: getAnswer(identifiers),
@@ -24,6 +53,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
24
53
  keys: ["infty"],
25
54
  answerFormat: "tex",
26
55
  identifiers,
56
+ hint: getHint(identifiers),
57
+ correction: getCorrection(identifiers),
27
58
  };
28
59
  return question;
29
60
  };
@@ -60,4 +91,5 @@ export const sequencePolynomNoFILimit = {
60
91
  isAnswerValid,
61
92
  subject: "Mathématiques",
62
93
  getQuestionFromIdentifiers,
94
+ hasHintAndCorrection: true,
63
95
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sequencePolynomProductLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequencePolynomProductLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAoFF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAa7D,CAAC"}
1
+ {"version":3,"file":"sequencePolynomProductLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequencePolynomProductLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAwHF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAc7D,CAAC"}
@@ -26,6 +26,33 @@ const getAnswer = (identifiers) => {
26
26
  const answer = product.getLimit(to);
27
27
  return answer;
28
28
  };
29
+ const getHint = () => {
30
+ return `Détermine la limite quand $n$ tend vers $+\\infty$ de chaque facteur du produit composant $u_n$.
31
+
32
+ Puis, déduis-en la limite de $u_n$ en "multipliant" les limites obtenues.`;
33
+ };
34
+ const getCorrection = (identifiers) => {
35
+ const { polyNumCoeffs, polyDenumCoeffs } = identifiers;
36
+ const polyNum = new Polynomial(polyNumCoeffs, "n");
37
+ const polyDenum = new Polynomial(polyDenumCoeffs, "n");
38
+ const numLim = polyNum.getLimit("+\\infty");
39
+ const denumLim = polyDenum.getLimit("+\\infty");
40
+ return `On détermine la limite de chaque facteur du produit composant $u_n$ :
41
+
42
+ - $\\displaystyle \\lim_{n \\to +\\infty} ${polyNum
43
+ .toTree()
44
+ .toTex()} = ${numLim}$
45
+
46
+ - $\\displaystyle \\lim_{n \\to +\\infty} ${polyDenum
47
+ .toTree()
48
+ .toTex()} = ${denumLim}$
49
+
50
+ Par produit des limites, on obtient donc :
51
+
52
+ $$
53
+ \\lim_{n \\to +\\infty} u_{n} = ${getAnswer(identifiers)}
54
+ $$`;
55
+ };
29
56
  const getQuestionFromIdentifiers = (identifiers) => {
30
57
  const question = {
31
58
  answer: getAnswer(identifiers),
@@ -33,12 +60,14 @@ const getQuestionFromIdentifiers = (identifiers) => {
33
60
  keys: ["infty"],
34
61
  answerFormat: "tex",
35
62
  identifiers,
63
+ hint: getHint(identifiers),
64
+ correction: getCorrection(identifiers),
36
65
  };
37
66
  return question;
38
67
  };
39
68
  const getSequencePolynomProductLimitQuestion = () => {
40
- const polyNum = PolynomialConstructor.randomWithLength(3, 2, "n");
41
- const polyDenum = PolynomialConstructor.randomWithLength(3, 2, "n");
69
+ const polyNum = PolynomialConstructor.randomWithLengthAndSameSigns(3, 2, "n");
70
+ const polyDenum = PolynomialConstructor.randomWithLengthAndSameSigns(3, 2, "n");
42
71
  const identifiers = {
43
72
  polyDenumCoeffs: polyDenum.coefficients,
44
73
  polyNumCoeffs: polyNum.coefficients,
@@ -69,7 +98,7 @@ const isAnswerValid = (ans, { answer }) => {
69
98
  export const sequencePolynomProductLimit = {
70
99
  id: "sequencePolynomProductLimit",
71
100
  connector: "=",
72
- label: "Limite d'un produit de suites polynomiales",
101
+ label: "Limite d'un produit de suites polynomiales (sans F.I.)",
73
102
  isSingleStep: true,
74
103
  generator: (nb) => getDistinctQuestions(getSequencePolynomProductLimitQuestion, nb),
75
104
  qcmTimer: 60,
@@ -78,4 +107,5 @@ export const sequencePolynomProductLimit = {
78
107
  isAnswerValid,
79
108
  subject: "Mathématiques",
80
109
  getQuestionFromIdentifiers,
110
+ hasHintAndCorrection: true,
81
111
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sequenceRationalFracLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequenceRationalFracLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAwHF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAa3D,CAAC"}
1
+ {"version":3,"file":"sequenceRationalFracLimit.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/limits/sequenceRationalFracLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB,CAAC;AAgIF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAa3D,CAAC"}
@@ -51,8 +51,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
51
51
  return question;
52
52
  };
53
53
  const getSequenceRationalFracLimitQuestion = () => {
54
- const polyNum = PolynomialConstructor.random(4, "n");
55
- const polyDenum = PolynomialConstructor.random(4, "n");
54
+ const polyNum = PolynomialConstructor.randomWithLengthAndSameSigns(3, randint(2, 4), "n");
55
+ const polyDenum = PolynomialConstructor.randomWithLengthAndSameSigns(3, randint(2, 4), "n");
56
56
  const identifiers = {
57
57
  numCoeffs: polyNum.coefficients,
58
58
  denumCoeffs: polyDenum.coefficients,
@@ -0,0 +1,6 @@
1
+ export * from "./sequenceGeometricLimit.js";
2
+ export * from "./sequencePolynomLimit.js";
3
+ export * from "./sequencePolynomNoFILimit.js";
4
+ export * from "./sequencePolynomProductLimit.js";
5
+ export * from "./sequenceRationalFracLimit.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/limits/sequences/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from "./sequenceGeometricLimit.js";
2
+ export * from "./sequencePolynomLimit.js";
3
+ export * from "./sequencePolynomNoFILimit.js";
4
+ export * from "./sequencePolynomProductLimit.js";
5
+ export * from "./sequenceRationalFracLimit.js";
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ reason: NodeIdentifiers;
5
+ firstTerm: NodeIdentifiers;
6
+ };
7
+ export declare const sequenceGeometricLimit: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=sequenceGeometricLimit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequenceGeometricLimit.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/limits/sequences/sequenceGeometricLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAG7C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,eAAe,CAAC;IACxB,SAAS,EAAE,eAAe,CAAC;CAC5B,CAAC;AAoHF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAgBxD,CAAC"}