math-exercises 3.0.56 → 3.0.58

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 (286) hide show
  1. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +2 -0
  2. package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/operations/operationsPriorities.js +46 -36
  4. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.d.ts.map +1 -1
  5. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.js +65 -13
  6. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  7. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -4
  8. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts +16 -0
  9. package/lib/exercises/math/calculLitteral/factorisation/facto1.d.ts.map +1 -0
  10. package/lib/exercises/math/calculLitteral/factorisation/facto1.js +184 -0
  11. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.d.ts.map +1 -1
  12. package/lib/exercises/math/calculLitteral/factorisation/factoType1Exercise.js +43 -0
  13. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -1
  14. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  15. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -1
  16. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -1
  17. package/lib/exercises/math/calculLitteral/systems/basicNiceValuesSystemResolution.js +23 -0
  18. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -1
  19. package/lib/exercises/math/calculLitteral/systems/basicSystemResolution.js +23 -0
  20. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/systems/verifySystemSolution.js +49 -0
  22. package/lib/exercises/math/conversion/capacityConversion.d.ts.map +1 -1
  23. package/lib/exercises/math/conversion/capacityConversion.js +68 -12
  24. package/lib/exercises/math/conversion/hoursToDecimal.d.ts.map +1 -1
  25. package/lib/exercises/math/conversion/hoursToDecimal.js +73 -15
  26. package/lib/exercises/math/conversion/lengthConversion.d.ts.map +1 -1
  27. package/lib/exercises/math/conversion/lengthConversion.js +55 -6
  28. package/lib/exercises/math/conversion/massConversion.d.ts.map +1 -1
  29. package/lib/exercises/math/conversion/massConversion.js +72 -16
  30. package/lib/exercises/math/conversion/volumeConversion.d.ts.map +1 -1
  31. package/lib/exercises/math/conversion/volumeConversion.js +72 -12
  32. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts +8 -0
  33. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.d.ts.map +1 -0
  34. package/lib/exercises/math/derivation/convexity/convexityQuadrinomials.js +102 -0
  35. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts +7 -0
  36. package/lib/exercises/math/derivation/convexity/convexityTrinomials.d.ts.map +1 -0
  37. package/lib/exercises/math/derivation/convexity/convexityTrinomials.js +52 -0
  38. package/lib/exercises/math/derivation/convexity/index.d.ts +4 -0
  39. package/lib/exercises/math/derivation/convexity/index.d.ts.map +1 -0
  40. package/lib/exercises/math/derivation/convexity/index.js +3 -0
  41. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts +7 -0
  42. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.d.ts.map +1 -0
  43. package/lib/exercises/math/derivation/convexity/inflexionPointQuadrinomials.js +134 -0
  44. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts +8 -0
  45. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -0
  46. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +79 -0
  47. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts +8 -0
  48. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -0
  49. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +85 -0
  50. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts +8 -0
  51. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -0
  52. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +86 -0
  53. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts +8 -0
  54. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -0
  55. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +76 -0
  56. package/lib/exercises/math/derivation/derivative/exp/index.d.ts +6 -0
  57. package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -0
  58. package/lib/exercises/math/derivation/derivative/exp/index.js +5 -0
  59. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts +7 -0
  60. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.d.ts.map +1 -0
  61. package/lib/exercises/math/derivation/derivative/exp/secondDerivativeOfExpoFunction.js +84 -0
  62. package/lib/exercises/math/derivation/derivative/index.d.ts +6 -27
  63. package/lib/exercises/math/derivation/derivative/index.d.ts.map +1 -1
  64. package/lib/exercises/math/derivation/derivative/index.js +6 -27
  65. package/lib/exercises/math/derivation/derivative/ln/index.d.ts +4 -0
  66. package/lib/exercises/math/derivation/derivative/ln/index.d.ts.map +1 -0
  67. package/lib/exercises/math/derivation/derivative/ln/index.js +3 -0
  68. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts +8 -0
  69. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts.map +1 -0
  70. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.js +81 -0
  71. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts +8 -0
  72. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts.map +1 -0
  73. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.js +103 -0
  74. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts +8 -0
  75. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.d.ts.map +1 -0
  76. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeTwo.js +77 -0
  77. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts +10 -0
  78. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.d.ts.map +1 -0
  79. package/lib/exercises/math/derivation/derivative/polynomial/constanteDerivative.js +71 -0
  80. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts +11 -0
  81. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.d.ts.map +1 -0
  82. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.js +88 -0
  83. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts +8 -0
  84. package/lib/exercises/math/derivation/derivative/polynomial/index.d.ts.map +1 -0
  85. package/lib/exercises/math/derivation/derivative/polynomial/index.js +7 -0
  86. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts +10 -0
  87. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.d.ts.map +1 -0
  88. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.js +115 -0
  89. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts +10 -0
  90. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.d.ts.map +1 -0
  91. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfThirdDegreeFunction.js +80 -0
  92. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts +9 -0
  93. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.d.ts.map +1 -0
  94. package/lib/exercises/math/derivation/derivative/polynomial/secondDerivativeOfTrinom.js +67 -0
  95. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts +10 -0
  96. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.d.ts.map +1 -0
  97. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.js +134 -0
  98. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts +11 -0
  99. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.d.ts.map +1 -0
  100. package/lib/exercises/math/derivation/derivative/polynomial/usualderivative.js +97 -0
  101. package/lib/exercises/math/derivation/derivative/power/index.d.ts +3 -0
  102. package/lib/exercises/math/derivation/derivative/power/index.d.ts.map +1 -0
  103. package/lib/exercises/math/derivation/derivative/power/index.js +2 -0
  104. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts +9 -0
  105. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.d.ts.map +1 -0
  106. package/lib/exercises/math/derivation/derivative/power/powerCompositionDerivation.js +122 -0
  107. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts +8 -0
  108. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.d.ts.map +1 -0
  109. package/lib/exercises/math/derivation/derivative/power/powerFunctionDerivative.js +118 -0
  110. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts +3 -0
  111. package/lib/exercises/math/derivation/derivative/sqrt/index.d.ts.map +1 -0
  112. package/lib/exercises/math/derivation/derivative/sqrt/index.js +3 -0
  113. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts +7 -0
  114. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.d.ts.map +1 -0
  115. package/lib/exercises/math/derivation/derivative/sqrt/rootFunctionDerivative.js +115 -0
  116. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts +8 -0
  117. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts.map +1 -0
  118. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.js +77 -0
  119. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts +8 -0
  120. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts.map +1 -0
  121. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.js +85 -0
  122. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts +8 -0
  123. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.d.ts.map +1 -0
  124. package/lib/exercises/math/derivation/derivative/trigo/cosCompositionDerivation.js +81 -0
  125. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts +7 -0
  126. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.d.ts.map +1 -0
  127. package/lib/exercises/math/derivation/derivative/trigo/cosSecondDegreeDerivative.js +103 -0
  128. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts +5 -0
  129. package/lib/exercises/math/derivation/derivative/trigo/index.d.ts.map +1 -0
  130. package/lib/exercises/math/derivation/derivative/trigo/index.js +4 -0
  131. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts +8 -0
  132. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.d.ts.map +1 -0
  133. package/lib/exercises/math/derivation/derivative/trigo/sinCompositionDerivation.js +70 -0
  134. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts +7 -0
  135. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.d.ts.map +1 -0
  136. package/lib/exercises/math/derivation/derivative/trigo/sinSecondDegreeDerivative.js +91 -0
  137. package/lib/exercises/math/derivation/derivativeNumberCalcul.d.ts.map +1 -1
  138. package/lib/exercises/math/derivation/derivativeNumberCalcul.js +4 -2
  139. package/lib/exercises/math/derivation/index.d.ts +2 -0
  140. package/lib/exercises/math/derivation/index.d.ts.map +1 -1
  141. package/lib/exercises/math/derivation/index.js +2 -0
  142. package/lib/exercises/math/derivation/variations/index.d.ts +2 -0
  143. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -0
  144. package/lib/exercises/math/derivation/variations/index.js +1 -0
  145. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts +11 -0
  146. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.d.ts.map +1 -0
  147. package/lib/exercises/math/derivation/variations/thirdDegreeFunctionVariation.js +168 -0
  148. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.d.ts.map +1 -1
  149. package/lib/exercises/math/equaDiff/equaDiffAyPlusB.js +39 -22
  150. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -1
  151. package/lib/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.js +7 -1
  152. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.d.ts.map +1 -1
  153. package/lib/exercises/math/equaDiff/equaDiffGeneralForme.js +38 -15
  154. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.d.ts.map +1 -1
  155. package/lib/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.js +29 -8
  156. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts +8 -0
  157. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -0
  158. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +86 -0
  159. package/lib/exercises/math/equaDiff/index.d.ts +1 -1
  160. package/lib/exercises/math/equaDiff/index.d.ts.map +1 -1
  161. package/lib/exercises/math/equaDiff/index.js +1 -1
  162. package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
  163. package/lib/exercises/math/functions/affines/signFunction.js +23 -11
  164. package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
  165. package/lib/exercises/math/functions/exponential/expEquation.js +3 -0
  166. package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
  167. package/lib/exercises/math/functions/exponential/expFactorization.js +3 -0
  168. package/lib/exercises/math/functions/exponential/expSimplifiying.d.ts.map +1 -1
  169. package/lib/exercises/math/functions/exponential/expSimplifiying.js +83 -45
  170. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.d.ts.map +1 -1
  171. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLine.js +12 -5
  172. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts +2 -0
  173. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.d.ts.map +1 -0
  174. package/lib/exercises/math/geometry/euclidianConstructions/buildRhombus.js +63 -0
  175. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.d.ts.map +1 -1
  176. package/lib/exercises/math/geometry/lines/cartesianEquationToReduced.js +68 -29
  177. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.d.ts.map +1 -1
  178. package/lib/exercises/math/geometry/lines/cartesianEquationsIntersection.js +56 -4
  179. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.d.ts.map +1 -1
  180. package/lib/exercises/math/geometry/lines/drawLineFromCartesianEquation.js +71 -25
  181. package/lib/exercises/math/limits/polynomLimit.d.ts +1 -1
  182. package/lib/exercises/math/limits/polynomLimit.d.ts.map +1 -1
  183. package/lib/exercises/math/limits/polynomLimit.js +28 -9
  184. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts +1 -1
  185. package/lib/exercises/math/limits/polynomLimitNoFI.d.ts.map +1 -1
  186. package/lib/exercises/math/limits/polynomLimitNoFI.js +29 -10
  187. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  188. package/lib/exercises/math/powers/calculateNegativePower.js +59 -16
  189. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  190. package/lib/exercises/math/powers/decimalToScientific.js +55 -11
  191. package/lib/exercises/math/powers/index.d.ts +1 -0
  192. package/lib/exercises/math/powers/index.d.ts.map +1 -1
  193. package/lib/exercises/math/powers/index.js +1 -0
  194. package/lib/exercises/math/powers/powersDivision.d.ts +5 -2
  195. package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
  196. package/lib/exercises/math/powers/powersDivision.js +68 -53
  197. package/lib/exercises/math/powers/powersMixOperations.d.ts +1 -0
  198. package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
  199. package/lib/exercises/math/powers/powersMixOperations.js +88 -17
  200. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts +10 -0
  201. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts.map +1 -0
  202. package/lib/exercises/math/powers/powersOfTenMixOperations.js +129 -0
  203. package/lib/exercises/math/powers/powersOfTenToDecimal.d.ts.map +1 -1
  204. package/lib/exercises/math/powers/powersOfTenToDecimal.js +32 -3
  205. package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
  206. package/lib/exercises/math/powers/powersProduct.js +1 -0
  207. package/lib/exercises/math/powers/scientificToDecimal.d.ts.map +1 -1
  208. package/lib/exercises/math/powers/scientificToDecimal.js +50 -10
  209. package/lib/exercises/math/primitive/klogUPrimitive.js +1 -1
  210. package/lib/exercises/math/primitive/logarithmePrimitive.js +1 -1
  211. package/lib/exercises/math/primitive/polynomialPrimitive.d.ts.map +1 -1
  212. package/lib/exercises/math/primitive/polynomialPrimitive.js +1 -0
  213. package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -1
  214. package/lib/exercises/math/probaStat/stats1var/averageList.js +4 -4
  215. package/lib/exercises/math/probaStat/stats1var/averageWithTable.d.ts.map +1 -1
  216. package/lib/exercises/math/probaStat/stats1var/averageWithTable.js +42 -11
  217. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.d.ts.map +1 -1
  218. package/lib/exercises/math/probaStat/stats1var/choseReasoningForIndicator.js +8 -20
  219. package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -1
  220. package/lib/exercises/math/probaStat/stats1var/etendueList.js +4 -6
  221. package/lib/exercises/math/probaStat/stats1var/interquartilesList.d.ts.map +1 -1
  222. package/lib/exercises/math/probaStat/stats1var/interquartilesList.js +4 -4
  223. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
  224. package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +4 -4
  225. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
  226. package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +13 -9
  227. package/lib/exercises/math/probaStat/stats1var/median.d.ts.map +1 -1
  228. package/lib/exercises/math/probaStat/stats1var/median.js +19 -14
  229. package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
  230. package/lib/exercises/math/probaStat/stats1var/medianList.js +3 -0
  231. package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
  232. package/lib/exercises/math/probaStat/stats1var/quartiles.js +16 -11
  233. package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
  234. package/lib/exercises/math/probaStat/stats1var/quartilesList.js +18 -14
  235. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.d.ts.map +1 -1
  236. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.js +4 -4
  237. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.d.ts.map +1 -1
  238. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +4 -4
  239. package/lib/exercises/math/probaStat/stats1var/varianceList.d.ts.map +1 -1
  240. package/lib/exercises/math/probaStat/stats1var/varianceList.js +4 -4
  241. package/lib/exercises/math/probaStat/stats1var/varianceTable.d.ts.map +1 -1
  242. package/lib/exercises/math/probaStat/stats1var/varianceTable.js +4 -4
  243. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -1
  244. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +40 -2
  245. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.d.ts.map +1 -1
  246. package/lib/exercises/math/sequences/geometric/geometricFirstTermsSum.js +32 -0
  247. package/lib/exercises/math/trigonometry/trigonometry.d.ts.map +1 -1
  248. package/lib/exercises/math/trigonometry/trigonometry.js +67 -1
  249. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  250. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +89 -0
  251. package/lib/exercises/pc/index.d.ts +5 -5
  252. package/lib/exercises/pc/index.d.ts.map +1 -1
  253. package/lib/exercises/pc/index.js +5 -5
  254. package/lib/index.d.ts +56 -45
  255. package/lib/index.d.ts.map +1 -1
  256. package/lib/math/geometry/angle.d.ts.map +1 -1
  257. package/lib/math/geometry/angle.js +0 -5
  258. package/lib/math/geometry/vector.d.ts +1 -0
  259. package/lib/math/geometry/vector.d.ts.map +1 -1
  260. package/lib/math/geometry/vector.js +19 -0
  261. package/lib/math/numbers/decimals/decimal.d.ts +1 -0
  262. package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
  263. package/lib/math/numbers/decimals/decimal.js +2 -0
  264. package/lib/math/systems/generalSystem.d.ts +6 -1
  265. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  266. package/lib/math/systems/generalSystem.js +137 -0
  267. package/lib/math/utils/arithmetic/lcm.js +1 -1
  268. package/lib/playground.d.ts.map +1 -1
  269. package/lib/playground.js +4 -34
  270. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  271. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  272. package/lib/tree/nodes/equations/equalNode.d.ts +7 -1
  273. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  274. package/lib/tree/nodes/equations/equalNode.js +17 -9
  275. package/lib/tree/nodes/functions/logNode.js +2 -4
  276. package/lib/tree/nodes/operators/addNode.js +1 -1
  277. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  278. package/lib/tree/nodes/operators/fractionNode.js +35 -11
  279. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  280. package/lib/tree/nodes/operators/multiplyNode.js +4 -3
  281. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  282. package/lib/tree/nodes/operators/powerNode.js +5 -0
  283. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  284. package/lib/tree/nodes/sets/intervalNode.js +3 -1
  285. package/lib/tree/parsers/latexParser.js +6 -2
  286. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ export * from "./thirdDegreeFunctionVariation.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./thirdDegreeFunctionVariation.js";
