math-exercises 2.1.8 → 2.1.10

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 (205) hide show
  1. package/lib/exercises/exercise.d.ts +1 -1
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.js +1 -1
  4. package/lib/exercises/math/calcul/arithmetics/divisorsList.js +1 -1
  5. package/lib/exercises/math/calcul/arithmetics/euclideanDivision.js +1 -1
  6. package/lib/exercises/math/calcul/arithmetics/pgcdCalcul.js +1 -1
  7. package/lib/exercises/math/calcul/rounding/rounding.js +1 -1
  8. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts +5 -0
  9. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.d.ts.map +1 -0
  10. package/lib/exercises/math/calculLitteral/equation/binomialsTrinomialsProposedSolutions.js +78 -0
  11. package/lib/exercises/math/calculLitteral/equation/equationFromSentenceExercise.d.ts +14 -0
  12. package/lib/exercises/math/calculLitteral/equation/equationFromSentenceExercise.d.ts.map +1 -0
  13. package/lib/exercises/math/calculLitteral/equation/equationFromSentenceExercise.js +160 -0
  14. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.d.ts +9 -0
  15. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.d.ts.map +1 -0
  16. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +65 -0
  17. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.d.ts +10 -0
  18. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.d.ts.map +1 -0
  19. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.js +72 -0
  20. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.d.ts +11 -0
  21. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.d.ts.map +1 -0
  22. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.js +78 -0
  23. package/lib/exercises/math/calculLitteral/equation/index.d.ts +5 -1
  24. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  25. package/lib/exercises/math/calculLitteral/equation/index.js +5 -1
  26. package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.d.ts +8 -0
  27. package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.d.ts.map +1 -0
  28. package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.js +96 -0
  29. package/lib/exercises/math/derivation/derivative/convexityTrinomials.d.ts +7 -0
  30. package/lib/exercises/math/derivation/derivative/convexityTrinomials.d.ts.map +1 -0
  31. package/lib/exercises/math/derivation/derivative/convexityTrinomials.js +44 -0
  32. package/lib/exercises/math/derivation/derivative/cosSecondDegreeDerivative.d.ts +7 -0
  33. package/lib/exercises/math/derivation/derivative/cosSecondDegreeDerivative.d.ts.map +1 -0
  34. package/lib/exercises/math/derivation/derivative/cosSecondDegreeDerivative.js +79 -0
  35. package/lib/exercises/math/derivation/derivative/index.d.ts +8 -0
  36. package/lib/exercises/math/derivation/derivative/index.d.ts.map +1 -1
  37. package/lib/exercises/math/derivation/derivative/index.js +8 -0
  38. package/lib/exercises/math/derivation/derivative/inflexionPointQuadrinomials.d.ts +7 -0
  39. package/lib/exercises/math/derivation/derivative/inflexionPointQuadrinomials.d.ts.map +1 -0
  40. package/lib/exercises/math/derivation/derivative/inflexionPointQuadrinomials.js +83 -0
  41. package/lib/exercises/math/derivation/derivative/secondDerivativeOfExpoFunction.d.ts +7 -0
  42. package/lib/exercises/math/derivation/derivative/secondDerivativeOfExpoFunction.d.ts.map +1 -0
  43. package/lib/exercises/math/derivation/derivative/secondDerivativeOfExpoFunction.js +59 -0
  44. package/lib/exercises/math/derivation/derivative/secondDerivativeOfThirdDegreeFunction.d.ts +10 -0
  45. package/lib/exercises/math/derivation/derivative/secondDerivativeOfThirdDegreeFunction.d.ts.map +1 -0
  46. package/lib/exercises/math/derivation/derivative/secondDerivativeOfThirdDegreeFunction.js +60 -0
  47. package/lib/exercises/math/derivation/derivative/secondDerivativeOfTrinom.d.ts +9 -0
  48. package/lib/exercises/math/derivation/derivative/secondDerivativeOfTrinom.d.ts.map +1 -0
  49. package/lib/exercises/math/derivation/derivative/secondDerivativeOfTrinom.js +56 -0
  50. package/lib/exercises/math/derivation/derivative/sinSecondDegreeDerivative.d.ts +7 -0
  51. package/lib/exercises/math/derivation/derivative/sinSecondDegreeDerivative.d.ts.map +1 -0
  52. package/lib/exercises/math/derivation/derivative/sinSecondDegreeDerivative.js +79 -0
  53. package/lib/exercises/math/derivation/index.d.ts +1 -0
  54. package/lib/exercises/math/derivation/index.d.ts.map +1 -1
  55. package/lib/exercises/math/derivation/index.js +1 -0
  56. package/lib/exercises/math/derivation/tangent/index.d.ts +2 -0
  57. package/lib/exercises/math/derivation/tangent/index.d.ts.map +1 -0
  58. package/lib/exercises/math/derivation/tangent/index.js +17 -0
  59. package/lib/exercises/math/derivation/tangent/tangentEquations.d.ts +8 -0
  60. package/lib/exercises/math/derivation/tangent/tangentEquations.d.ts.map +1 -0
  61. package/lib/exercises/math/derivation/tangent/tangentEquations.js +70 -0
  62. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts +8 -0
  63. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -0
  64. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +85 -0
  65. package/lib/exercises/math/equaDiff/index.d.ts +1 -0
  66. package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
  67. package/lib/exercises/math/equaDiff/index.js +1 -0
  68. package/lib/exercises/math/functions/affines/affineAdjustment.d.ts +10 -0
  69. package/lib/exercises/math/functions/affines/affineAdjustment.d.ts.map +1 -0
  70. package/lib/exercises/math/functions/affines/affineAdjustment.js +106 -0
  71. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts +11 -0
  72. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -0
  73. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +125 -0
  74. package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts +7 -0
  75. package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.d.ts.map +1 -0
  76. package/lib/exercises/math/functions/affines/affineAdjustmentRsquared.js +100 -0
  77. package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.d.ts +8 -0
  78. package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.d.ts.map +1 -0
  79. package/lib/exercises/math/functions/affines/algebricExpressionOfAffine.js +55 -0
  80. package/lib/exercises/math/functions/affines/index.d.ts +5 -0
  81. package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
  82. package/lib/exercises/math/functions/affines/index.js +5 -0
  83. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts +9 -0
  84. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.d.ts.map +1 -0
  85. package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +61 -0
  86. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts +10 -0
  87. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -0
  88. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +172 -0
  89. package/lib/exercises/math/geometry/cartesian/directionVector.d.ts +8 -0
  90. package/lib/exercises/math/geometry/cartesian/directionVector.d.ts.map +1 -0
  91. package/lib/exercises/math/geometry/cartesian/directionVector.js +106 -0
  92. package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts +8 -0
  93. package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -0
  94. package/lib/exercises/math/geometry/cartesian/directionVectorEquation.js +100 -0
  95. package/lib/exercises/math/geometry/cartesian/index.d.ts +4 -0
  96. package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
  97. package/lib/exercises/math/geometry/cartesian/index.js +4 -0
  98. package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts +8 -0
  99. package/lib/exercises/math/geometry/cartesian/pointCoordinates.d.ts.map +1 -0
  100. package/lib/exercises/math/geometry/cartesian/pointCoordinates.js +76 -0
  101. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.d.ts +8 -0
  102. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.d.ts.map +1 -0
  103. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +135 -0
  104. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.d.ts +7 -0
  105. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.d.ts.map +1 -0
  106. package/lib/exercises/math/geometry/convexity/convexityTrinomialsGeo.js +61 -0
  107. package/lib/exercises/math/geometry/convexity/index.d.ts +3 -0
  108. package/lib/exercises/math/geometry/convexity/index.d.ts.map +1 -0
  109. package/lib/exercises/math/geometry/convexity/index.js +18 -0
  110. package/lib/exercises/math/geometry/index.d.ts +1 -0
  111. package/lib/exercises/math/geometry/index.d.ts.map +1 -1
  112. package/lib/exercises/math/geometry/index.js +1 -0
  113. package/lib/exercises/math/geometry/vectors/index.d.ts +3 -0
  114. package/lib/exercises/math/geometry/vectors/index.d.ts.map +1 -1
  115. package/lib/exercises/math/geometry/vectors/index.js +3 -0
  116. package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.d.ts +10 -0
  117. package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.d.ts.map +1 -0
  118. package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.js +112 -0
  119. package/lib/exercises/math/geometry/vectors/vectorLinearCombination.d.ts +14 -0
  120. package/lib/exercises/math/geometry/vectors/vectorLinearCombination.d.ts.map +1 -0
  121. package/lib/exercises/math/geometry/vectors/vectorLinearCombination.js +99 -0
  122. package/lib/exercises/math/geometry/vectors/vectorNormCalculation.d.ts +8 -0
  123. package/lib/exercises/math/geometry/vectors/vectorNormCalculation.d.ts.map +1 -0
  124. package/lib/exercises/math/geometry/vectors/vectorNormCalculation.js +61 -0
  125. package/lib/exercises/math/index.d.ts +1 -0
  126. package/lib/exercises/math/index.d.ts.map +1 -1
  127. package/lib/exercises/math/index.js +1 -0
  128. package/lib/exercises/math/percent/findProportion.js +1 -1
  129. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +3 -3
  130. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts +7 -0
  131. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -0
  132. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +97 -0
  133. package/lib/exercises/math/probaStat/stats2var/index.d.ts +1 -0
  134. package/lib/exercises/math/probaStat/stats2var/index.d.ts.map +1 -1
  135. package/lib/exercises/math/probaStat/stats2var/index.js +1 -0
  136. package/lib/exercises/math/python/conditionIf.d.ts +9 -0
  137. package/lib/exercises/math/python/conditionIf.d.ts.map +1 -0
  138. package/lib/exercises/math/python/conditionIf.js +66 -0
  139. package/lib/exercises/math/python/forLoop.d.ts +10 -0
  140. package/lib/exercises/math/python/forLoop.d.ts.map +1 -0
  141. package/lib/exercises/math/python/forLoop.js +90 -0
  142. package/lib/exercises/math/python/inOutCalcul.d.ts +10 -0
  143. package/lib/exercises/math/python/inOutCalcul.d.ts.map +1 -0
  144. package/lib/exercises/math/python/inOutCalcul.js +71 -0
  145. package/lib/exercises/math/python/index.d.ts +8 -0
  146. package/lib/exercises/math/python/index.d.ts.map +1 -1
  147. package/lib/exercises/math/python/index.js +23 -0
  148. package/lib/exercises/math/python/pyForLoop1Exercise.d.ts +13 -0
  149. package/lib/exercises/math/python/pyForLoop1Exercise.d.ts.map +1 -0
  150. package/lib/exercises/math/python/pyForLoop1Exercise.js +144 -0
  151. package/lib/exercises/math/python/pyNestedForLoopExercise.d.ts +12 -0
  152. package/lib/exercises/math/python/pyNestedForLoopExercise.d.ts.map +1 -0
  153. package/lib/exercises/math/python/pyNestedForLoopExercise.js +84 -0
  154. package/lib/exercises/math/python/pyWhileLoop1Exercise.d.ts +12 -0
  155. package/lib/exercises/math/python/pyWhileLoop1Exercise.d.ts.map +1 -0
  156. package/lib/exercises/math/python/pyWhileLoop1Exercise.js +114 -0
  157. package/lib/exercises/math/python/pythonFunctionTrinom.d.ts +9 -0
  158. package/lib/exercises/math/python/pythonFunctionTrinom.d.ts.map +1 -0
  159. package/lib/exercises/math/python/pythonFunctionTrinom.js +63 -0
  160. package/lib/exercises/math/python/whileLoop.d.ts +12 -0
  161. package/lib/exercises/math/python/whileLoop.d.ts.map +1 -0
  162. package/lib/exercises/math/python/whileLoop.js +78 -0
  163. package/lib/exercises/pc/electricity/electricChargeFromIntensity.js +1 -1
  164. package/lib/exercises/pc/mole/molFromMass.js +1 -1
  165. package/lib/exercises/pc/mole/molFromMolarMass.js +1 -1
  166. package/lib/exercises/pc/potentialEnergy.d.ts.map +1 -1
  167. package/lib/exercises/pc/potentialEnergy.js +4 -5
  168. package/lib/exercises/pc/waves/periodicWaveCelerity.js +1 -1
  169. package/lib/index.d.ts +152 -0
  170. package/lib/index.d.ts.map +1 -1
  171. package/lib/math/geometry/CloudPoints.d.ts +14 -0
  172. package/lib/math/geometry/CloudPoints.d.ts.map +1 -0
  173. package/lib/math/geometry/CloudPoints.js +94 -0
  174. package/lib/math/geometry/line.d.ts +4 -0
  175. package/lib/math/geometry/line.d.ts.map +1 -1
  176. package/lib/math/geometry/line.js +25 -0
  177. package/lib/math/geometry/vector.d.ts +5 -0
  178. package/lib/math/geometry/vector.d.ts.map +1 -1
  179. package/lib/math/geometry/vector.js +31 -0
  180. package/lib/math/polynomials/polynomial.d.ts +1 -0
  181. package/lib/math/polynomials/polynomial.d.ts.map +1 -1
  182. package/lib/math/polynomials/polynomial.js +10 -2
  183. package/lib/math/polynomials/trinom.d.ts +1 -0
  184. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  185. package/lib/math/polynomials/trinom.js +28 -0
  186. package/lib/math/utils/arithmetic/factorial.d.ts +2 -0
  187. package/lib/math/utils/arithmetic/factorial.d.ts.map +1 -0
  188. package/lib/math/utils/arithmetic/factorial.js +10 -0
  189. package/lib/math/utils/covariance.d.ts +4 -0
  190. package/lib/math/utils/covariance.d.ts.map +1 -0
  191. package/lib/math/utils/covariance.js +26 -0
  192. package/lib/math/utils/functions/expUDerivate.d.ts +5 -0
  193. package/lib/math/utils/functions/expUDerivate.d.ts.map +1 -0
  194. package/lib/math/utils/functions/expUDerivate.js +9 -0
  195. package/lib/math/utils/functions/expUSecondDerivate.d.ts +5 -0
  196. package/lib/math/utils/functions/expUSecondDerivate.d.ts.map +1 -0
  197. package/lib/math/utils/functions/expUSecondDerivate.js +12 -0
  198. package/lib/math/utils/variance.d.ts +4 -0
  199. package/lib/math/utils/variance.d.ts.map +1 -0
  200. package/lib/math/utils/variance.js +27 -0
  201. package/lib/server.d.ts.map +1 -1
  202. package/lib/tree/nodes/sets/intervalNode.d.ts +1 -1
  203. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  204. package/lib/tree/nodes/sets/intervalNode.js +2 -2
  205. package/package.json +3 -3
