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
@@ -0,0 +1,110 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { GeometricSequence, GeometricSequenceConstructor, } from "../../../../math/sequences/geometricSequence.js";
4
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
5
+ import { power } from "../../../../tree/nodes/operators/powerNode.js";
6
+ const getInstruction = (identifiers) => {
7
+ const { reason, firstTerm } = identifiers;
8
+ const sequence = new GeometricSequence(reifyAlgebraic(firstTerm), reifyAlgebraic(reason));
9
+ return `Déterminer la limite de la suite $u$ définie par :
10
+
11
+ $$
12
+ u_n = ${sequence.toTree().toTex()}
13
+ $$`;
14
+ };
15
+ const getAnswer = (identifiers) => {
16
+ const { reason, firstTerm } = identifiers;
17
+ const sequence = new GeometricSequence(reifyAlgebraic(firstTerm), reifyAlgebraic(reason));
18
+ const answer = sequence.getLimit();
19
+ return answer.toTex();
20
+ };
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
+ };
62
+ const getSequenceGeometricLimitQuestion = () => {
63
+ const sequence = GeometricSequenceConstructor.randomWithLimit();
64
+ const identifiers = {
65
+ reason: sequence.reason.toIdentifiers(),
66
+ firstTerm: sequence.firstTerm.toIdentifiers(),
67
+ };
68
+ return getQuestionFromIdentifiers(identifiers);
69
+ };
70
+ const getQuestionFromIdentifiers = (identifiers) => {
71
+ const question = {
72
+ answer: getAnswer(identifiers),
73
+ instruction: getInstruction(identifiers),
74
+ keys: ["infty"],
75
+ answerFormat: "tex",
76
+ identifiers,
77
+ hint: getHint(identifiers),
78
+ correction: getCorrection(identifiers),
79
+ };
80
+ return question;
81
+ };
82
+ const getPropositions = (n, { answer, reason, firstTerm }) => {
83
+ const propositions = [];
84
+ addValidProp(propositions, answer);
85
+ tryToAddWrongProp(propositions, "+\\infty");
86
+ tryToAddWrongProp(propositions, "-\\infty");
87
+ tryToAddWrongProp(propositions, "0");
88
+ tryToAddWrongProp(propositions, reifyAlgebraic(reason).toTex());
89
+ tryToAddWrongProp(propositions, reifyAlgebraic(firstTerm).toTex());
90
+ return shuffleProps(propositions, n);
91
+ };
92
+ const isAnswerValid = (ans, { answer }) => {
93
+ return ans === answer;
94
+ };
95
+ export const sequenceGeometricLimit = {
96
+ id: "sequenceGeometricLimit",
97
+ connector: "=",
98
+ label: "Limite d'une suite géométrique",
99
+ isSingleStep: true,
100
+ generator: (nb) => getDistinctQuestions(getSequenceGeometricLimitQuestion, nb),
101
+ qcmTimer: 60,
102
+ freeTimer: 60,
103
+ getPropositions,
104
+ isAnswerValid,
105
+ subject: "Mathématiques",
106
+ getAnswer,
107
+ getInstruction,
108
+ getQuestionFromIdentifiers,
109
+ hasHintAndCorrection: true,
110
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ coeffs: number[];
4
+ };
5
+ export declare const sequencePolynomLimit: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=sequencePolynomLimit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequencePolynomLimit.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/limits/sequences/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"}
@@ -0,0 +1,116 @@
1
+ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Polynomial, PolynomialConstructor, } from "../../../../math/polynomials/polynomial.js";
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";
10
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
11
+ const getInstruction = (identifiers) => {
12
+ const poly = new Polynomial(identifiers.coeffs, "n");
13
+ return `Déterminer la limite de la suite $u$ définie par :
14
+
15
+ $$
16
+ u_n = ${poly.toTree().toTex()}
17
+ $$`;
18
+ };
19
+ const getAnswer = (identifiers) => {
20
+ const to = "+\\infty";
21
+ const poly = new Polynomial(identifiers.coeffs, "n");
22
+ const answer = poly.getLimit(to);
23
+ return answer;
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
+ };
63
+ const getQuestionFromIdentifiers = (identifiers) => {
64
+ const question = {
65
+ answer: getAnswer(identifiers),
66
+ instruction: getInstruction(identifiers),
67
+ keys: ["infty"],
68
+ answerFormat: "tex",
69
+ identifiers,
70
+ hint: getHint(identifiers),
71
+ correction: getCorrection(identifiers),
72
+ };
73
+ return question;
74
+ };
75
+ const getSequencePolynomLimitQuestion = () => {
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 };
85
+ return getQuestionFromIdentifiers(identifiers);
86
+ };
87
+ const getPropositions = (n, { answer, coeffs }) => {
88
+ const propositions = [];
89
+ addValidProp(propositions, answer);
90
+ tryToAddWrongProp(propositions, "+\\infty");
91
+ tryToAddWrongProp(propositions, "-\\infty");
92
+ tryToAddWrongProp(propositions, "0");
93
+ tryToAddWrongProp(propositions, coeffs[coeffs.length - 1] + "");
94
+ propWhile(propositions, n, () => {
95
+ const wrongAnswer = randint(-10, 10) + "";
96
+ tryToAddWrongProp(propositions, wrongAnswer);
97
+ });
98
+ return shuffle(propositions);
99
+ };
100
+ const isAnswerValid = (ans, { answer }) => {
101
+ return ans === answer;
102
+ };
103
+ export const sequencePolynomLimit = {
104
+ id: "sequencePolynomLimit",
105
+ connector: "=",
106
+ label: "Limite d'une suite polynomiale (avec F.I.)",
107
+ isSingleStep: true,
108
+ generator: (nb) => getDistinctQuestions(getSequencePolynomLimitQuestion, nb),
109
+ qcmTimer: 60,
110
+ freeTimer: 60,
111
+ getPropositions,
112
+ isAnswerValid,
113
+ subject: "Mathématiques",
114
+ getQuestionFromIdentifiers,
115
+ hasHintAndCorrection: true,
116
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ coeffs: number[];
4
+ };
5
+ export declare const sequencePolynomNoFILimit: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=sequencePolynomNoFILimit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequencePolynomNoFILimit.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/limits/sequences/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"}
@@ -0,0 +1,95 @@
1
+ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Polynomial, PolynomialConstructor, } from "../../../../math/polynomials/polynomial.js";
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";
7
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
8
+ const getInstruction = (identifiers) => {
9
+ const poly = new Polynomial(identifiers.coeffs, "n");
10
+ return `Déterminer la limite de la suite $u$ définie par :
11
+
12
+ $$
13
+ u_n = ${poly.toTree().toTex()}
14
+ $$`;
15
+ };
16
+ const getAnswer = (identifiers) => {
17
+ const to = "+\\infty";
18
+ const poly = new Polynomial(identifiers.coeffs, "n");
19
+ const answer = poly.getLimit(to);
20
+ return answer;
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
+ };
49
+ const getQuestionFromIdentifiers = (identifiers) => {
50
+ const question = {
51
+ answer: getAnswer(identifiers),
52
+ instruction: getInstruction(identifiers),
53
+ keys: ["infty"],
54
+ answerFormat: "tex",
55
+ identifiers,
56
+ hint: getHint(identifiers),
57
+ correction: getCorrection(identifiers),
58
+ };
59
+ return question;
60
+ };
61
+ const getSequencePolynomNoFILimitQuestion = () => {
62
+ const length = randint(2, 5);
63
+ const poly = PolynomialConstructor.randomWithLengthAndSameSigns(4, length, "n");
64
+ const identifiers = { coeffs: poly.coefficients };
65
+ return getQuestionFromIdentifiers(identifiers);
66
+ };
67
+ const getPropositions = (n, { answer, coeffs }) => {
68
+ const propositions = [];
69
+ addValidProp(propositions, answer);
70
+ tryToAddWrongProp(propositions, "+\\infty");
71
+ tryToAddWrongProp(propositions, "-\\infty");
72
+ tryToAddWrongProp(propositions, "0");
73
+ tryToAddWrongProp(propositions, coeffs[coeffs.length - 1] + "");
74
+ propWhile(propositions, n, () => {
75
+ tryToAddWrongProp(propositions, randint(-10, 10) + "");
76
+ });
77
+ return shuffle(propositions);
78
+ };
79
+ const isAnswerValid = (ans, { answer }) => {
80
+ return ans === answer;
81
+ };
82
+ export const sequencePolynomNoFILimit = {
83
+ id: "sequencePolynomNoFILimit",
84
+ connector: "=",
85
+ label: "Limite d'une suite polynomiale (sans F.I.)",
86
+ isSingleStep: true,
87
+ generator: (nb) => getDistinctQuestions(getSequencePolynomNoFILimitQuestion, nb),
88
+ qcmTimer: 60,
89
+ freeTimer: 60,
90
+ getPropositions,
91
+ isAnswerValid,
92
+ subject: "Mathématiques",
93
+ getQuestionFromIdentifiers,
94
+ hasHintAndCorrection: true,
95
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ polyNumCoeffs: number[];
4
+ polyDenumCoeffs: number[];
5
+ };
6
+ export declare const sequencePolynomProductLimit: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=sequencePolynomProductLimit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequencePolynomProductLimit.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/limits/sequences/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"}
@@ -0,0 +1,111 @@
1
+ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Rational } from "../../../../math/numbers/rationals/rational.js";
4
+ import { Monom } from "../../../../math/polynomials/monom.js";
5
+ import { Polynomial, PolynomialConstructor, } from "../../../../math/polynomials/polynomial.js";
6
+ import { randint } from "../../../../math/utils/random/randint.js";
7
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
8
+ const getInstruction = (identifiers) => {
9
+ const { polyNumCoeffs, polyDenumCoeffs } = identifiers;
10
+ const polyNum = new Polynomial(polyNumCoeffs, "n");
11
+ const polyDenum = new Polynomial(polyDenumCoeffs, "n");
12
+ return `Déterminer la limite de la suite $u$ définie par :
13
+
14
+ $$
15
+ u_n = (${polyNum.toTree().toTex()})(${polyDenum.toTree().toTex()})
16
+ $$`;
17
+ };
18
+ const getAnswer = (identifiers) => {
19
+ const { polyNumCoeffs, polyDenumCoeffs } = identifiers;
20
+ const polyNum = new Polynomial(polyNumCoeffs, "n");
21
+ const polyDenum = new Polynomial(polyDenumCoeffs, "n");
22
+ const numLeadingCoeff = polyNum.coefficients[polyNum.degree];
23
+ const denumLeadingCoeff = polyDenum.coefficients[polyDenum.degree];
24
+ const product = new Monom(polyNum.degree + polyDenum.degree, numLeadingCoeff * denumLeadingCoeff, "n");
25
+ const to = "+\\infty";
26
+ const answer = product.getLimit(to);
27
+ return answer;
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
+ };
56
+ const getQuestionFromIdentifiers = (identifiers) => {
57
+ const question = {
58
+ answer: getAnswer(identifiers),
59
+ instruction: getInstruction(identifiers),
60
+ keys: ["infty"],
61
+ answerFormat: "tex",
62
+ identifiers,
63
+ hint: getHint(identifiers),
64
+ correction: getCorrection(identifiers),
65
+ };
66
+ return question;
67
+ };
68
+ const getSequencePolynomProductLimitQuestion = () => {
69
+ const polyNum = PolynomialConstructor.randomWithLengthAndSameSigns(3, 2, "n");
70
+ const polyDenum = PolynomialConstructor.randomWithLengthAndSameSigns(3, 2, "n");
71
+ const identifiers = {
72
+ polyDenumCoeffs: polyDenum.coefficients,
73
+ polyNumCoeffs: polyNum.coefficients,
74
+ };
75
+ return getQuestionFromIdentifiers(identifiers);
76
+ };
77
+ const getPropositions = (n, { answer, polyDenumCoeffs, polyNumCoeffs }) => {
78
+ const propositions = [];
79
+ addValidProp(propositions, answer);
80
+ const numLeadingCoeff = polyNumCoeffs[polyNumCoeffs.length - 1];
81
+ const denumLeadingCoeff = polyDenumCoeffs[polyDenumCoeffs.length - 1];
82
+ const leadingCoeffsRational = new Rational(numLeadingCoeff, denumLeadingCoeff)
83
+ .simplify()
84
+ .toTree()
85
+ .toTex();
86
+ tryToAddWrongProp(propositions, "+\\infty");
87
+ tryToAddWrongProp(propositions, "-\\infty");
88
+ tryToAddWrongProp(propositions, "0");
89
+ tryToAddWrongProp(propositions, leadingCoeffsRational);
90
+ propWhile(propositions, n, () => {
91
+ tryToAddWrongProp(propositions, randint(-10, 10) + "");
92
+ });
93
+ return shuffle(propositions);
94
+ };
95
+ const isAnswerValid = (ans, { answer }) => {
96
+ return ans === answer;
97
+ };
98
+ export const sequencePolynomProductLimit = {
99
+ id: "sequencePolynomProductLimit",
100
+ connector: "=",
101
+ label: "Limite d'un produit de suites polynomiales (sans F.I.)",
102
+ isSingleStep: true,
103
+ generator: (nb) => getDistinctQuestions(getSequencePolynomProductLimitQuestion, nb),
104
+ qcmTimer: 60,
105
+ freeTimer: 60,
106
+ getPropositions,
107
+ isAnswerValid,
108
+ subject: "Mathématiques",
109
+ getQuestionFromIdentifiers,
110
+ hasHintAndCorrection: true,
111
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ numCoeffs: number[];
4
+ denumCoeffs: number[];
5
+ };
6
+ export declare const sequenceRationalFracLimit: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=sequenceRationalFracLimit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequenceRationalFracLimit.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/limits/sequences/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"}
@@ -0,0 +1,114 @@
1
+ import { addValidProp, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { Rational } from "../../../../math/numbers/rationals/rational.js";
4
+ import { Monom } from "../../../../math/polynomials/monom.js";
5
+ import { Polynomial, PolynomialConstructor, } from "../../../../math/polynomials/polynomial.js";
6
+ import { randint } from "../../../../math/utils/random/randint.js";
7
+ import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
8
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
9
+ const getInstruction = (identifiers) => {
10
+ const { numCoeffs, denumCoeffs } = identifiers;
11
+ const polyNum = new Polynomial(numCoeffs, "n");
12
+ const polyDenum = new Polynomial(denumCoeffs, "n");
13
+ return `Déterminer la limite de la suite $u$ définie par :
14
+
15
+ $$
16
+ u_n = \\dfrac{${polyNum.toTree().toTex()}}{${polyDenum.toTree().toTex()}}
17
+ $$`;
18
+ };
19
+ const getAnswer = (identifiers) => {
20
+ const { numCoeffs, denumCoeffs } = identifiers;
21
+ const polyNum = new Polynomial(numCoeffs, "n");
22
+ const polyDenum = new Polynomial(denumCoeffs, "n");
23
+ let answer = "";
24
+ const to = "+\\infty";
25
+ const numLeadingCoeff = polyNum.coefficients[polyNum.degree];
26
+ const denumLeadingCoeff = polyDenum.coefficients[polyDenum.degree];
27
+ const leadingCoeffsRational = new Rational(numLeadingCoeff, denumLeadingCoeff)
28
+ .simplify()
29
+ .toTree()
30
+ .toTex();
31
+ if (polyDenum.degree === polyNum.degree) {
32
+ answer = leadingCoeffsRational;
33
+ }
34
+ else if (polyDenum.degree > polyNum.degree) {
35
+ answer = "0";
36
+ }
37
+ else {
38
+ const tempPoly = new Monom(polyNum.degree - polyDenum.degree, numLeadingCoeff * denumLeadingCoeff > 0 ? 1 : -1, "n");
39
+ answer = tempPoly.getLimit(to);
40
+ }
41
+ return answer;
42
+ };
43
+ const getQuestionFromIdentifiers = (identifiers) => {
44
+ const question = {
45
+ answer: getAnswer(identifiers),
46
+ instruction: getInstruction(identifiers),
47
+ keys: ["infty"],
48
+ answerFormat: "tex",
49
+ identifiers,
50
+ };
51
+ return question;
52
+ };
53
+ const getSequenceRationalFracLimitQuestion = () => {
54
+ const polyNum = PolynomialConstructor.randomWithLengthAndSameSigns(3, randint(2, 4), "n");
55
+ const polyDenum = PolynomialConstructor.randomWithLengthAndSameSigns(3, randint(2, 4), "n");
56
+ const identifiers = {
57
+ numCoeffs: polyNum.coefficients,
58
+ denumCoeffs: polyDenum.coefficients,
59
+ };
60
+ return getQuestionFromIdentifiers(identifiers);
61
+ };
62
+ const getPropositions = (n, { answer, numCoeffs, denumCoeffs }) => {
63
+ const propositions = [];
64
+ addValidProp(propositions, answer);
65
+ const numLeadingCoeff = numCoeffs[numCoeffs.length - 1];
66
+ const denumLeadingCoeff = denumCoeffs[denumCoeffs.length - 1];
67
+ const leadingCoeffsRational = new Rational(numLeadingCoeff, denumLeadingCoeff)
68
+ .simplify()
69
+ .toTree()
70
+ .toTex();
71
+ tryToAddWrongProp(propositions, "+\\infty");
72
+ tryToAddWrongProp(propositions, "-\\infty");
73
+ tryToAddWrongProp(propositions, "0");
74
+ tryToAddWrongProp(propositions, leadingCoeffsRational);
75
+ propWhile(propositions, n, () => {
76
+ tryToAddWrongProp(propositions, randint(-10, 10) + "");
77
+ });
78
+ return shuffle(propositions);
79
+ };
80
+ const isAnswerValid = (ans, { denumCoeffs, numCoeffs }) => {
81
+ const numDegree = numCoeffs.length - 1;
82
+ const denumDegree = denumCoeffs.length - 1;
83
+ const numLeadingCoeff = numCoeffs[numDegree];
84
+ const denumLeadingCoeff = denumCoeffs[denumDegree];
85
+ const leadingCoeffsRational = new Rational(numLeadingCoeff, denumLeadingCoeff)
86
+ .simplify()
87
+ .toTree({ allowFractionToDecimal: true });
88
+ let answer;
89
+ if (denumDegree === numDegree) {
90
+ answer = leadingCoeffsRational;
91
+ }
92
+ else if (denumDegree > numDegree) {
93
+ answer = new NumberNode(0);
94
+ }
95
+ else {
96
+ const tempPoly = new Monom(numDegree - denumDegree, numLeadingCoeff * denumLeadingCoeff > 0 ? 1 : -1);
97
+ answer = tempPoly.getLimitNode("+\\infty");
98
+ }
99
+ const texs = answer.toAllValidTexs();
100
+ return texs.includes(ans);
101
+ };
102
+ export const sequenceRationalFracLimit = {
103
+ id: "sequenceRationalFracLimit",
104
+ connector: "=",
105
+ label: "Limite d'une suite rationnelle",
106
+ isSingleStep: true,
107
+ generator: (nb) => getDistinctQuestions(getSequenceRationalFracLimitQuestion, nb),
108
+ qcmTimer: 60,
109
+ freeTimer: 60,
110
+ getPropositions,
111
+ isAnswerValid,
112
+ subject: "Mathématiques",
113
+ getQuestionFromIdentifiers,
114
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"constantPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/constantPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAOJ,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAgCF,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAMxE,CAAC;AAEF,eAAO,MAAM,2CAA2C,EAAE,0BAA0B,CAClF,WAAW,EACX,OAAO,CAaR,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,YAAY,CAAC,WAAW,EAAE,OAAO,CAmB/E,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAQpE,CAAC;AAYF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAc5D,CAAC"}
1
+ {"version":3,"file":"constantPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/constantPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EASJ,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC,CAAC;AAyDF,eAAO,MAAM,oBAAoB,EAAE,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAMxE,CAAC;AAEF,eAAO,MAAM,2CAA2C,EAAE,0BAA0B,CAClF,WAAW,EACX,OAAO,CAeR,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,YAAY,CACzD,WAAW,EACX,OAAO,CAoBR,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,CAQpE,CAAC;AAYF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe5D,CAAC"}
@@ -16,13 +16,34 @@ const getInstruction = (identifiers, opts) => {
16
16
  const { c } = identifiers;
17
17
  const isAskingParticularPrimitive = opts?.askParticularPrimitive;
18
18
  return `${isAskingParticularPrimitive
19
- ? "Déterminer une primitive en particulier de la fonction constante $f$ définie par"
19
+ ? "Donner une des primitives de la fonction constante $f$ définie par"
20
20
  : "Déterminer la forme générale des primitives de la fonction constante $f$ définie par"} :
21
21
 
22
22
  $$
23
23
  f(x) = ${c}
24
24
  $$`;
25
25
  };
26
+ const getHint = (identifiers) => {
27
+ const { c } = identifiers;
28
+ return `Quelles sont les fonctions qui ont pour dérivée $x\\mapsto ${c}$ ?`;
29
+ };
30
+ const getCorrection = (identifiers, opts) => {
31
+ if (opts?.askParticularPrimitive)
32
+ return `Une primitive de $f$ est :
33
+
34
+ $$
35
+ F(x) = ${getAnswerNode(identifiers, opts).toTex()}
36
+ $$
37
+
38
+ En effet, en dérivant $F(x)$, on obtient bien $F'(x) = f(x)$.`;
39
+ return `La forme générale des primitives de la fonction $f$ est :
40
+
41
+ $$
42
+ F(x) = ${getAnswerNode(identifiers, opts).toTex()}
43
+ $$
44
+
45
+ où $C$ est un réel. En effet, en dérivant $F(x)$, on obtient bien $F'(x) = f(x)$.`;
46
+ };
26
47
  const getAnswer = (identifiers, opts) => {
27
48
  return getAnswerNode(identifiers, opts).toTex();
28
49
  };
@@ -39,6 +60,8 @@ export const getConstantPrimitiveQuestionFromIdentifiers = (identifiers, opts) =
39
60
  keys: opts?.askParticularPrimitive ? ["x"] : ["x", "C"],
40
61
  answerFormat: "tex",
41
62
  identifiers,
63
+ hint: getHint(identifiers, opts),
64
+ correction: getCorrection(identifiers, opts),
42
65
  options: opts,
43
66
  };
44
67
  return question;
@@ -82,4 +105,5 @@ export const constantPrimitive = {
82
105
  subject: "Mathématiques",
83
106
  getQuestionFromIdentifiers: getConstantPrimitiveQuestionFromIdentifiers,
84
107
  options,
108
+ hasHintAndCorrection: true,
85
109
  };
@@ -1 +1 @@
1
- {"version":3,"file":"exponentialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/exponentialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAGR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAKJ,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwBF,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,WAAW,CAIlE,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0BAA0B,CACrF,WAAW,CAYZ,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,YAAY,CAAC,WAAW,CAgCzE,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,GAAG,CAAC,WAAW,CAY9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
1
+ {"version":3,"file":"exponentialPrimitive.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/primitive/exponentialPrimitive.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAKR,0BAA0B,EAE1B,YAAY,EAEZ,iBAAiB,EACjB,GAAG,EAKJ,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAwBF,eAAO,MAAM,uBAAuB,EAAE,iBAAiB,CAAC,WAAW,CAIlE,CAAC;AAqBF,eAAO,MAAM,8CAA8C,EAAE,0BAA0B,CACrF,WAAW,CAcZ,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,YAAY,CAAC,WAAW,CAgCzE,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,GAAG,CAAC,WAAW,CAY9D,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}