@@ -0,0 +1,11 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ c: number;
5
+ coin: number;
6
+ racine1: number;
7
+ racine2: number;
8
+ };
9
+ export declare const thirdDegreeFunctionVariation: Exercise<Identifiers>;
10
+ export {};
11
+ //# sourceMappingURL=thirdDegreeFunctionVariation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thirdDegreeFunctionVariation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/thirdDegreeFunctionVariation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IAEV,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAwKF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAmB9D,CAAC"}
@@ -0,0 +1,168 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randomColor } from "../../../../geogebra/colors.js";
4
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
5
+ import { Polynomial } from "../../../../math/polynomials/polynomial.js";
6
+ import { randint } from "../../../../math/utils/random/randint.js";
7
+ import { MinusInfinityNode, PlusInfinityNode, } from "../../../../tree/nodes/numbers/infiniteNode.js";
8
+ import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
9
+ import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
10
+ import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
11
+ import { UnionIntervalNode } from "../../../../tree/nodes/sets/unionIntervalNode.js";
12
+ import { unionIntervalParser } from "../../../../tree/parsers/unionIntervalParser.js";
13
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
14
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
15
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
16
+ const rebuildIdentifiers = (oldIds) => {
17
+ if (oldIds?.c !== undefined)
18
+ return oldIds;
19
+ return {
20
+ ...oldIds,
21
+ c: randint(-2, 3),
22
+ };
23
+ };
24
+ const getInstruction = (identifiers) => {
25
+ const { a, coin, racine1, racine2 } = identifiers;
26
+ return `Soit $f$ la fonction représentée ci-dessous.
27
+
28
+ Sur quel(s) intervalle(s) la fonction dérivée $f'$ de $f$ est-elle ${coin < 0 ? "négative" : "positive"} ?`;
29
+ };
30
+ const getHint = (identifiers) => {
31
+ return `Si la fonction $f$ est croissante sur un intervalle, alors sa fonction dérivée $f'$ sera positive sur cet intervalle.
32
+
33
+ À l'inverse, si la fonction $f$ est décroissante sur un intervalle, alors sa fonction dérivée $f'$ sera négative sur cet intervalle.`;
34
+ };
35
+ const getCorrection = (identifiers) => {
36
+ const { a, coin, racine1, racine2 } = identifiers;
37
+ const variation = coin < 0 ? "décroissante" : "croissante";
38
+ const sign = coin < 0 ? "négative" : "positive";
39
+ const intervals = getIntervalsSolution(identifiers);
40
+ return `Si la fonction $f$ est ${variation} sur un intervalle, alors sa fonction dérivée $f'$ sera ${sign} sur cet intervalle.
41
+
42
+ Ici, on lit graphiquement que $f$ est ${variation} sur $${intervals[0].toTex()}$${intervals[1] ? ` et sur $${intervals[1].toTex()}$` : ""}.
43
+
44
+ On en déduit que $f'$ est donc ${sign} sur :
45
+
46
+ $$
47
+ ${getAnswer(identifiers)}
48
+ $$`;
49
+ };
50
+ const getIntervalsSolution = (identifiers) => {
51
+ const { a, coin, racine1, racine2 } = identifiers;
52
+ const racine1Tree = new NumberNode(racine1);
53
+ const racine2Tree = new NumberNode(racine2);
54
+ const intervals = coin * a < 0
55
+ ? [new IntervalNode(racine1Tree, racine2Tree, ClosureType.FF)]
56
+ : [
57
+ new IntervalNode(MinusInfinityNode, racine1Tree, ClosureType.OF),
58
+ new IntervalNode(racine2Tree, PlusInfinityNode, ClosureType.FO),
59
+ ];
60
+ return intervals;
61
+ };
62
+ const getAnswer = (identifiers) => {
63
+ const intervals = getIntervalsSolution(identifiers);
64
+ if (intervals.length === 1)
65
+ return intervals[0].toTex();
66
+ else
67
+ return new UnionIntervalNode(intervals).toTex();
68
+ };
69
+ const getGGBOptions = (identifiers) => {
70
+ const { a, coin, racine1, racine2, c } = identifiers;
71
+ const coefs = [
72
+ c,
73
+ a * racine1 * racine2,
74
+ (-a * (racine1 + racine2)) / 2,
75
+ a / 3,
76
+ ];
77
+ const polynome = new Polynomial(coefs);
78
+ const y1 = polynome.calculate(racine1);
79
+ const y2 = polynome.calculate(racine2);
80
+ const commands = [
81
+ `f(x) = ${polynome.toMathString()}`,
82
+ `SetColor(f, "${randomColor()}")`,
83
+ ];
84
+ const yMax = Math.max(y1, y2);
85
+ const yMin = Math.min(y1, y2);
86
+ const xMax = Math.max(racine1, racine2);
87
+ const xMin = Math.min(racine1, racine2);
88
+ const ggb = new GeogebraConstructor({
89
+ commands,
90
+ lockedAxesRatio: false,
91
+ gridDistance: false,
92
+ });
93
+ return ggb.getOptions({
94
+ coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
95
+ });
96
+ };
97
+ const getThirdDegreeFunctionVariation = () => {
98
+ const a = randint(-3, 4, [0]);
99
+ const c = randint(-2, 3);
100
+ const racine1 = randint(-5, 4);
101
+ const racine2 = randint(racine1 + 1, 6);
102
+ const coin = coinFlip() ? -1 : 1;
103
+ const identifiers = { racine1, racine2, coin, a, c };
104
+ const question = {
105
+ instruction: getInstruction(identifiers),
106
+ startStatement: "S",
107
+ answer: getAnswer(identifiers),
108
+ keys: ["lbracket", "rbracket", "semicolon", "infty", "cup"],
109
+ answerFormat: "tex",
110
+ ggbOptions: getGGBOptions(identifiers),
111
+ identifiers,
112
+ hint: getHint(identifiers),
113
+ correction: getCorrection(identifiers),
114
+ };
115
+ return question;
116
+ };
117
+ const getPropositions = (n, { answer, racine1, racine2 }) => {
118
+ const racine1Tree = new NumberNode(racine1);
119
+ const racine2Tree = new NumberNode(racine2);
120
+ const propositions = [];
121
+ addValidProp(propositions, answer);
122
+ tryToAddWrongProp(propositions, new IntervalNode(racine2Tree, PlusInfinityNode, ClosureType.FO).toTex());
123
+ tryToAddWrongProp(propositions, new IntervalNode(MinusInfinityNode, racine1Tree, ClosureType.OF).toTex());
124
+ tryToAddWrongProp(propositions, new UnionIntervalNode([
125
+ new IntervalNode(MinusInfinityNode, racine1Tree, ClosureType.OF),
126
+ new IntervalNode(racine2Tree, PlusInfinityNode, ClosureType.FO),
127
+ ]).toTex());
128
+ while (propositions.length < n) {
129
+ const root1 = randint(-5, 4);
130
+ const root2 = randint(root1 + 1, 6);
131
+ const root1Tree = new NumberNode(racine1);
132
+ const root2Tree = new NumberNode(racine2);
133
+ const wrongAnswer = new IntervalNode(root1Tree, root2Tree, ClosureType.FF).toTex();
134
+ tryToAddWrongProp(propositions, wrongAnswer);
135
+ }
136
+ return shuffle(propositions);
137
+ };
138
+ const isAnswerValid = (ans, { answer, racine1, racine2, coin, a }) => {
139
+ try {
140
+ const parsed = unionIntervalParser(ans);
141
+ if (!parsed)
142
+ return false;
143
+ return parsed.simplify().toTex() === answer;
144
+ }
145
+ catch (err) {
146
+ return handleVEAError(err);
147
+ }
148
+ };
149
+ export const thirdDegreeFunctionVariation = {
150
+ id: "thirdDegreeFunctionVariation",
151
+ connector: "=",
152
+ label: "Lecture du signe de la dérivée via les variations d'une fonction",
153
+ isSingleStep: true,
154
+ generator: (nb) => getDistinctQuestions(getThirdDegreeFunctionVariation, nb),
155
+ qcmTimer: 60,
156
+ freeTimer: 60,
157
+ getPropositions,
158
+ isAnswerValid,
159
+ hasGeogebra: true,
160
+ subject: "Mathématiques",
161
+ getInstruction,
162
+ getAnswer,
163
+ getGGBOptions,
164
+ rebuildIdentifiers,
165
+ hasHintAndCorrection: true,
166
+ getHint,
167
+ getCorrection,
168
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"equaDiffAyPlusB.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffAyPlusB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8GF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAajD,CAAC"}
1
+ {"version":3,"file":"equaDiffAyPlusB.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffAyPlusB.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA8HF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAYjD,CAAC"}
@@ -2,34 +2,52 @@ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercis
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { Rational } from "../../../math/numbers/rationals/rational.js";
4
4
  import { randint } from "../../../math/utils/random/randint.js";