@@ -19,6 +19,10 @@ __exportStar(require("./equationType1Exercise"), exports);
19
19
  __exportStar(require("./equationType2Exercise"), exports);
20
20
  __exportStar(require("./equationType3Exercise"), exports);
21
21
  __exportStar(require("./equationType4Exercise"), exports);
22
- __exportStar(require("./firstDegreeEquation"), exports);
23
22
  __exportStar(require("./fractionEquation"), exports);
24
23
  __exportStar(require("./multiplicationEquation"), exports);
24
+ __exportStar(require("./firstDegreeEquationIntType1"), exports);
25
+ __exportStar(require("./firstDegreeEquationIntType2"), exports);
26
+ __exportStar(require("./firstDegreeEquationIntType3"), exports);
27
+ __exportStar(require("./equationFromSentenceExercise"), exports);
28
+ __exportStar(require("./binomialsTrinomialsProposedSolutions"), exports);
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ askConvex: boolean;
4
+ quadcoeffs: number[];
5
+ };
6
+ export declare const convexityQuadrinomials: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=convexityQuadrinomials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convexityQuadrinomials.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/convexityQuadrinomials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAqBlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAoIF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convexityQuadrinomials = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const polynomial_1 = require("../../../../math/polynomials/polynomial");
7
+ const randint_1 = require("../../../../math/utils/random/randint");
8
+ const infiniteNode_1 = require("../../../../tree/nodes/numbers/infiniteNode");
9
+ const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
10
+ const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
11
+ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
12
+ const closure_1 = require("../../../../tree/nodes/sets/closure");
13
+ const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
14
+ const coinFlip_1 = require("../../../../utils/coinFlip");
15
+ const getConvexityQuadrinomialsQuestion = () => {
16
+ const quadrinomial = polynomial_1.PolynomialConstructor.randomWithOrder(3);
17
+ const quadcoeffs = quadrinomial.coefficients;
18
+ const secondderivative = quadrinomial.derivate().derivate();
19
+ const seconddcoeffs = secondderivative.coefficients;
20
+ const inflexionPoint = new fractionNode_1.FractionNode(new multiplyNode_1.MultiplyNode(seconddcoeffs[0].toTree(), new numberNode_1.NumberNode(-1)), seconddcoeffs[1].toTree()).simplify();
21
+ const askConvex = (0, coinFlip_1.coinFlip)();
22
+ let interval;
23
+ if (askConvex) {
24
+ interval =
25
+ quadcoeffs[3] > 0
26
+ ? new intervalNode_1.IntervalNode(inflexionPoint, infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.OO).toTex()
27
+ : new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, inflexionPoint, closure_1.ClosureType.OO).toTex();
28
+ }
29
+ else {
30
+ interval =
31
+ quadcoeffs[3] <= 0
32
+ ? new intervalNode_1.IntervalNode(inflexionPoint, infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.OO).toTex()
33
+ : new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, inflexionPoint, closure_1.ClosureType.OO).toTex();
34
+ }
35
+ const questionType = askConvex ? "convexe" : "concave";
36
+ const question = {
37
+ answer: interval,
38
+ instruction: `Soit la fonction $f(x) = ${quadrinomial.toTex()}$. Sur quelle intervalle est-elle ${questionType} ?`,
39
+ keys: ["rbracket", "lbracket", "semicolon", "infty", "reals"],
40
+ answerFormat: "tex",
41
+ identifiers: { askConvex, quadcoeffs },
42
+ };
43
+ return question;
44
+ };
45
+ const getPropositions = (n, { answer, quadcoeffs }) => {
46
+ const propositions = [];
47
+ (0, exercise_1.addValidProp)(propositions, answer, "tex");
48
+ const quadrinomial = new polynomial_1.Polynomial(quadcoeffs);
49
+ const secondderivative = quadrinomial.derivate().derivate();
50
+ const seconddcoeffs = secondderivative.coefficients;
51
+ const inflexionPoint = new fractionNode_1.FractionNode(new multiplyNode_1.MultiplyNode(seconddcoeffs[0].toTree(), new numberNode_1.NumberNode(-1)), seconddcoeffs[1].toTree()).simplify();
52
+ const wrongInterval1 = new intervalNode_1.IntervalNode(inflexionPoint, infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.OO).toTex();
53
+ const wrongInterval2 = new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, inflexionPoint, closure_1.ClosureType.OO).toTex();
54
+ const wrongInterval3 = new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.OO).toTex();
55
+ const wrongInterval4 = new intervalNode_1.IntervalNode(new numberNode_1.NumberNode((0, randint_1.randint)(-1, 2)), infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.FO).toTex();
56
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongInterval1);
57
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongInterval2);
58
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongInterval3);
59
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongInterval4);
60
+ return (0, exercise_1.shuffleProps)(propositions, n);
61
+ };
62
+ const isAnswerValid = (ans, { askConvex, quadcoeffs }) => {
63
+ const quadrinomial = new polynomial_1.Polynomial(quadcoeffs);
64
+ const secondderivative = quadrinomial.derivate().derivate();
65
+ const seconddcoeffs = secondderivative.coefficients;
66
+ const inflexionPoint = new fractionNode_1.FractionNode(new multiplyNode_1.MultiplyNode(seconddcoeffs[0].toTree(), new numberNode_1.NumberNode(-1)), seconddcoeffs[1].toTree()).simplify();
67
+ let interval;
68
+ if (askConvex) {
69
+ interval =
70
+ quadcoeffs[3] > 0
71
+ ? new intervalNode_1.IntervalNode(inflexionPoint, infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.OO)
72
+ : new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, inflexionPoint, closure_1.ClosureType.OO);
73
+ }
74
+ else {
75
+ interval =
76
+ quadcoeffs[3] <= 0
77
+ ? new intervalNode_1.IntervalNode(inflexionPoint, infiniteNode_1.PlusInfinityNode, closure_1.ClosureType.OO)
78
+ : new intervalNode_1.IntervalNode(infiniteNode_1.MinusInfinityNode, inflexionPoint, closure_1.ClosureType.OO);
79
+ }
80
+ const latexs = interval.toAllValidTexs({ allowFractionToDecimal: true });
81
+ return latexs.includes(ans);
82
+ };
83
+ exports.convexityQuadrinomials = {
84
+ id: "convexityQuadrinomials",
85
+ label: "Convexité des fonctions polynomiales de degré 3",
86
+ levels: ["TermSpé"],
87
+ isSingleStep: true,
88
+ sections: ["Dérivation"],
89
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getConvexityQuadrinomialsQuestion, nb),
90
+ qcmTimer: 60,
91
+ freeTimer: 60,
92
+ answerType: "QCM",
93
+ getPropositions,
94
+ isAnswerValid,
95
+ subject: "Mathématiques",
96
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ coeffs: number[];
4
+ };
5
+ export declare const convexityTrinomials: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=convexityTrinomials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convexityTrinomials.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/convexityTrinomials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAIlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAgCF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAcrD,CAAC"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.convexityTrinomials = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const trinom_1 = require("../../../../math/polynomials/trinom");
7
+ const getConvexityTrinomialsQuestion = () => {
8
+ const trinom = trinom_1.TrinomConstructor.random();
9
+ const isConvex = trinom.a > 0 ? "Convexe" : "Concave";
10
+ const question = {
11
+ answer: isConvex,
12
+ instruction: `Soit la fonction $f(x) = ${trinom.toTex()}$. Est-elle :`,
13
+ keys: [],
14
+ answerFormat: "raw",
15
+ identifiers: { coeffs: trinom.coefficients },
16
+ };
17
+ return question;
18
+ };
19
+ const getPropositions = (n, { answer }) => {
20
+ const propositions = [];
21
+ (0, exercise_1.addValidProp)(propositions, answer, "raw");
22
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Concave", "raw");
23
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Convexe", "raw");
24
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Ni concave, ni convexe", "raw");
25
+ (0, exercise_1.tryToAddWrongProp)(propositions, "On ne peut pas savoir", "raw");
26
+ return (0, exercise_1.shuffleProps)(propositions, n);
27
+ };
28
+ const isAnswerValid = (ans, { answer }) => {
29
+ throw Error("VEA not implemented");
30
+ };
31
+ exports.convexityTrinomials = {
32
+ id: "convexityTrinomials",
33
+ label: "Convexité des fonctions quadratiques",
34
+ levels: ["TermSpé"],
35
+ isSingleStep: true,
36
+ sections: ["Dérivation"],
37
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getConvexityTrinomialsQuestion, nb),
38
+ qcmTimer: 60,
39
+ freeTimer: 60,
40
+ answerType: "QCM",
41
+ getPropositions,
42
+ isAnswerValid,
43
+ subject: "Mathématiques",
44
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ affinecoeffs: number[];
4
+ };
5
+ export declare const cosSecondDegreeDerivative: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=cosSecondDegreeDerivative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cosSecondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/cosSecondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAoHF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAa3D,CAAC"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cosSecondDegreeDerivative = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const affine_1 = require("../../../../math/polynomials/affine");
7
+ const cosNode_1 = require("../../../../tree/nodes/functions/cosNode");
8
+ const sinNode_1 = require("../../../../tree/nodes/functions/sinNode");
9
+ const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
10
+ const addNode_1 = require("../../../../tree/nodes/operators/addNode");
11
+ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
12
+ const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
13
+ const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
14
+ const getCosSecondDegreeDerivativeQuestion = () => {
15
+ const affine = affine_1.AffineConstructor.random();
16
+ const affinecoeffs = affine.coefficients;
17
+ const ans = new multiplyNode_1.MultiplyNode(new multiplyNode_1.MultiplyNode(new powerNode_1.PowerNode(affinecoeffs[1].toTree(), new numberNode_1.NumberNode(2)), new numberNode_1.NumberNode(-1)), new cosNode_1.CosNode(affine.toTree().simplify({ forbidFactorize: true })))
18
+ .simplify()
19
+ .toTex();
20
+ const func = new cosNode_1.CosNode(affine.toTree().simplify({ forbidFactorize: true })).toTex();
21
+ const question = {
22
+ answer: ans,
23
+ instruction: `Calculez la dérivée seconde de la fonction $f(x) = ${func}$.`,
24
+ keys: ["x", "sin", "cos", "tan"],
25
+ answerFormat: "tex",
26
+ identifiers: { affinecoeffs },
27
+ };
28
+ return question;
29
+ };
30
+ const getPropositions = (n, { answer, affinecoeffs }) => {
31
+ const propositions = [];
32
+ (0, exercise_1.addValidProp)(propositions, answer);
33
+ const affine = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(affinecoeffs[1]), new variableNode_1.VariableNode("x")), new numberNode_1.NumberNode(affinecoeffs[0])).simplify({ forbidFactorize: true });
34
+ const wronganswer1 = new multiplyNode_1.MultiplyNode(new powerNode_1.PowerNode(affinecoeffs[1].toTree(), new numberNode_1.NumberNode(2)), new cosNode_1.CosNode(affine))
35
+ .simplify()
36
+ .toTex();
37
+ const wronganswer2 = new multiplyNode_1.MultiplyNode(new multiplyNode_1.MultiplyNode(new powerNode_1.PowerNode(affinecoeffs[1].toTree(), new numberNode_1.NumberNode(2)), new numberNode_1.NumberNode(-1)), new sinNode_1.SinNode(affine))
38
+ .simplify()
39
+ .toTex();
40
+ const wronganswer3 = new multiplyNode_1.MultiplyNode(affinecoeffs[1].toTree(), new sinNode_1.SinNode(affine))
41
+ .simplify()
42
+ .toTex();
43
+ const wronganswer4 = new multiplyNode_1.MultiplyNode(affinecoeffs[1].toTree(), new cosNode_1.CosNode(affine))
44
+ .simplify()
45
+ .toTex();
46
+ const wronganswer5 = affine.toTex();
47
+ (0, exercise_1.tryToAddWrongProp)(propositions, wronganswer1);
48
+ (0, exercise_1.tryToAddWrongProp)(propositions, wronganswer2);
49
+ (0, exercise_1.tryToAddWrongProp)(propositions, wronganswer3);
50
+ (0, exercise_1.tryToAddWrongProp)(propositions, wronganswer4);
51
+ (0, exercise_1.tryToAddWrongProp)(propositions, wronganswer5);
52
+ while (propositions.length < n) {
53
+ const random = affine_1.AffineConstructor.random();
54
+ const randomwronganswer = new multiplyNode_1.MultiplyNode(random.a.toTree(), new sinNode_1.SinNode(random.toTree().simplify({ forbidFactorize: true })))
55
+ .simplify()
56
+ .toTex();
57
+ (0, exercise_1.tryToAddWrongProp)(propositions, randomwronganswer);
58
+ }
59
+ return (0, exercise_1.shuffleProps)(propositions, n);
60
+ };
61
+ const isAnswerValid = (ans, { answer, affinecoeffs }) => {
62
+ const affine = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(affinecoeffs[1]), new variableNode_1.VariableNode("x")), new numberNode_1.NumberNode(affinecoeffs[0])).simplify({ forbidFactorize: true });
63
+ const validanswer = new multiplyNode_1.MultiplyNode(new multiplyNode_1.MultiplyNode(new powerNode_1.PowerNode(new numberNode_1.NumberNode(affinecoeffs[1]), new numberNode_1.NumberNode(2)), new numberNode_1.NumberNode(-1)), new cosNode_1.CosNode(affine)).simplify();
64
+ const latexs = validanswer.toAllValidTexs();
65
+ return latexs.includes(ans);
66
+ };
67
+ exports.cosSecondDegreeDerivative = {
68
+ id: "cosSecondDegreeDerivative",
69
+ label: "Dérivée seconde de cos(u)",
70
+ levels: ["TermSpé"],
71
+ isSingleStep: true,
72
+ sections: ["Dérivation"],
73
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getCosSecondDegreeDerivativeQuestion, nb),
74
+ qcmTimer: 60,
75
+ freeTimer: 60,
76
+ getPropositions,
77
+ isAnswerValid,
78
+ subject: "Mathématiques",
79
+ };
@@ -20,4 +20,12 @@ export * from "./sqrtCompositionDerivation";
20
20
  export * from "./cosCompositionDerivation";
