math-exercises 3.0.177 → 3.0.179

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 (255) hide show
  1. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts +14 -0
  2. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -0
  3. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +283 -0
  4. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts +15 -0
  5. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -0
  6. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +296 -0
  7. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +3 -3
  8. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts +14 -0
  9. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts.map +1 -0
  10. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.js +346 -0
  11. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts +15 -0
  12. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts.map +1 -0
  13. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.js +435 -0
  14. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts +13 -0
  15. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -0
  16. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +326 -0
  17. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts +14 -0
  18. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts.map +1 -0
  19. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.js +181 -0
  20. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts +10 -0
  21. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts.map +1 -0
  22. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.js +272 -0
  23. package/lib/exercises/math/derivation/problems/index.d.ts +5 -0
  24. package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -0
  25. package/lib/exercises/math/derivation/problems/index.js +4 -0
  26. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts +8 -0
  27. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts.map +1 -0
  28. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.js +171 -0
  29. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts +15 -0
  30. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -0
  31. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +328 -0
  32. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts +13 -0
  33. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -0
  34. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +275 -0
  35. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts +8 -0
  36. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts.map +1 -0
  37. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.js +137 -0
  38. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts +10 -0
  39. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -0
  40. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +478 -0
  41. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts +10 -0
  42. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts.map +1 -0
  43. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.js +499 -0
  44. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts +10 -0
  45. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts.map +1 -0
  46. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.js +240 -0
  47. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts +12 -0
  48. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts.map +1 -0
  49. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.js +436 -0
  50. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts +12 -0
  51. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts.map +1 -0
  52. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.js +219 -0
  53. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts +13 -0
  54. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts.map +1 -0
  55. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.js +273 -0
  56. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts +18 -0
  57. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts.map +1 -0
  58. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.js +295 -0
  59. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts +13 -0
  60. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -0
  61. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +388 -0
  62. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts +9 -0
  63. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts.map +1 -0
  64. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.js +308 -0
  65. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts +14 -0
  66. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -0
  67. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +439 -0
  68. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts +14 -0
  69. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -0
  70. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +547 -0
  71. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts +15 -0
  72. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -0
  73. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +537 -0
  74. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts +15 -0
  75. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -0
  76. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +639 -0
  77. package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.js +1 -1
  78. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts +14 -0
  79. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -0
  80. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +530 -0
  81. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts +10 -0
  82. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts.map +1 -0
  83. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.js +451 -0
  84. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts +11 -0
  85. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -0
  86. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +514 -0
  87. package/lib/exercises/math/functions/composition/index.d.ts +0 -1
  88. package/lib/exercises/math/functions/composition/index.d.ts.map +1 -1
  89. package/lib/exercises/math/functions/composition/index.js +1 -1
  90. package/lib/exercises/math/functions/exponential/algebraic/index.d.ts +0 -1
  91. package/lib/exercises/math/functions/exponential/algebraic/index.d.ts.map +1 -1
  92. package/lib/exercises/math/functions/exponential/algebraic/index.js +1 -1
  93. package/lib/exercises/math/functions/trinoms/sign/index.d.ts +1 -0
  94. package/lib/exercises/math/functions/trinoms/sign/index.d.ts.map +1 -1
  95. package/lib/exercises/math/functions/trinoms/sign/index.js +1 -0
  96. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts +8 -0
  97. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts.map +1 -0
  98. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.js +226 -0
  99. package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.d.ts.map +1 -1
  100. package/lib/exercises/math/geometry/angles/parallelogramFourthAngle.js +10 -10
  101. package/lib/exercises/math/geometry/quadrilaterals/parallelogramAngles.js +8 -8
  102. package/lib/exercises/math/geometry/triangles/similar/isSimilarTrianglesWithAngles.js +6 -6
  103. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.js +8 -8
  104. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +1 -1
  105. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +2 -2
  106. package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +2 -2
  107. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
  108. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +32 -17
  109. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts +13 -0
  110. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts.map +1 -0
  111. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.js +195 -0
  112. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts +9 -0
  113. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts.map +1 -0
  114. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.js +220 -0
  115. package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts +15 -0
  116. package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts.map +1 -0
  117. package/lib/exercises/math/probaStat/conditional/conditionalProbability.js +332 -0
  118. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts +8 -0
  119. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts.map +1 -0
  120. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.js +222 -0
  121. package/lib/exercises/math/probaStat/conditional/index.d.ts +5 -0
  122. package/lib/exercises/math/probaStat/conditional/index.d.ts.map +1 -0
  123. package/lib/exercises/math/probaStat/conditional/index.js +4 -0
  124. package/lib/exercises/math/probaStat/index.d.ts +1 -2
  125. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  126. package/lib/exercises/math/probaStat/index.js +1 -2
  127. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts +1 -0
  128. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  129. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +26 -199
  130. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  131. package/lib/exercises/math/probaStat/randomVariable/index.js +1 -0
  132. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
  133. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +6 -2
  134. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
  135. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +6 -5
  136. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
  137. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +4 -27
  138. package/lib/exercises/math/probaStat/twoEventsSituations.d.ts +29 -0
  139. package/lib/exercises/math/probaStat/twoEventsSituations.d.ts.map +1 -0
  140. package/lib/exercises/math/probaStat/twoEventsSituations.js +145 -0
  141. package/lib/exercises/math/python/index.d.ts +1 -0
  142. package/lib/exercises/math/python/index.d.ts.map +1 -1
  143. package/lib/exercises/math/python/index.js +1 -0
  144. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts.map +1 -1
  145. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.js +11 -8
  146. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map +1 -1
  147. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.js +4 -3
  148. package/lib/exercises/math/sequences/arithmetic/index.d.ts +4 -3
  149. package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
  150. package/lib/exercises/math/sequences/arithmetic/index.js +4 -3
  151. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts.map +1 -1
  152. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.js +3 -2
  153. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -1
  154. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +8 -6
  155. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts.map +1 -1
  156. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.js +6 -5
  157. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts +0 -2
  158. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts.map +1 -1
  159. package/lib/exercises/math/sequences/arithmetic/situations/index.js +2 -2
  160. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts +1 -0
  161. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts.map +1 -1
  162. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.js +65 -14
  163. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts +0 -1
  164. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts.map +1 -1
  165. package/lib/exercises/math/sequences/arithmetic/sum/index.js +1 -1
  166. package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts +4 -1
  167. package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts.map +1 -1
  168. package/lib/exercises/math/sequences/explicitFormulaUsage.js +47 -7
  169. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts +14 -0
  170. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts.map +1 -0
  171. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.js +291 -0
  172. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts.map +1 -1
  173. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.js +4 -3
  174. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.d.ts +15 -0
  175. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.d.ts.map +1 -0
  176. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.js +249 -0
  177. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +2 -2
  178. package/lib/exercises/math/sequences/geometric/index.d.ts +3 -2
  179. package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
  180. package/lib/exercises/math/sequences/geometric/index.js +6 -2
  181. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts.map +1 -1
  182. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.js +3 -2
  183. package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.js +1 -1
  184. package/lib/exercises/math/sequences/geometric/situations/index.d.ts +0 -1
  185. package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -1
  186. package/lib/exercises/math/sequences/geometric/situations/index.js +1 -1
  187. package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.js +2 -2
  188. package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.js +2 -2
  189. package/lib/exercises/math/sequences/index.d.ts +1 -0
  190. package/lib/exercises/math/sequences/index.d.ts.map +1 -1
  191. package/lib/exercises/math/sequences/index.js +1 -0
  192. package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts +5 -1
  193. package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
  194. package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +89 -9
  195. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts.map +1 -1
  196. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.js +5 -9
  197. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +1 -1
  198. package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts.map +1 -1
  199. package/lib/exercises/math/trigonometry/circle/associatePoint.js +55 -6
  200. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -1
  201. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +5 -6
  202. package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.d.ts.map +1 -1
  203. package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.js +1 -3
  204. package/lib/exercises/math/trigonometry/triangle/trigonometryAngleCalcul.js +2 -2
  205. package/lib/exercises/pc/snellDescartes.js +2 -2
  206. package/lib/exercises/vea/polynomialVEA.d.ts +2 -0
  207. package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -0
  208. package/lib/exercises/vea/polynomialVEA.js +17 -0
  209. package/lib/exercises/vea/valueTableVEA.d.ts +8 -0
  210. package/lib/exercises/vea/valueTableVEA.d.ts.map +1 -0
  211. package/lib/exercises/vea/valueTableVEA.js +12 -0
  212. package/lib/index.d.ts +152 -41
  213. package/lib/index.d.ts.map +1 -1
  214. package/lib/latexTester.d.ts.map +1 -1
  215. package/lib/latexTester.js +9 -6
  216. package/lib/math/polynomials/affine.d.ts +1 -0
  217. package/lib/math/polynomials/affine.d.ts.map +1 -1
  218. package/lib/math/polynomials/affine.js +5 -0
  219. package/lib/math/utils/arithmetic/primeFactors.js +1 -1
  220. package/lib/math/utils/functions/functionComposition.d.ts.map +1 -1
  221. package/lib/math/utils/functions/functionComposition.js +18 -1
  222. package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts +19 -0
  223. package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts.map +1 -0
  224. package/lib/math/utils/polynomial/polynomialInterpolationUtils.js +53 -0
  225. package/lib/math/utils/polynomial/polynomialUtils.d.ts +37 -0
  226. package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -0
  227. package/lib/math/utils/polynomial/polynomialUtils.js +223 -0
  228. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts +18 -4
  229. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
  230. package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +434 -333
  231. package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -1
  232. package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +3 -1
  233. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts +5 -0
  234. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -1
  235. package/lib/math/utils/sequences/situations/seqGeometricSituations.js +58 -25
  236. package/lib/prototypesEnhancement.d.ts +1 -0
  237. package/lib/prototypesEnhancement.d.ts.map +1 -1
  238. package/lib/prototypesEnhancement.js +3 -0
  239. package/lib/tests/pdfs/mdCodeToLatex.d.ts.map +1 -1
  240. package/lib/tests/pdfs/mdCodeToLatex.js +8 -15
  241. package/lib/tests/questionTest.d.ts.map +1 -1
  242. package/lib/tests/questionTest.js +6 -3
  243. package/lib/tree/nodes/geometry/degree.js +1 -1
  244. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  245. package/lib/tree/nodes/operators/multiplyNode.js +1 -1
  246. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  247. package/lib/tree/nodes/operators/substractNode.js +2 -1
  248. package/lib/tree/parsers/degreeParser.js +2 -2
  249. package/lib/tree/utilities/nodeUtils.d.ts +6 -0
  250. package/lib/tree/utilities/nodeUtils.d.ts.map +1 -0
  251. package/lib/tree/utilities/nodeUtils.js +24 -0
  252. package/lib/utils/strings/prependArticle.d.ts +2 -0
  253. package/lib/utils/strings/prependArticle.d.ts.map +1 -0
  254. package/lib/utils/strings/prependArticle.js +1 -0
  255. package/package.json +1 -1