5
- import { EqualNode } from "../../../tree/nodes/equations/equalNode.js";
6
- import { ExpNode } from "../../../tree/nodes/functions/expNode.js";
5
+ import { equal, EqualNode } from "../../../tree/nodes/equations/equalNode.js";
6
+ import { exp, ExpNode } from "../../../tree/nodes/functions/expNode.js";
7
7
  import { NumberNode } from "../../../tree/nodes/numbers/numberNode.js";
8
- import { AddNode } from "../../../tree/nodes/operators/addNode.js";
9
- import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode.js";
8
+ import { add, AddNode } from "../../../tree/nodes/operators/addNode.js";
9
+ import { frac } from "../../../tree/nodes/operators/fractionNode.js";
10
+ import { multiply, MultiplyNode, } from "../../../tree/nodes/operators/multiplyNode.js";
10
11
  import { VariableNode } from "../../../tree/nodes/variables/variableNode.js";
11
- const getEquaDiffAyPlusBQuestion = () => {
12
- const a = randint(-10, 11, [0]);
13
- const b = randint(-10, 11);
14
- const aNode = new NumberNode(a);
15
- const bNode = new NumberNode(b);
16
- const y = new VariableNode("y");
17
- const c = new VariableNode("C");
18
- const x = new VariableNode("x");
19
- const equaDiff = new EqualNode(new VariableNode("y'"), new AddNode(new MultiplyNode(aNode, y), bNode));
20
- const fraction = new Rational(-b, a).simplify().toTree();
21
- const correctAnswer = new EqualNode(y, b != 0
22
- ? new AddNode(new MultiplyNode(c, new ExpNode(new MultiplyNode(aNode, x))), fraction)
23
- : new MultiplyNode(c, new ExpNode(new MultiplyNode(aNode, x))));
12
+ const getInstruction = (identifiers) => {
13
+ const { a, b } = identifiers;
14
+ const equaDiff = new EqualNode(new VariableNode("y'"), add(multiply(a, "y"), b));
15
+ return `Résoudre l'équation différentielle :
16
+
17
+ $$
18
+ ${equaDiff.toTex()}
19
+ $$`;
20
+ };
21
+ const getAnswer = (identifiers) => {
22
+ const { a, b } = identifiers;
23
+ const fraction = frac(-b, a).simplify();
24
+ const correctAnswer = equal("y", b != 0
25
+ ? add(multiply("C", exp(multiply(a, "x"))), fraction)
26
+ : multiply("C", exp(multiply(a, "x"))));
27
+ return correctAnswer.toTex();
28
+ };
29
+ const getHint = (identifiers) => {
30
+ return ``;
31
+ };
32
+ const getCorrection = (identifiers) => {
33
+ return ``;
34
+ };
35
+ const getQuestionFromIdentifiers = (identifiers) => {
24
36
  const question = {
25
- answer: correctAnswer.toTex(),
26
- instruction: `Résoudre l'équation différentielle : $${equaDiff.toTex()}$ `,
37
+ answer: getAnswer(identifiers),
38
+ instruction: getInstruction(identifiers),
27
39
  keys: ["y", "x", "equal", "C", "epower"],
28
40
  answerFormat: "tex",
29
- identifiers: { a: a, b: b },
41
+ identifiers,
30
42
  };
31
43
  return question;
32
44
  };
45
+ const getEquaDiffAyPlusBQuestion = () => {
46
+ const a = randint(-10, 11, [0]);
47
+ const b = randint(-10, 11);
48
+ const identifiers = { a: a, b: b };
49
+ return getQuestionFromIdentifiers(identifiers);
50
+ };
33
51
  const getPropositions = (n, { answer, a, b }) => {
34
52
  const propositions = [];
35
53
  addValidProp(propositions, answer);
@@ -70,13 +88,12 @@ const isAnswerValid = (ans, { a, b }) => {
70
88
  export const equaDiffAyPlusB = {
71
89
  id: "equaDiffAyPlusB",
72
90
  label: "Résoudre une équation différentielle du type $y' = ay + b$",
73
- levels: ["TermSpé", "MathComp"],
74
91
  isSingleStep: true,
75
- sections: ["Équations différentielles"],
76
92
  generator: (nb) => getDistinctQuestions(getEquaDiffAyPlusBQuestion, nb),
77
93
  qcmTimer: 60,
78
94
  freeTimer: 60,
79
95
  getPropositions,
80
96
  isAnswerValid,
81
97
  subject: "Mathématiques",
98
+ getQuestionFromIdentifiers,
82
99
  };
@@ -1 +1 @@
1
- {"version":3,"file":"equaDiffCheckSolutionFirstOrder.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AAkHF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAejE,CAAC"}
1
+ {"version":3,"file":"equaDiffCheckSolutionFirstOrder.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffCheckSolutionFirstOrder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB,CAAC;AAwHF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAejE,CAAC"}
@@ -65,7 +65,13 @@ const getEquaDiffCheckSolutionFirstOrderQuestion = () => {
65
65
  }
66
66
  const question = {
67
67
  answer,
68
- instruction: `Soit l'équation différentielle suivante : $${equaDiff.toTex()}$. La fonction $y = ${randomFunc.toTex()}$ est-elle solution de cette équation ?`,
68
+ instruction: `Soit l'équation différentielle suivante :
69
+
70
+ $$
71
+ ${equaDiff.toTex()}
72
+ $$
73
+
74
+ La fonction $y = ${randomFunc.toTex()}$ est-elle solution de cette équation ?`,
69
75
  keys: [],
70
76
  answerFormat: "tex",
71
77
  identifiers: { type, d, e, f },
@@ -1 +1 @@
1
- {"version":3,"file":"equaDiffGeneralForme.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffGeneralForme.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA6EF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAcjE,CAAC"}
1
+ {"version":3,"file":"equaDiffGeneralForme.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffGeneralForme.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmGF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAajE,CAAC"}
@@ -5,29 +5,53 @@ import { ExpNode } from "../../../tree/nodes/functions/expNode.js";
5
5
  import { NumberNode } from "../../../tree/nodes/numbers/numberNode.js";
6
6
  import { VariableNode } from "../../../tree/nodes/variables/variableNode.js";
7
7
  import { EqualNode } from "../../../tree/nodes/equations/equalNode.js";
8
- import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode.js";
8
+ import { multiply, MultiplyNode, } from "../../../tree/nodes/operators/multiplyNode.js";
9
9
  import { shuffle } from "../../../utils/alea/shuffle.js";
10
- import { SubstractNode } from "../../../tree/nodes/operators/substractNode.js";
11
- const getExponentialEquation = () => {
12
- const a = randint(-19, 20, [0]);
10
+ const getInstruction = (identifiers) => {
11
+ const { a } = identifiers;
13
12
  const equation = new MultiplyNode(new NumberNode(a), new VariableNode("y"));
13
+ return `Résoudre l'équation différentielle suivante :
14
+
15
+ $$
16
+ y' = ${equation.toTex()}
17
+ $$`;
18
+ };
19
+ const getAnswer = (identifiers) => {
20
+ const { a } = identifiers;
14
21
  const answer = new EqualNode(new VariableNode("y"), new MultiplyNode(new VariableNode("C"), new ExpNode(new MultiplyNode(new NumberNode(a), new VariableNode("x"))))).toTex();
15
- const correctionequation = new EqualNode(new SubstractNode(new VariableNode("y'"), new MultiplyNode(a.toTree(), new VariableNode("y"))).simplify(), new NumberNode(0)).toTex();
16
- const hint = "La solution générale d'une équation différentielle de la forme $y' = ay$ est de la forme $y = Ce^{ax}$, où $C$ est une constante d'intégration.";
17
- const correction = `La solution générale d'une équation différentielle de la forme $y' = ay$ est de la forme $y = Ce^{ax}$, où $C$ est une constante d'intégration.
18
- \n Donc, la solution générale de l'équation différentielle $y' = ${a}y$ est $y = Ce^{${a}x}$.`;
22
+ return answer;
23
+ };
24
+ const getHint = (identifiers) => {
25
+ return "La solution générale d'une équation différentielle de la forme $y' = ay$ est de la forme $y = Ce^{ax}$, où $C$ est une constante d'intégration.";
26
+ };
27
+ const getCorrection = (identifiers) => {
28
+ const { a } = identifiers;
29
+ return `La solution générale d'une équation différentielle de la forme $y' = ay$ est de la forme $y = Ce^{ax}$, où $C$ est une constante d'intégration.
30
+
31
+ Donc, la solution générale de l'équation différentielle $y' = ${multiply(a, "y").toTex()}$ est :
32
+
33
+ $$
34
+ y = Ce^{${multiply(a, "y").toTex()}}
35
+ $$`;
36
+ };
37
+ const getQuestionFromIdentifiers = (identifiers) => {
19
38
  const question = {
20
- instruction: `Résoudre l'équation différentielle suivante : $y' = ${equation.toTex()}$.`,
39
+ instruction: getInstruction(identifiers),
21
40
  startStatement: `y(x)`,
22
- answer,
23
- hint,
24
- correction,
41
+ answer: getAnswer(identifiers),
42
+ hint: getHint(identifiers),
43
+ correction: getCorrection(identifiers),
25
44
  keys: ["x", "y", "epower", "exp", "C", "equal"],
26
45
  answerFormat: "tex",
27
- identifiers: { a },
46
+ identifiers,
28
47
  };
29
48
  return question;
30
49
  };
50
+ const getExponentialEquation = () => {
51
+ const a = randint(-19, 20, [0]);
52
+ const identifiers = { a };
53
+ return getQuestionFromIdentifiers(identifiers);
54
+ };
31
55
  const getPropositions = (n, { answer }) => {
32
56
  const propositions = [];
33
57
  addValidProp(propositions, answer);
@@ -50,8 +74,6 @@ export const exponentialDifferentialEquation = {
50
74
  id: "exponentialDifferentialEquation",
51
75
  connector: "=",
52
76
  label: "Équation différentielle $y' = ay$",
53
- levels: ["1reSpé", "MathComp", "TermSpé"],
54
- sections: ["Équations différentielles"],
55
77
  isSingleStep: false,
56
78
  generator: (nb) => getDistinctQuestions(getExponentialEquation, nb),
57
79
  qcmTimer: 60,
@@ -60,4 +82,5 @@ export const exponentialDifferentialEquation = {
60
82
  isAnswerValid,
61
83
  subject: "Mathématiques",
62
84
  hasHintAndCorrection: true,
85
+ getQuestionFromIdentifiers,
63
86
  };
@@ -1 +1 @@
1
- {"version":3,"file":"equaDiffGeneralFormeWithIC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAyEF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAcvE,CAAC"}
1
+ {"version":3,"file":"equaDiffGeneralFormeWithIC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/equaDiffGeneralFormeWithIC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAqGF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAavE,CAAC"}
@@ -7,24 +7,46 @@ import { EqualNode } from "../../../tree/nodes/equations/equalNode.js";
7
7
  import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode.js";
8
8
  import { VariableNode } from "../../../tree/nodes/variables/variableNode.js";
9
9
  import { shuffle } from "../../../utils/alea/shuffle.js";
10
- const solveExponentialEquationWithIC = () => {
11
- const a = randint(-9, 10, [0]);
12
- const initialY = randint(-9, 10);
10
+ const getInstruction = (identifiers) => {
11
+ const { a, initialY } = identifiers;
13
12
  const myEquation = new MultiplyNode(new NumberNode(a), new VariableNode("y"));
13
+ return `Résoudre l'équation différentielle suivante :
14
+
15
+ $$
16
+ y' = ${myEquation.toTex()} \\ $ et $\\ y(0) = ${initialY}
17
+ $$`;
18
+ };
19
+ const getAnswer = (identifiers) => {
20
+ const { a, initialY } = identifiers;
14
21
  const solution = initialY === 0
15
22
  ? new NumberNode(0) // y(0) = 0 ==> y(x) = 0
16
23
  : new MultiplyNode(new NumberNode(initialY), new ExpNode(new MultiplyNode(new NumberNode(a), new VariableNode("x"))));
17
24
  const answer = new EqualNode(new VariableNode("y"), solution).toTex();
25
+ return answer;
26
+ };
27
+ const getHint = (identifiers) => {
28
+ return ``;
29
+ };
30
+ const getCorrection = (identifiers) => {
31
+ return ``;
32
+ };
33
+ const getQuestionFromIdentifiers = (identifiers) => {
18
34
  const question = {
19
- instruction: `Résoudre l'équation différentielle suivante : $y' = ${myEquation.toTex()} \\ $ et $\\ y(0) = ${initialY}$`,
35
+ instruction: getInstruction(identifiers),
20
36
  startStatement: `y(x)`,
21
- answer,
37
+ answer: getAnswer(identifiers),
22
38
  keys: ["x", "y", "epower", "exp", "equal"],
23
39
  answerFormat: "tex",
24
- identifiers: { a, initialY },
40
+ identifiers,
25
41
  };
26
42
  return question;
27
43
  };
44
+ const solveExponentialEquationWithIC = () => {
45
+ const a = randint(-9, 10, [0]);
46
+ const initialY = randint(-9, 10);
47
+ const identifiers = { a, initialY };
48
+ return getQuestionFromIdentifiers(identifiers);
49
+ };
28
50
  const getPropositions = (n, { answer }) => {
29
51
  const propositions = [];
30
52
  addValidProp(propositions, answer);
@@ -53,8 +75,6 @@ export const exponentialDifferentialEquationWithIC = {
53
75
  id: "exponentialDifferentialEquationWithIC",
54
76
  connector: "=",
55
77
  label: "Équation différentielle $y' = ay$ avec conditions initiales",
56
- levels: ["1reSpé", "MathComp", "TermSpé"],
57
- sections: ["Équations différentielles"],
58
78
  isSingleStep: false,
59
79
  generator: (nb) => getDistinctQuestions(solveExponentialEquationWithIC, nb),
60
80
  qcmTimer: 60,
@@ -62,4 +82,5 @@ export const exponentialDifferentialEquationWithIC = {
62
82
  getPropositions,
63
83
  isAnswerValid,
64
84
  subject: "Mathématiques",
85
+ getQuestionFromIdentifiers,
65
86
  };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ initialY: number;
5
+ };
6
+ export declare const exponentialDifferentialEquationWithIC: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=exponentialDifferentialEquationWithIC.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exponentialDifferentialEquationWithIC.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAqGF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAAC,WAAW,CAavE,CAAC"}
@@ -0,0 +1,86 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../math/utils/random/randint.js";
4
+ import { ExpNode } from "../../../tree/nodes/functions/expNode.js";
5
+ import { NumberNode } from "../../../tree/nodes/numbers/numberNode.js";
6
+ import { EqualNode } from "../../../tree/nodes/equations/equalNode.js";
7
+ import { MultiplyNode } from "../../../tree/nodes/operators/multiplyNode.js";
8
+ import { VariableNode } from "../../../tree/nodes/variables/variableNode.js";
9
+ import { shuffle } from "../../../utils/alea/shuffle.js";
10
+ const getInstruction = (identifiers) => {
11
+ const { a, initialY } = identifiers;
12
+ const myEquation = new MultiplyNode(new NumberNode(a), new VariableNode("y"));
13
+ return `Résoudre l'équation différentielle suivante :
14
+
15
+ $$
16
+ y' = ${myEquation.toTex()} \\text{ et } y(0) = ${initialY}
17
+ $$`;
18
+ };
19
+ const getAnswer = (identifiers) => {
20
+ const { a, initialY } = identifiers;
21
+ const solution = initialY === 0
22
+ ? new NumberNode(0) // y(0) = 0 ==> y(x) = 0
23
+ : new MultiplyNode(new NumberNode(initialY), new ExpNode(new MultiplyNode(new NumberNode(a), new VariableNode("x"))));
24
+ const answer = new EqualNode(new VariableNode("y"), solution).toTex();
25
+ return answer;
26
+ };
27
+ const getHint = (identifiers) => {
28
+ return ``;
29
+ };
30
+ const getCorrection = (identifiers) => {
31
+ return ``;
32
+ };
33
+ const getQuestionFromIdentifiers = (identifiers) => {
34
+ const question = {
35
+ instruction: getInstruction(identifiers),
36
+ startStatement: `y(x)`,
37
+ answer: getAnswer(identifiers),
38
+ keys: ["x", "y", "epower", "exp", "equal"],
39
+ answerFormat: "tex",
40
+ identifiers,
41
+ };
42
+ return question;
43
+ };
44
+ const solveExponentialEquationWithIC = () => {
45
+ const a = randint(-9, 10, [0]);
46
+ const initialY = randint(-9, 10);
47
+ const identifiers = { a, initialY };
48
+ return getQuestionFromIdentifiers(identifiers);
49
+ };
50
+ const getPropositions = (n, { answer }) => {
51
+ const propositions = [];
52
+ addValidProp(propositions, answer);
53
+ while (propositions.length < n) {
54
+ const a = randint(-9, 10, [0]);
55
+ const initialY = randint(-9, 10);
56
+ const solution = initialY === 0
57
+ ? new NumberNode(0) // y(0) = 0 ==> y(x) = 0
58
+ : new MultiplyNode(new NumberNode(initialY), new ExpNode(new MultiplyNode(new NumberNode(a), new VariableNode("x"))));
59
+ const wrongAnswer = new EqualNode(new VariableNode("y"), solution);
60
+ tryToAddWrongProp(propositions, wrongAnswer.toTex());
61
+ }
62
+ return shuffle(propositions);
63
+ };
64
+ const isAnswerValid = (ans, { a, initialY }) => {
65
+ const solution = initialY === 0
66
+ ? new NumberNode(0) // y(0) = 0 ==> y(x) = 0
67
+ : new MultiplyNode(new NumberNode(initialY), new ExpNode(new MultiplyNode(new NumberNode(a), new VariableNode("x"))));
68
+ const answer = new EqualNode(new VariableNode("y"), solution, {
69
+ allowRawRightChildAsSolution: true,
70
+ });
71
+ const texs = answer.toAllValidTexs();
72
+ return texs.includes(ans);
73
+ };
74
+ export const exponentialDifferentialEquationWithIC = {
75
+ id: "exponentialDifferentialEquationWithIC",
76
+ connector: "=",
77
+ label: "Équation différentielle $y' = ay$ avec conditions initiales",
78
+ isSingleStep: false,
79
+ generator: (nb) => getDistinctQuestions(solveExponentialEquationWithIC, nb),
80
+ qcmTimer: 60,
81
+ freeTimer: 60,
82
+ getPropositions,
83
+ isAnswerValid,
84
+ subject: "Mathématiques",
85
+ getQuestionFromIdentifiers,
86
+ };
@@ -1,5 +1,5 @@
1
1
  export * from "./equaDiffGeneralForme.js";
2
- export * from "./equaDiffGeneralFormeWithIC.js";
2
+ export * from "./exponentialDifferentialEquationWithIC.js";
3
3
  export * from "./equaDiffCheckSolutionFirstOrder.js";
4
4
  export * from "./equaDiffAyPlusB.js";
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/equaDiff/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,sCAAsC,CAAC;AACrD,cAAc,sBAAsB,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export * from "./equaDiffGeneralForme.js";
2
- export * from "./equaDiffGeneralFormeWithIC.js";
2
+ export * from "./exponentialDifferentialEquationWithIC.js";
3
3
  export * from "./equaDiffCheckSolutionFirstOrder.js";
4
4
  export * from "./equaDiffAyPlusB.js";
@@ -1 +1 @@
1
- {"version":3,"file":"signFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/signFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAmBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAgIF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAqB9C,CAAC"}
1
+ {"version":3,"file":"signFunction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/signFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAoBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AA2IF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAqB9C,CAAC"}