21
21
  export * from "./sinCompositionDerivation";
22
22
  export * from "./powerCompositionDerivation";
23
+ export * from "./sinSecondDegreeDerivative";
24
+ export * from "./cosSecondDegreeDerivative";
25
+ export * from "./convexityTrinomials";
26
+ export * from "./convexityQuadrinomials";
27
+ export * from "./inflexionPointQuadrinomials";
28
+ export * from "./secondDerivativeOfTrinom";
29
+ export * from "./secondDerivativeOfThirdDegreeFunction";
30
+ export * from "./secondDerivativeOfExpoFunction";
23
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yCAAyC,CAAC;AACxD,cAAc,kCAAkC,CAAC"}
@@ -41,3 +41,11 @@ __exportStar(require("./sqrtCompositionDerivation"), exports);
41
41
  __exportStar(require("./cosCompositionDerivation"), exports);
42
42
  __exportStar(require("./sinCompositionDerivation"), exports);
43
43
  __exportStar(require("./powerCompositionDerivation"), exports);
44
+ __exportStar(require("./sinSecondDegreeDerivative"), exports);
45
+ __exportStar(require("./cosSecondDegreeDerivative"), exports);
46
+ __exportStar(require("./convexityTrinomials"), exports);
47
+ __exportStar(require("./convexityQuadrinomials"), exports);
48
+ __exportStar(require("./inflexionPointQuadrinomials"), exports);
49
+ __exportStar(require("./secondDerivativeOfTrinom"), exports);
50
+ __exportStar(require("./secondDerivativeOfThirdDegreeFunction"), exports);
51
+ __exportStar(require("./secondDerivativeOfExpoFunction"), exports);
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ quadcoeffs: number[];
4
+ };
5
+ export declare const inflexionPointQuadrinomials: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=inflexionPointQuadrinomials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inflexionPointQuadrinomials.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/inflexionPointQuadrinomials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAiGF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAa7D,CAAC"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.inflexionPointQuadrinomials = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const polynomial_1 = require("../../../../math/polynomials/polynomial");
7
+ const trinom_1 = require("../../../../math/polynomials/trinom");
8
+ const randint_1 = require("../../../../math/utils/random/randint");
9
+ const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
10
+ const fractionNode_1 = require("../../../../tree/nodes/operators/fractionNode");
11
+ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
12
+ const getInflexionPointQuadrinomialsQuestion = () => {
13
+ let quadrinomial;
14
+ let quadcoeffs;
15
+ do {
16
+ quadrinomial = polynomial_1.PolynomialConstructor.randomWithOrder(3);
17
+ quadcoeffs = quadrinomial.coefficients;
18
+ } while (quadcoeffs[1] === 0 || quadcoeffs[2] === 0);
19
+ const secondderivative = quadrinomial.derivate().derivate();
20
+ const seconddcoeffs = secondderivative.coefficients;
21
+ const inflexionPoint = new fractionNode_1.FractionNode(new multiplyNode_1.MultiplyNode(seconddcoeffs[0].toTree(), new numberNode_1.NumberNode(-1)), seconddcoeffs[1].toTree())
22
+ .simplify()
23
+ .toTex();
24
+ const question = {
25
+ answer: inflexionPoint,
26
+ instruction: `Soit la fonction $f(x) = ${quadrinomial.toTex()}$. Calculer l'abscisse de son point d'inflexion.`,
27
+ keys: [],
28
+ answerFormat: "tex",
29
+ identifiers: { quadcoeffs },
30
+ };
31
+ return question;
32
+ };
33
+ const getPropositions = (n, { answer, quadcoeffs }) => {
34
+ const propositions = [];
35
+ (0, exercise_1.addValidProp)(propositions, answer);
36
+ const quadrinomial = new polynomial_1.Polynomial(quadcoeffs);
37
+ const firstdderivative = quadrinomial.derivate();
38
+ const trinomialcoeffs = firstdderivative.coefficients;
39
+ const trinomial = new trinom_1.Trinom(trinomialcoeffs[2], trinomialcoeffs[1], trinomialcoeffs[0]);
40
+ const firstroots = trinomial.getRootsNode();
41
+ const secondderivative = quadrinomial.derivate().derivate();
42
+ const seconddcoeffs = secondderivative.coefficients;
43
+ const wrongAnswer1 = new fractionNode_1.FractionNode(seconddcoeffs[0].toTree(), seconddcoeffs[1].toTree())
44
+ .simplify()
45
+ .toTex();
46
+ const wrongAnswer2 = new fractionNode_1.FractionNode(seconddcoeffs[1].toTree(), seconddcoeffs[0].toTree())
47
+ .simplify()
48
+ .toTex();
49
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer1);
50
+ (0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer2);
51
+ if (firstroots.length != 0) {
52
+ for (let i = 0; i < firstroots.length; i++) {
53
+ (0, exercise_1.tryToAddWrongProp)(propositions, firstroots[i].simplify().toTex());
54
+ }
55
+ }
56
+ while (propositions.length < n) {
57
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-1, 2).toString());
58
+ }
59
+ return (0, exercise_1.shuffleProps)(propositions, n);
60
+ };
61
+ const isAnswerValid = (ans, { answer, quadcoeffs }) => {
62
+ const quadrinomial = new polynomial_1.Polynomial(quadcoeffs);
63
+ const secondderivative = quadrinomial.derivate().derivate();
64
+ const seconddcoeffs = secondderivative.coefficients;
65
+ const inflexionPoint = new fractionNode_1.FractionNode(new multiplyNode_1.MultiplyNode(seconddcoeffs[0].toTree(), new numberNode_1.NumberNode(-1)), seconddcoeffs[1].toTree()).simplify();
66
+ const latexs = inflexionPoint.toAllValidTexs({
67
+ allowFractionToDecimal: true,
68
+ });
69
+ return latexs.includes(ans);
70
+ };
71
+ exports.inflexionPointQuadrinomials = {
72
+ id: "inflexionPointQuadrinomials",
73
+ label: "Calcul du point d'inflexion (quadrinôme)",
74
+ levels: ["TermSpé"],
75
+ isSingleStep: true,
76
+ sections: ["Dérivation"],
77
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getInflexionPointQuadrinomialsQuestion, nb),
78
+ qcmTimer: 60,
79
+ freeTimer: 60,
80
+ getPropositions,
81
+ isAnswerValid,
82
+ subject: "Mathématiques",
83
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ coeffs: number[];
4
+ };
5
+ export declare const secondDerivativeOfExpoFunction: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=secondDerivativeOfExpoFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secondDerivativeOfExpoFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/secondDerivativeOfExpoFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAiDF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAahE,CAAC"}
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.secondDerivativeOfExpoFunction = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const polynomial_1 = require("../../../../math/polynomials/polynomial");
7
+ const expUDerivate_1 = require("../../../../math/utils/functions/expUDerivate");
8
+ const expUSecondDerivate_1 = require("../../../../math/utils/functions/expUSecondDerivate");
9
+ const expNode_1 = require("../../../../tree/nodes/functions/expNode");
10
+ const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
11
+ const getSecondDerivativeOfExpoFunctionQuestion = () => {
12
+ const polynom = polynomial_1.PolynomialConstructor.randomWithOrder(1, "x");
13
+ const funct = new expNode_1.ExpNode(polynom.toTree());
14
+ const correctAnswer = (0, expUSecondDerivate_1.expuSecondDerivative)(funct, polynom);
15
+ const question = {
16
+ answer: correctAnswer.toTex(),
17
+ instruction: `Déterminer la fonction dérivée seconde $f''$ de la fonction $f$ définie par $f(x)=${funct.toTex()}$`,
18
+ keys: ["epower", "x"],
19
+ answerFormat: "tex",
20
+ identifiers: { coeffs: polynom.coefficients },
21
+ };
22
+ return question;
23
+ };
24
+ const getPropositions = (n, { answer, coeffs }) => {
25
+ const propositions = [];
26
+ (0, exercise_1.addValidProp)(propositions, answer);
27
+ generateProposition(coeffs).forEach((value) => (0, exercise_1.tryToAddWrongProp)(propositions, value.toTex()));
28
+ while (propositions.length < n) {
29
+ (0, exercise_1.tryToAddWrongProp)(propositions, new expNode_1.ExpNode(polynomial_1.PolynomialConstructor.random(2).toTree()).toTex());
30
+ }
31
+ return (0, exercise_1.shuffleProps)(propositions, n);
32
+ };
33
+ const isAnswerValid = (ans, { coeffs }) => {
34
+ const polynom = new polynomial_1.Polynomial(coeffs, "x");
35
+ const e = new expNode_1.ExpNode(polynom.toTree());
36
+ const correctAnswer = (0, expUSecondDerivate_1.expuSecondDerivative)(e, polynom);
37
+ return correctAnswer.toAllValidTexs().includes(ans);
38
+ };
39
+ const generateProposition = (coeffs) => {
40
+ const u = new polynomial_1.Polynomial(coeffs, "x");
41
+ const e = new expNode_1.ExpNode(u.toTree());
42
+ const firstPropostion = (0, expUDerivate_1.expUDerivate)(e, u);
43
+ const secondProposition = new multiplyNode_1.MultiplyNode(u.toTree(), firstPropostion);
44
+ const thirdProposition = new expNode_1.ExpNode(u.derivate().toTree());
45
+ return [firstPropostion, secondProposition, thirdProposition];
46
+ };
47
+ exports.secondDerivativeOfExpoFunction = {
48
+ id: "secondDerivativeOfExpoFunction",
49
+ label: "Calcul de la dérivée seconde d'une fonction exp(u)",
50
+ levels: ["TermSpé"],
51
+ isSingleStep: true,
52
+ sections: ["Dérivation"],
53
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSecondDerivativeOfExpoFunctionQuestion, nb),
54
+ qcmTimer: 60,
55
+ freeTimer: 60,
56
+ getPropositions,
57
+ isAnswerValid,
58
+ subject: "Mathématiques",
59
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ c: number;
6
+ d: number;
7
+ };
8
+ export declare const secondDerivativeOfThridDegreeFunction: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=secondDerivativeOfThirdDegreeFunction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secondDerivativeOfThirdDegreeFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/secondDerivativeOfThirdDegreeFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA+DF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAavE,CAAC"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.secondDerivativeOfThridDegreeFunction = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const polynomial_1 = require("../../../../math/polynomials/polynomial");
7
+ const getSecondDerivativeOfThirdDegreeFunction = () => {
8
+ const funct = polynomial_1.PolynomialConstructor.randomWithOrder(3, "x");
9
+ const coefficients = funct.coefficients;
10
+ const correctAnswer = funct.secondDerivate().toTree();
11
+ const instruction = `Déterminer la fonction dérivée seconde $f''$ de la fonction $f$ définie par $f(x)=${funct
12
+ .toTree()
13
+ .toTex()}$`;
14
+ const coeff = {
15
+ a: coefficients[3],
16
+ b: coefficients[2],
17
+ c: coefficients[1],
18
+ d: coefficients[0],
19
+ };
20
+ const question = {
21
+ answer: correctAnswer.toTex(),
22
+ instruction: instruction,
23
+ keys: ["x", "power"],
24
+ answerFormat: "tex",
25
+ identifiers: { ...coeff },
26
+ };
27
+ return question;
28
+ };
29
+ const getPropositions = (n, { answer, a, b, c, d }) => {
30
+ const propositions = [];
31
+ (0, exercise_1.addValidProp)(propositions, answer);
32
+ generateProposition(a, b, c, d).forEach((value) => (0, exercise_1.tryToAddWrongProp)(propositions, value.toTex()));
33
+ while (propositions.length < n) {
34
+ (0, exercise_1.tryToAddWrongProp)(propositions, polynomial_1.PolynomialConstructor.random(1, "x").toTree().toTex());
35
+ }
36
+ return (0, exercise_1.shuffleProps)(propositions, n);
37
+ };
38
+ const generateProposition = (a, b, c, d) => {
39
+ const firstPropostion = new polynomial_1.Polynomial([c, 2 * b, 3 * a], "x").toTree();
40
+ const secondProposition = new polynomial_1.Polynomial([c + d, 2 * b, 3 * a], "x").toTree();
41
+ const thirdProposition = new polynomial_1.Polynomial([c, 2 * b, 3 * 2 * a], "x").toTree();
42
+ return [firstPropostion, secondProposition, thirdProposition];
43
+ };
44
+ const isAnswerValid = (ans, { a, b, c, d }) => {
45
+ const result = new polynomial_1.Polynomial([d, c, b, a], "x");
46
+ return result.derivate().derivate().toTree().toAllValidTexs().includes(ans);
47
+ };
48
+ exports.secondDerivativeOfThridDegreeFunction = {
49
+ id: "secondDerivativeOfThirdDegreeFunction",
50
+ label: "Calcul de dérivée seconde d'une fonction (polynôme) de degré 3",
51
+ levels: ["TermSpé"],
52
+ isSingleStep: true,
53
+ sections: ["Dérivation"],
54
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSecondDerivativeOfThirdDegreeFunction, nb),
55
+ qcmTimer: 60,
56
+ freeTimer: 60,
57
+ getPropositions,
58
+ isAnswerValid,
59
+ subject: "Mathématiques",
60
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ c: number;
6
+ };
7
+ export declare const secondDerivativeOfTrinom: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=secondDerivativeOfTrinom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secondDerivativeOfTrinom.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/secondDerivativeOfTrinom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAWlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAuDF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAa1D,CAAC"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.secondDerivativeOfTrinom = void 0;
4
+ const exercise_1 = require("../../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
6
+ const polynomial_1 = require("../../../../math/polynomials/polynomial");
7
+ const trinom_1 = require("../../../../math/polynomials/trinom");
8
+ const randint_1 = require("../../../../math/utils/random/randint");
9
+ const numberNode_1 = require("../../../../tree/nodes/numbers/numberNode");
10
+ const getSecondDerivativeOfTrinomQuestion = () => {
11
+ const trinom = trinom_1.TrinomConstructor.random();
12
+ const trinomTree = trinom.toTree();
13
+ const instruction = `Déterminer la fonction dérivée seconde $f''$ de la fonction $f$ définie par $f(x)=${trinomTree.toTex()}$`;
14
+ const correctAnswer = trinom.derivate().derivate().toTree();
15
+ const question = {
16
+ answer: correctAnswer.toTex(),
17
+ instruction: instruction,
18
+ keys: ["power", "x"],
19
+ answerFormat: "tex",
20
+ identifiers: { a: trinom.a, b: trinom.b, c: trinom.c },
21
+ };
22
+ return question;
23
+ };
24
+ const getPropositions = (n, { answer, a, b, c }) => {
25
+ const propositions = [];
26
+ (0, exercise_1.addValidProp)(propositions, answer);
27
+ generateProposition(a, b, c).forEach((value) => (0, exercise_1.tryToAddWrongProp)(propositions, value.toTex()));
28
+ let correctAnswer = 2 * a;
29
+ while (propositions.length < n) {
30
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(correctAnswer - 11, correctAnswer + 11, [correctAnswer]) + "");
31
+ }
32
+ return (0, exercise_1.shuffleProps)(propositions, n);
33
+ };
34
+ const isAnswerValid = (ans, { a }) => {
35
+ const correctAnswer = 2 * a;
36
+ return correctAnswer + "" === ans;
37
+ };
38
+ const generateProposition = (a, b, c) => {
39
+ const firstPropostion = new polynomial_1.Polynomial([b, 2 * a], "x").toTree();
40
+ const secondProposition = new polynomial_1.Polynomial([c + b, 2 * a], "x").toTree();
41
+ const thirdProposition = new numberNode_1.NumberNode(a + b + c);
42
+ return [firstPropostion, secondProposition, thirdProposition];
43
+ };
44
+ exports.secondDerivativeOfTrinom = {
45
+ id: "secondDerivativeOfTrinom",
46
+ label: "Calcul de Dérivée seconde d'un trinome",
47
+ levels: ["TermSpé"],
48
+ isSingleStep: true,
49
+ sections: ["Dérivation"],
50
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSecondDerivativeOfTrinomQuestion, nb),
51
+ qcmTimer: 60,
52
+ freeTimer: 60,
53
+ getPropositions,
54
+ isAnswerValid,
55
+ subject: "Mathématiques",
56
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../../exercises/exercise";
2
+ type Identifiers = {
3
+ affinecoeffs: number[];
4
+ };
5
+ export declare const sinSecondDegreeDerivative: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=sinSecondDegreeDerivative.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sinSecondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/derivative/sinSecondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAkHF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,CAa3D,CAAC"}