@@ -122,7 +122,7 @@ const getInstruction = (identifiers, optsIn) => {
122
122
  const firstRank = opts.firstTermRankOne ? 1 : 0;
123
123
  const { isUsePythonList, typeSequence } = opts;
124
124
  const { valueLimit } = identifiers;
125
- return `On considère une suite $(u_{n})$ positive, strictement croissante et ${typeSequence}.
125
+ return `On considère une suite $(u_{n})$ positive et strictement croissante.
126
126
  ${typeSequence === "convergente"
127
127
  ? `Sa limite vaut $${valueLimit.frenchify()}$.`
128
128
  : ``}
@@ -420,16 +420,19 @@ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
420
420
  }
421
421
  return shuffleProps(propositions, n);
422
422
  };
423
- const createRandomIdentifiers = (_opts) => {
423
+ const createRandomIdentifiers = (opts) => {
424
424
  const valueThreshold = randfloat(100, 200, 1);
425
425
  const valueLimit = randfloat(0, 200, 1, [0]);
426
426
  const nodeDistanceMax = power(10, randint(-8, -1));
427
- const keyIncomplete = random([
428
- "strInitialization",
429
- "strWhile",
430
- "strLoopBody",
431
- "strPrint",
432
- ]);
427
+ // const keyIncomplete = random([
428
+ // "strInitialization",
429
+ // "strWhile",
430
+ // "strLoopBody",
431
+ // "strPrint",
432
+ // ]);
433
+ const keyIncomplete = opts.isUsePythonDef
434
+ ? random(["strWhile", "strPrint"])
435
+ : "strWhile";
433
436
  const identifiers = {
434
437
  valueThreshold,
435
438
  valueLimit,
@@ -1 +1 @@
1
- {"version":3,"file":"arithmeticFindExplicitFormulaFromTwoTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAiB3D,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwOF,KAAK,OAAO,GAAG,sBAAsB,CAAC;AAMtC,eAAO,MAAM,yCAAyC,EAAE,QAAQ,CAC9D,WAAW,EACX,OAAO,CAoBR,CAAC"}
1
+ {"version":3,"file":"arithmeticFindExplicitFormulaFromTwoTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAiB3D,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA4OF,KAAK,OAAO,GAAG,sBAAsB,CAAC;AAMtC,eAAO,MAAM,yCAAyC,EAAE,QAAQ,CAC9D,WAAW,EACX,OAAO,CAoBR,CAAC"}
@@ -117,10 +117,12 @@ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
117
117
  const isAnswerValid = (ans, { answer, ...identifiers }, optsIn) => {
118
118
  const opts = optsIn ?? optsDefault;
119
119
  try {
120
+ //TODO faire fonctionner parseAlgebraic("u_n=3+2n") (token _ not implemented)
121
+ const nodeAnswer = getAnswerNode(identifiers, opts);
120
122
  if (!ans.includes("=")) {
121
- return false;
123
+ // return false;
124
+ ans = nodeAnswer.leftChild.toTex() + "=" + ans;
122
125
  }
123
- //TODO faire fonctionner parseAlgebraic("u_n=3+2n") (token _ not implemented)
124
126
  // const nodeAns = parseAlgebraic(ans);
125
127
  const nodeAns = (() => {
126
128
  const [lhs, rhs] = ans.split("=");
@@ -131,7 +133,6 @@ const isAnswerValid = (ans, { answer, ...identifiers }, optsIn) => {
131
133
  if (!isEqualNode(nodeAns)) {
132
134
  return false;
133
135
  }
134
- const nodeAnswer = getAnswerNode(identifiers, opts);
135
136
  const isValidLhs = () => nodeAns.leftChild.toTex() === nodeAnswer.leftChild.toTex();
136
137
  const isValidRhs = () => {
137
138
  const nodeAnsRhs = nodeAns.rightChild;
@@ -5,17 +5,18 @@ export * from "./arithmeticFindReason.js";
5
5
  export * from "./arithmeticReasonUsage.js";
6
6
  export * from "./arithmeticRecurrenceFormulaUsage.js";
7
7
  export * from "./arithmeticThresholdFind.js";
8
- export * from "./firstIntegersSum.js";
9
8
  export * from "./recognizeArithmeticFromFirstTerms.js";
10
9
  export * from "./recognizeReasonFromFirstTerms.js";
11
10
  export * from "./recognizeReasonFromGraph.js";
12
11
  export * from "./recognizeArithmeticFromGraph.js";
13
- export * from "./arithmeticFirstTermsSum.js";
14
12
  export * from "./arithmeticFindExplicitFormulaFirstTermRandom.js";
15
13
  export * from "./arithmeticFindReasonRandomRange.js";
16
- export * from "./arithmeticFindRandomTermFromTwoTerms.js";
17
14
  export * from "./arithmeticFindTerm.js";
18
15
  export * from "./arithmeticFindTermFirstRankOne.js";
19
16
  export * from "./arithmeticFindAntecedent.js";
17
+ export * from "./arithmeticFindRandomTermFromTwoTerms.js";
18
+ export * from "./arithmeticFindExplicitFormulaFromTwoTerms.js";
19
+ export * from "./situations/index.js";
20
+ export * from "./sum/index.js";
20
21
  export * from "./arithmeticVariations.js";
21
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AAEpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yBAAyB,CAAC;AACxC,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AAEpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC;AACrD,cAAc,yBAAyB,CAAC;AACxC,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAE9C,cAAc,2CAA2C,CAAC;AAC1D,cAAc,gDAAgD,CAAC;AAE/D,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,2BAA2B,CAAC"}
@@ -5,16 +5,17 @@ export * from "./arithmeticFindReason.js";
5
5
  export * from "./arithmeticReasonUsage.js";
6
6
  export * from "./arithmeticRecurrenceFormulaUsage.js";
7
7
  export * from "./arithmeticThresholdFind.js";
8
- export * from "./firstIntegersSum.js";
9
8
  export * from "./recognizeArithmeticFromFirstTerms.js";
10
9
  export * from "./recognizeReasonFromFirstTerms.js";
11
10
  export * from "./recognizeReasonFromGraph.js";
12
11
  export * from "./recognizeArithmeticFromGraph.js";
13
- export * from "./arithmeticFirstTermsSum.js";
14
12
  export * from "./arithmeticFindExplicitFormulaFirstTermRandom.js";
15
13
  export * from "./arithmeticFindReasonRandomRange.js";
16
- export * from "./arithmeticFindRandomTermFromTwoTerms.js";
17
14
  export * from "./arithmeticFindTerm.js";
18
15
  export * from "./arithmeticFindTermFirstRankOne.js";
19
16
  export * from "./arithmeticFindAntecedent.js";
17
+ export * from "./arithmeticFindRandomTermFromTwoTerms.js";
18
+ export * from "./arithmeticFindExplicitFormulaFromTwoTerms.js";
19
+ export * from "./situations/index.js";
20
+ export * from "./sum/index.js";
20
21
  export * from "./arithmeticVariations.js";
@@ -1 +1 @@
1
- {"version":3,"file":"arithmeticFindExplicitFormulaFromSituation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wDAAwD,CAAC;AAGhE,OAAO,EAEL,kCAAkC,EAEnC,MAAM,kEAAkE,CAAC;AAgB1E,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,kCAAkC,CAAC;CACtD,CAAC;AA+MF,KAAK,OAAO,GAAG,sBAAsB,GAAG,2BAA2B,CAAC;AAcpE,eAAO,MAAM,0CAA0C,EAAE,QAAQ,CAC/D,WAAW,EACX,OAAO,CAoBR,CAAC"}
1
+ {"version":3,"file":"arithmeticFindExplicitFormulaFromSituation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wDAAwD,CAAC;AAGhE,OAAO,EAEL,kCAAkC,EAEnC,MAAM,kEAAkE,CAAC;AAgB1E,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,kCAAkC,CAAC;CACtD,CAAC;AAkNF,KAAK,OAAO,GAAG,sBAAsB,GAAG,2BAA2B,CAAC;AAcpE,eAAO,MAAM,0CAA0C,EAAE,QAAQ,CAC/D,WAAW,EACX,OAAO,CAoBR,CAAC"}
@@ -68,8 +68,10 @@ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
68
68
  const isAnswerValid = (ans, { answer, ...identifiers }, optsIn) => {
69
69
  const opts = optsIn ?? optsDefault;
70
70
  try {
71
+ const nodeAnswer = getAnswerNode(identifiers, opts);
71
72
  if (!ans.includes("=")) {
72
- return false;
73
+ // return false;
74
+ ans = nodeAnswer.leftChild.toTex() + "=" + ans;
73
75
  }
74
76
  //TODO faire fonctionner parseAlgebraic("u_n=3+2n") (token _ not implemented)
75
77
  // const nodeAns = parseAlgebraic(ans);
@@ -82,7 +84,6 @@ const isAnswerValid = (ans, { answer, ...identifiers }, optsIn) => {
82
84
  if (!isEqualNode(nodeAns)) {
83
85
  return false;
84
86
  }
85
- const nodeAnswer = getAnswerNode(identifiers, opts);
86
87
  const isValidLhs = () => nodeAns.leftChild.toTex() === nodeAnswer.leftChild.toTex();
87
88
  const isValidRhs = () => {
88
89
  const nodeAnsRhs = nodeAns.rightChild;
@@ -1 +1 @@
1
- {"version":3,"file":"arithmeticFindRankFromSituation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wDAAwD,CAAC;AAKhE,OAAO,EAEL,kCAAkC,EAEnC,MAAM,kEAAkE,CAAC;AAK1E,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,kCAAkC,CAAC;IACrD,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA6NF,KAAK,OAAO,GAAG,sBAAsB,GAAG,2BAA2B,CAAC;AAcpE,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmB1E,CAAC"}
1
+ {"version":3,"file":"arithmeticFindRankFromSituation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wDAAwD,CAAC;AAKhE,OAAO,EAEL,kCAAkC,EAEnC,MAAM,kEAAkE,CAAC;AAM1E,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,kCAAkC,CAAC;IACrD,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAsOF,KAAK,OAAO,GAAG,sBAAsB,GAAG,2BAA2B,CAAC;AAcpE,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAmB1E,CAAC"}
@@ -17,13 +17,14 @@ const getInstruction = (identifiers, optsIn) => {
17
17
  const situation = situations[situationIndex];
18
18
  return `${situation.getStrSituation(initial, reason, firstRank, superfluousData)}
19
19
 
20
- ${situation.variationFindRank.getStrQuestion(initial, reason, firstRank, valueAsked)}`;
20
+ ${situation.variationFindRank.getStrQuestion(initial, reason, firstRank, valueAsked, situation.rankDecoder)}`;
21
21
  };
22
22
  const getAnswerNode = (identifiers, opts) => {
23
23
  const firstRank = opts?.firstTermRankOne ? 1 : 0;
24
24
  const { situationIndex, initial, reason, valueAsked } = identifiers;
25
25
  const situation = situations[situationIndex];
26
- return situation.variationFindRank.getAnswerNode(initial, reason, firstRank, valueAsked);
26
+ const rankDecoder = situation.rankDecoder;
27
+ return situation.variationFindRank.getAnswerStuff(initial, reason, firstRank, valueAsked, rankDecoder).answerNode;
27
28
  };
28
29
  const getAnswer = (identifiers, optsIn) => {
29
30
  const opts = optsIn ?? optsDefault;
@@ -41,7 +42,7 @@ const getCorrection = (identifiers, optsIn) => {
41
42
  const firstRank = opts?.firstTermRankOne ? 1 : 0;
42
43
  const { situationIndex, initial, reason, valueAsked } = identifiers;
43
44
  const situation = situations[situationIndex];
44
- return situation.variationFindRank.getCorrectionStuff(initial, reason, firstRank, valueAsked).str;
45
+ return situation.variationFindRank.getCorrectionStuff(initial, reason, firstRank, valueAsked, situation.rankDecoder).str;
45
46
  };
46
47
  const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
47
48
  const opts = optsIn ?? optsDefault;
@@ -57,9 +58,10 @@ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
57
58
  tryToAddWrongProp(propositions, nodeWrong.simplify().toTex());
58
59
  arrNodeWrong.push(nodeWrong);
59
60
  }
60
- const rankValid = round(situation.variationFindRank
61
- .getAnswerNode(initial, reason, firstRank, valueAsked)
62
- .evaluate(), 0);
61
+ const rankValid = (() => {
62
+ const { rankNode } = situation.variationFindRank.getAnswerStuff(initial, reason, firstRank, valueAsked);
63
+ return round(rankNode.evaluate(), 0);
64
+ })();
63
65
  //pseudo terror
64
66
  if (coinFlip()) {
65
67
  if (coinFlip()) {
@@ -1 +1 @@
1
- {"version":3,"file":"arithmeticFindThresholdFromSituation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wDAAwD,CAAC;AAGhE,OAAO,EACL,gBAAgB,EAGjB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAEL,kCAAkC,EAEnC,MAAM,kEAAkE,CAAC;AAK1E,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,kCAAkC,CAAC;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;CAC9B,CAAC;AAyPF,KAAK,OAAO,GAAG,sBAAsB,GAAG,2BAA2B,CAAC;AAcpE,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CACzD,WAAW,EACX,OAAO,CAoBR,CAAC"}
1
+ {"version":3,"file":"arithmeticFindThresholdFromSituation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wDAAwD,CAAC;AAGhE,OAAO,EACL,gBAAgB,EAGjB,MAAM,sCAAsC,CAAC;AAG9C,OAAO,EAEL,kCAAkC,EAEnC,MAAM,kEAAkE,CAAC;AAM1E,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,kCAAkC,CAAC;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;CAC9B,CAAC;AA0PF,KAAK,OAAO,GAAG,sBAAsB,GAAG,2BAA2B,CAAC;AAcpE,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CACzD,WAAW,EACX,OAAO,CAoBR,CAAC"}
@@ -26,7 +26,7 @@ const getAnswerNode = (identifiers, opts) => {
26
26
  const { situationIndex, initial, reason, valueThreshold, inegSymbol } = identifiers;
27
27
  const situation = situations[situationIndex];
28
28
  const inequationSymbol = new InequationSymbol(inegSymbol);
29
- return situation.variationFindThreshold.getAnswerNode(initial, reason, firstRank, valueThreshold, inequationSymbol);
29
+ return situation.variationFindThreshold.getAnswerStuff(initial, reason, firstRank, valueThreshold, inequationSymbol, situation.rankDecoder).answerNode;
30
30
  };
31
31
  const getAnswer = (identifiers, optsIn) => {
32
32
  const opts = optsIn ?? optsDefault;
@@ -46,7 +46,7 @@ const getCorrection = (identifiers, optsIn) => {
46
46
  const { situationIndex, initial, reason, valueThreshold, inegSymbol } = identifiers;
47
47
  const situation = situations[situationIndex];
48
48
  const inequationSymbol = new InequationSymbol(inegSymbol);
49
- return situation.variationFindThreshold.getCorrectionStuff(initial, reason, firstRank, valueThreshold, inequationSymbol).str;
49
+ return situation.variationFindThreshold.getCorrectionStuff(initial, reason, firstRank, valueThreshold, inequationSymbol, situation.rankDecoder).str;
50
50
  };
51
51
  const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
52
52
  const opts = optsIn ?? optsDefault;
@@ -57,9 +57,10 @@ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
57
57
  const propositions = [];
58
58
  addValidProp(propositions, answer);
59
59
  const arrNodeWrong = [];
60
- const rankValid = round(situation.variationFindThreshold
61
- .getAnswerNode(initial, reason, firstRank, valueThreshold, inequationSymbol)
62
- .evaluate(), 0);
60
+ const rankValid = (() => {
61
+ const { rankNode } = situation.variationFindRank.getAnswerStuff(initial, reason, firstRank, valueThreshold, inequationSymbol);
62
+ return round(rankNode.evaluate(), 0);
63
+ })();
63
64
  //student: gives u[threshold] instead of threshold
64
65
  {
65
66
  const nodeWrong = situation.variationFindRandomTerm.getAnswerNode(initial, reason, firstRank, rankValid);
@@ -1,6 +1,4 @@
1
1
  export * from "./arithmeticFindExplicitFormulaFromSituation.js";
2
2
  export * from "./arithmeticFindRecurrenceFormulaFromSituation.js";
3
3
  export * from "./arithmeticFindTermFromSituation.js";
4
- export * from "./arithmeticFindRankFromSituation.js";
5
- export * from "./arithmeticFindThresholdFromSituation.js";
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/situations/index.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC;AAChE,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/situations/index.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC;AAChE,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  export * from "./arithmeticFindExplicitFormulaFromSituation.js";
2
2
  export * from "./arithmeticFindRecurrenceFormulaFromSituation.js";
3
3
  export * from "./arithmeticFindTermFromSituation.js";
4
- export * from "./arithmeticFindRankFromSituation.js";
5
- export * from "./arithmeticFindThresholdFromSituation.js";
4
+ // export * from "./arithmeticFindRankFromSituation.js";
5
+ // export * from "./arithmeticFindThresholdFromSituation.js";
@@ -9,6 +9,7 @@ type Identifiers = {
9
9
  };
10
10
  type Options = OptionFirstTermRankOne & {
11
11
  isGiveCount: boolean;
12
+ isForceWriteSumWithPlusSymbol: boolean;
12
13
  };
13
14
  export declare const arithmeticComputeSumWithDots: Exercise<Identifiers, Options>;
14
15
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"arithmeticComputeSumWithDots.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAwE3D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AA4NF,KAAK,OAAO,GAAG,sBAAsB,GAAG;IAAE,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC;AAiBjE,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBvE,CAAC"}
1
+ {"version":3,"file":"arithmeticComputeSumWithDots.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AA0H3D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAiOF,KAAK,OAAO,GAAG,sBAAsB,GAAG;IACtC,WAAW,EAAE,OAAO,CAAC;IACrB,6BAA6B,EAAE,OAAO,CAAC;CACxC,CAAC;AAyBF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBvE,CAAC"}
@@ -8,30 +8,69 @@ import { frac } from "../../../../../tree/nodes/operators/fractionNode.js";
8
8
  import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
9
9
  import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
10
10
  import { alignTex } from "../../../../../utils/latex/alignTex.js";
11
- const strForValue = (v) => {
12
- return v < 0 ? `(${v.frenchify()})` : `${v.frenchify()}`;
13
- };
14
11
  const valueForRank = (initial, reason, rank) => {
15
12
  return initial + reason * rank;
16
13
  };
17
- const strSumWithDots = (initial, reason, firstRank, lowRankDots, highRankDots, lastRank) => {
14
+ const strSumWithDots = (initial, reason, firstRank, lowRankDots, highRankDots, lastRank, isForcePlusSymbol) => {
18
15
  const arrRankStart = [...Array(lowRankDots - firstRank).keys()].map((i) => i + firstRank);
19
16
  const arrRankEnd = [...Array(lastRank - highRankDots).keys()].map((i) => i + highRankDots + 1);
20
- const [arrValueStart, arrValueEnd] = [arrRankStart, arrRankEnd].map((arrRank) => arrRank.map((rank) => strForValue(valueForRank(initial, reason, rank))));
21
- const [strStart, strEnd] = [arrValueStart, arrValueEnd].map((arrValue) => arrValue.join(" + "));
22
- const strFlat = [strStart, strEnd].join(` + \\ldots + `);
23
17
  const maxStrLength = 40;
24
- if (strFlat.length < maxStrLength) {
25
- return `
18
+ if (isForcePlusSymbol) {
19
+ const strForValue = (v) => {
20
+ return v < 0 ? `(${v.frenchify()})` : `${v.frenchify()}`;
21
+ };
22
+ const [arrStrValueStart, arrStrValueEnd] = [arrRankStart, arrRankEnd].map((arrRank) => arrRank.map((rank) => strForValue(valueForRank(initial, reason, rank))));
23
+ const [strStart, strEnd] = [arrStrValueStart, arrStrValueEnd].map((arrValue) => arrValue.join(" + "));
24
+ const strFlat = [strStart, strEnd].join(` + \\ldots + `);
25
+ if (strFlat.length < maxStrLength) {
26
+ return `
26
27
 
27
28
  $$
28
29
  ${strFlat}
29
30
  $$
30
31
 
31
32
  `;
33
+ }
34
+ else {
35
+ return `
36
+
37
+ $$
38
+ ${strStart}
39
+ $$
40
+
41
+ $$
42
+ + \\ldots
43
+ $$
44
+
45
+ $$
46
+ + \\ ${strEnd}
47
+ $$
48
+
49
+ `;
50
+ }
32
51
  }
33
52
  else {
34
- return `
53
+ const strForValue = (v, isForceShowSymbol) => {
54
+ return isForceShowSymbol
55
+ ? v >= 0
56
+ ? `+ ${v.frenchify()}`
57
+ : `${v.frenchify()}`
58
+ : v;
59
+ };
60
+ const [arrStrValueStart, arrStrValueEnd] = [arrRankStart, arrRankEnd].map((arrRank, j) => arrRank.map((rank, i) => strForValue(valueForRank(initial, reason, rank), i !== 0 || j === 1)));
61
+ const [strStart, strEnd] = [arrStrValueStart, arrStrValueEnd].map((arrValue) => arrValue.join(" "));
62
+ const strFlat = [strStart, strEnd].join(` + \\ldots `);
63
+ if (strFlat.length < maxStrLength) {
64
+ return `
65
+
66
+ $$
67
+ ${strFlat}
68
+ $$
69
+
70
+ `;
71
+ }
72
+ else {
73
+ return `
35
74
 
36
75
  $$
37
76
  ${strStart}
@@ -42,15 +81,16 @@ $$
42
81
  $$
43
82
 
44
83
  $$
45
- + \\ ${strEnd}
84
+ ${strEnd}
46
85
  $$
47
86
 
48
87
  `;
88
+ }
49
89
  }
50
90
  };
51
91
  const getInstruction = (identifiers, optsIn) => {
52
92
  const opts = optsIn ?? optsDefault;
53
- const { isGiveCount } = opts;
93
+ const { isGiveCount, isForceWriteSumWithPlusSymbol } = opts;
54
94
  const firstRank = opts.firstTermRankOne ? 1 : 0;
55
95
  const { initial, reason, nbTerms, lowRankDots, highRankDots } = identifiers;
56
96
  const lastRank = firstRank + nbTerms - 1;
@@ -60,7 +100,7 @@ Calculer la somme des premiers termes de $u$ ${isGiveCount
60
100
  ? `(la somme contient en tout $${nbTerms.frenchify()}$ termes)`
61
101
  : ""}:
62
102
 
63
- ${strSumWithDots(initial, reason, firstRank, lowRankDots, highRankDots, lastRank)}
103
+ ${strSumWithDots(initial, reason, firstRank, lowRankDots, highRankDots, lastRank, isForceWriteSumWithPlusSymbol)}
64
104
 
65
105
  `;
66
106
  };
@@ -97,6 +137,9 @@ const getCorrection = (identifiers, optsIn) => {
97
137
  const lastRank = firstRank + nbTerms - 1;
98
138
  const lastValue = valueForRank(initial, reason, lastRank);
99
139
  const answerNode = getAnswerNode(identifiers, opts);
140
+ const strForValue = (v) => {
141
+ return v < 0 ? `(${v.frenchify()})` : `${v.frenchify()}`;
142
+ };
100
143
  return `La somme $S$ des $n$ premiers termes d'une suite arithmétique s'obtient par la formule :
101
144
 
102
145
  $$
@@ -205,16 +248,24 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
205
248
  const { optsDefaultFirstTermRankOne, generatorOptionFirstTermRankOne } = getOptionFirstTermRankOneStuff(false);
206
249
  const optsDefault = Object.assign({}, optsDefaultFirstTermRankOne, {
207
250
  isGiveCount: true,
251
+ isForceWriteSumWithPlusSymbol: false,
208
252
  });
209
253
  const options = [
210
254
  generatorOptionFirstTermRankOne,
211
255
  {
212
256
  id: "isGiveCount",
213
- label: "Donner $n$",
257
+ label: "Donner le nombre de termes de la somme dans la consigne",
214
258
  target: GeneratorOptionTarget.generation,
215
259
  type: GeneratorOptionType.checkbox,
216
260
  defaultValue: optsDefault.isGiveCount,
217
261
  },
262
+ {
263
+ id: "isForceWriteSumWithPlusSymbol",
264
+ label: "Forcer l'écriture de la somme avec des symboles $+$",
265
+ target: GeneratorOptionTarget.generation,
266
+ type: GeneratorOptionType.checkbox,
267
+ defaultValue: optsDefault.isForceWriteSumWithPlusSymbol,
268
+ },
218
269
  ];
219
270
  export const arithmeticComputeSumWithDots = {
220
271
  id: "arithmeticComputeSumWithDots",
@@ -1,5 +1,4 @@
1
1
  export * from "./firstIntegersSum.js";
2
2
  export * from "./arithmeticFirstTermsSum.js";
3
3
  export * from "./arithmeticComputeSumWithDots.js";
4
- export * from "./arithmeticFirstTermsSumThreshold.js";
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/sum/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/sum/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export * from "./firstIntegersSum.js";
2
2
  export * from "./arithmeticFirstTermsSum.js";
3
3
  export * from "./arithmeticComputeSumWithDots.js";
4
- export * from "./arithmeticFirstTermsSumThreshold.js";
4
+ // export * from "./arithmeticFirstTermsSumThreshold.js";
@@ -3,6 +3,9 @@ type Identifiers = {
3
3
  rank: number;
4
4
  coeffs: number[];
5
5
  };
6
- export declare const explicitFormulaUsage: Exercise<Identifiers>;
6
+ type Options = {
7
+ functionType: string[];
8
+ };
9
+ export declare const explicitFormulaUsage: Exercise<Identifiers, Options>;
7
10
  export {};
8
11
  //# sourceMappingURL=explicitFormulaUsage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"explicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/explicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAyDF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAatD,CAAC"}
1
+ {"version":3,"file":"explicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/explicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA2FF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAWF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe/D,CAAC"}
@@ -1,7 +1,9 @@
1
- import { shuffleProps, tryToAddWrongProp, addValidProp, propWhile, } from "../../../exercises/exercise.js";
1
+ import { shuffleProps, tryToAddWrongProp, addValidProp, propWhile, GeneratorOptionTarget, GeneratorOptionType, } from "../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { AffineConstructor } from "../../../math/polynomials/affine.js";
3
4
  import { Polynomial, PolynomialConstructor, } from "../../../math/polynomials/polynomial.js";
4
5
  import { randint } from "../../../math/utils/random/randint.js";
6
+ import { random } from "../../../utils/alea/random.js";
5
7
  const getInstruction = (identifiers) => {
6
8
  const { rank, coeffs } = identifiers;
7
9
  const u = new Polynomial(coeffs, "n");
@@ -19,18 +21,44 @@ const getAnswer = (identifiers) => {
19
21
  const answer = u.calculate(rank) + "";
20
22
  return answer;
21
23
  };
24
+ const getHint = (identifiers) => {
25
+ return `La suite est donnée sous forme explicite.
26
+
27
+ Remplace $n$ par $${identifiers.rank}$ dans la formule donnée.`;
28
+ };
29
+ const getCorrection = (identifiers) => {
30
+ const { coeffs, rank } = identifiers;
31
+ const u = new Polynomial(coeffs, "n");
32
+ return `La suite étant donnée sous forme explicite, il suffit de remplacer $n$ par $${rank}$ dans la formule :
33
+
34
+ $$
35
+ u_{${rank}} = ${u.toTree().toDetailedEvaluation({ n: rank.toTree() }).toTex()}
36
+ $$
37
+
38
+ donc
39
+
40
+ $$
41
+ u_{${rank}} = ${getAnswer(identifiers)}
42
+ $$`;
43
+ };
22
44
  const getQuestionFromIdentifiers = (identifiers) => {
23
- const question = {
45
+ return {
24
46
  answer: getAnswer(identifiers),
25
47
  instruction: getInstruction(identifiers),
26
- keys: ["u", "underscore", "equal"],
48
+ keys: [],
27
49
  answerFormat: "tex",
28
50
  identifiers,
51
+ hint: getHint(identifiers),
52
+ correction: getCorrection(identifiers),
29
53
  };
30
- return question;
31
54
  };
32
- const getExplicitFormulaUsageQuestion = () => {
33
- const u = PolynomialConstructor.randomWithOrder(2, "n");
55
+ const getExplicitFormulaUsageQuestion = (opts) => {
56
+ const type = opts?.functionType?.length
57
+ ? random(opts.functionType)
58
+ : random(["Affine", "Second degré"]);
59
+ const u = type === "Affine"
60
+ ? AffineConstructor.random()
61
+ : PolynomialConstructor.randomWithOrder(2, "n");
34
62
  const rank = randint(0, 4);
35
63
  const identifiers = { rank, coeffs: u.coefficients };
36
64
  return getQuestionFromIdentifiers(identifiers);
@@ -50,16 +78,28 @@ const getPropositions = (n, { answer, rank, coeffs }) => {
50
78
  const isAnswerValid = (ans, { answer, rank }) => {
51
79
  return [answer, `u_{${rank}}=${answer}`, `u_${rank}=${answer}`].includes(ans);
52
80
  };
81
+ const options = [
82
+ {
83
+ id: "functionType",
84
+ label: "Type de fonction",
85
+ values: ["Affine", "Second degré"],
86
+ target: GeneratorOptionTarget.generation,
87
+ type: GeneratorOptionType.multiselect,
88
+ defaultValue: ["Affine", "Second degré"],
89
+ },
90
+ ];
53
91
  export const explicitFormulaUsage = {
54
92
  id: "explicitFormulaUsage",
55
93
  connector: "=",
56
94
  label: "Utiliser la formule explicite d'une suite",
57
95
  isSingleStep: true,
58
- generator: (nb) => getDistinctQuestions(getExplicitFormulaUsageQuestion, nb),
96
+ generator: (nb, opts) => getDistinctQuestions(() => getExplicitFormulaUsageQuestion(opts), nb),
59
97
  qcmTimer: 60,
60
98
  freeTimer: 60,
61
99
  getPropositions,
62
100
  isAnswerValid,
63
101
  subject: "Mathématiques",
64
102
  getQuestionFromIdentifiers,
103
+ hasHintAndCorrection: true,
104
+ options,
65
105
  };
@@ -0,0 +1,14 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { OptionFirstTermRankOne } from "../../../../exercises/options/optionFirstTermRankOne.js";
3
+ type Identifiers = {
4
+ rank1: number;
5
+ value1: number;
6
+ rank2: number;
7
+ value2: number;
8
+ precisionInitial: number;
9
+ precisionReason: number;
10
+ };
11
+ type Options = OptionFirstTermRankOne;
12
+ export declare const geometricFindExplicitFormulaFromTwoConsecutiveTerms: Exercise<Identifiers, Options>;
13
+ export {};
14
+ //# sourceMappingURL=geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAoB3D,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAyVF,KAAK,OAAO,GAAG,sBAAsB,CAAC;AAMtC,eAAO,MAAM,mDAAmD,EAAE,QAAQ,CACxE,WAAW,EACX,OAAO,CAqBR,CAAC"}