math-exercises 3.0.171 → 3.0.173

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 (418) hide show
  1. package/lib/exercises/math/derivation/variations/signVarTable3dDegree.js +38 -10
  2. package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.d.ts.map +1 -1
  3. package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.js +7 -4
  4. package/lib/exercises/math/derivation/variations/signVarTableFromGraph.d.ts.map +1 -1
  5. package/lib/exercises/math/derivation/variations/signVarTableFromGraph.js +2 -3
  6. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -1
  7. package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +12 -0
  8. package/lib/exercises/math/functions/trinoms/parabole/index.d.ts +2 -0
  9. package/lib/exercises/math/functions/trinoms/parabole/index.d.ts.map +1 -1
  10. package/lib/exercises/math/functions/trinoms/parabole/index.js +2 -0
  11. package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.d.ts +8 -0
  12. package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.d.ts.map +1 -0
  13. package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.js +106 -0
  14. package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.d.ts +14 -0
  15. package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.d.ts.map +1 -0
  16. package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.js +186 -0
  17. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts +6 -2
  18. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts.map +1 -1
  19. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js +98 -13
  20. package/lib/exercises/math/functions/variations/partialVarTableFromGraph.d.ts.map +1 -1
  21. package/lib/exercises/math/functions/variations/partialVarTableFromGraph.js +2 -1
  22. package/lib/exercises/math/functions/variations/varTableFromGraph.d.ts.map +1 -1
  23. package/lib/exercises/math/functions/variations/varTableFromGraph.js +2 -1
  24. package/lib/exercises/math/functions/variations/varTableFromSentences.d.ts.map +1 -1
  25. package/lib/exercises/math/functions/variations/varTableFromSentences.js +2 -1
  26. package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.d.ts.map +1 -1
  27. package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.js +0 -2
  28. package/lib/exercises/math/geometry/lines/index.d.ts +1 -0
  29. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  30. package/lib/exercises/math/geometry/lines/index.js +1 -0
  31. package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.d.ts +13 -0
  32. package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.d.ts.map +1 -0
  33. package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.js +195 -0
  34. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map +1 -1
  35. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +64 -60
  36. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts +1 -0
  37. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -1
  38. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +173 -47
  39. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts.map +1 -1
  40. package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +112 -46
  41. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts.map +1 -1
  42. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.js +6 -0
  43. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts.map +1 -1
  44. package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.js +60 -82
  45. package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.d.ts.map +1 -1
  46. package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +92 -6
  47. package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts +6 -1
  48. package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts.map +1 -1
  49. package/lib/exercises/math/geometry/vectors/scalarProduct/index.js +6 -1
  50. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts.map +1 -1
  51. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.js +6 -0
  52. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.js +1 -1
  53. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map +1 -1
  54. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js +15 -5
  55. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts.map +1 -1
  56. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.js +18 -14
  57. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts.map +1 -1
  58. package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.js +15 -5
  59. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -1
  60. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +38 -4
  61. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts.map +1 -1
  62. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.js +77 -26
  63. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts.map +1 -1
  64. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.js +6 -7
  65. package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.js +1 -1
  66. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  67. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +3 -16
  68. package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts +14 -0
  69. package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts.map +1 -0
  70. package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.js +167 -0
  71. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -1
  72. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +29 -56
  73. package/lib/exercises/math/probaStat/randomVariable/index.d.ts +8 -0
  74. package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
  75. package/lib/exercises/math/probaStat/randomVariable/index.js +9 -0
  76. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.d.ts.map +1 -1
  77. package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.js +6 -6
  78. package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.d.ts +9 -0
  79. package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.d.ts.map +1 -0
  80. package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.js +119 -0
  81. package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.js +1 -1
  82. package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.d.ts +9 -0
  83. package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.d.ts.map +1 -0
  84. package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.js +116 -0
  85. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts +11 -0
  86. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts.map +1 -0
  87. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.js +112 -0
  88. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts +9 -0
  89. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts.map +1 -0
  90. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.js +176 -0
  91. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts +8 -0
  92. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts.map +1 -0
  93. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.js +94 -0
  94. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts +9 -0
  95. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -0
  96. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +162 -0
  97. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts +8 -0
  98. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts.map +1 -0
  99. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.js +133 -0
  100. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts +8 -0
  101. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts.map +1 -0
  102. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.js +211 -0
  103. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts +8 -0
  104. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts.map +1 -0
  105. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.js +113 -0
  106. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.js +1 -1
  107. package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.js +1 -1
  108. package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.d.ts +31 -0
  109. package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.d.ts.map +1 -0
  110. package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.js +192 -0
  111. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts +40 -11
  112. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
  113. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +172 -30
  114. package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
  115. package/lib/exercises/math/probaStat/stats1var/medianWithList.js +16 -2
  116. package/lib/exercises/math/python/sequences/index.d.ts +8 -0
  117. package/lib/exercises/math/python/sequences/index.d.ts.map +1 -0
  118. package/lib/exercises/math/python/sequences/index.js +7 -0
  119. package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.d.ts +11 -0
  120. package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.d.ts.map +1 -0
  121. package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.js +274 -0
  122. package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.d.ts +12 -0
  123. package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.d.ts.map +1 -0
  124. package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.js +368 -0
  125. package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.d.ts +13 -0
  126. package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.d.ts.map +1 -0
  127. package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.js +254 -0
  128. package/lib/exercises/math/python/sequences/pySequenceProgramReading.d.ts +14 -0
  129. package/lib/exercises/math/python/sequences/pySequenceProgramReading.d.ts.map +1 -0
  130. package/lib/exercises/math/python/sequences/pySequenceProgramReading.js +365 -0
  131. package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.d.ts +11 -0
  132. package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.d.ts.map +1 -0
  133. package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.js +298 -0
  134. package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.d.ts +12 -0
  135. package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.d.ts.map +1 -0
  136. package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.js +408 -0
  137. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts +17 -0
  138. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts.map +1 -0
  139. package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.js +498 -0
  140. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts +12 -0
  141. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map +1 -0
  142. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.js +191 -0
  143. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts +14 -0
  144. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts.map +1 -0
  145. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.js +153 -0
  146. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts +15 -0
  147. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -0
  148. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +184 -0
  149. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts +14 -0
  150. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts.map +1 -0
  151. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.js +210 -0
  152. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.d.ts +15 -0
  153. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.d.ts.map +1 -0
  154. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.js +161 -0
  155. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts +17 -0
  156. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts.map +1 -0
  157. package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.js +188 -0
  158. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts +6 -0
  159. package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts.map +1 -0
  160. package/lib/exercises/math/sequences/arithmetic/situations/index.js +5 -0
  161. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts +15 -0
  162. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts.map +1 -0
  163. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.js +233 -0
  164. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.d.ts +13 -0
  165. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.d.ts.map +1 -0
  166. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.js +111 -0
  167. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.d.ts +13 -0
  168. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.d.ts.map +1 -0
  169. package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.js +216 -0
  170. package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.d.ts +7 -0
  171. package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.d.ts.map +1 -0
  172. package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.js +94 -0
  173. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts +5 -0
  174. package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts.map +1 -0
  175. package/lib/exercises/math/sequences/arithmetic/sum/index.js +4 -0
  176. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts +14 -0
  177. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts.map +1 -0
  178. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.js +301 -0
  179. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.d.ts +15 -0
  180. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.d.ts.map +1 -0
  181. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +260 -0
  182. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts +14 -0
  183. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts.map +1 -0
  184. package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.js +186 -0
  185. package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.d.ts +15 -0
  186. package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.d.ts.map +1 -0
  187. package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.js +142 -0
  188. package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.d.ts +14 -0
  189. package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.d.ts.map +1 -0
  190. package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.js +205 -0
  191. package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.d.ts +15 -0
  192. package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.d.ts.map +1 -0
  193. package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.js +208 -0
  194. package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.d.ts +17 -0
  195. package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.d.ts.map +1 -0
  196. package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.js +152 -0
  197. package/lib/exercises/math/sequences/geometric/situations/index.d.ts +4 -0
  198. package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -0
  199. package/lib/exercises/math/sequences/geometric/situations/index.js +5 -0
  200. package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.d.ts +15 -0
  201. package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.d.ts.map +1 -0
  202. package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.js +248 -0
  203. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.d.ts +14 -0
  204. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.d.ts.map +1 -0
  205. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.js +126 -0
  206. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.d.ts +8 -0
  207. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.d.ts.map +1 -0
  208. package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.js +91 -0
  209. package/lib/exercises/math/sequences/geometric/sum/index.d.ts +4 -0
  210. package/lib/exercises/math/sequences/geometric/sum/index.d.ts.map +1 -0
  211. package/lib/exercises/math/sequences/geometric/sum/index.js +3 -0
  212. package/lib/exercises/math/sequences/seqArithmGeom/index.d.ts +2 -0
  213. package/lib/exercises/math/sequences/seqArithmGeom/index.d.ts.map +1 -0
  214. package/lib/exercises/math/sequences/seqArithmGeom/index.js +1 -0
  215. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts +14 -0
  216. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts.map +1 -0
  217. package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.js +202 -0
  218. package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.d.ts.map +1 -1
  219. package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.js +0 -2
  220. package/lib/exercises/options/optionFirstTermRankOne.d.ts +16 -0
  221. package/lib/exercises/options/optionFirstTermRankOne.d.ts.map +1 -0
  222. package/lib/exercises/options/optionFirstTermRankOne.js +17 -0
  223. package/lib/exercises/options/optionIsUsePythonDef.d.ts +16 -0
  224. package/lib/exercises/options/optionIsUsePythonDef.d.ts.map +1 -0
  225. package/lib/exercises/options/optionIsUsePythonDef.js +17 -0
  226. package/lib/exercises/options/optionIsWithSuperfluousData.d.ts +16 -0
  227. package/lib/exercises/options/optionIsWithSuperfluousData.d.ts.map +1 -0
  228. package/lib/exercises/options/optionIsWithSuperfluousData.js +17 -0
  229. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
  230. package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
  231. package/lib/exercises/vea/colinearVectorVEA.d.ts +2 -0
  232. package/lib/exercises/vea/colinearVectorVEA.d.ts.map +1 -0
  233. package/lib/exercises/vea/colinearVectorVEA.js +11 -0
  234. package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
  235. package/lib/exercises/vea/rationalVEA.js +7 -3
  236. package/lib/exercises/vea/varLineVEA.d.ts.map +1 -1
  237. package/lib/exercises/vea/varLineVEA.js +7 -3
  238. package/lib/exercises/vea/varSignTableVEA.d.ts +8 -0
  239. package/lib/exercises/vea/varSignTableVEA.d.ts.map +1 -1
  240. package/lib/exercises/vea/varSignTableVEA.js +8 -0
  241. package/lib/exercises/vea/xTableLineVEA.d.ts +1 -0
  242. package/lib/exercises/vea/xTableLineVEA.d.ts.map +1 -1
  243. package/lib/exercises/vea/xTableLineVEA.js +1 -0
  244. package/lib/index.d.ts +104 -5
  245. package/lib/index.d.ts.map +1 -1
  246. package/lib/latexTester.d.ts.map +1 -1
  247. package/lib/latexTester.js +3 -1
  248. package/lib/math/geometry/angle.d.ts +2 -0
  249. package/lib/math/geometry/angle.d.ts.map +1 -1
  250. package/lib/math/geometry/angle.js +17 -0
  251. package/lib/math/geometry/line.d.ts +1 -1
  252. package/lib/math/geometry/line.d.ts.map +1 -1
  253. package/lib/math/geometry/line.js +3 -3
  254. package/lib/math/geometry/point.d.ts +1 -1
  255. package/lib/math/geometry/point.d.ts.map +1 -1
  256. package/lib/math/geometry/point.js +4 -1
  257. package/lib/math/geometry/segment.js +1 -1
  258. package/lib/math/numbers/reals/real.d.ts.map +1 -1
  259. package/lib/math/numbers/reals/real.js +4 -0
  260. package/lib/math/probability/randomVariable.d.ts +2 -1
  261. package/lib/math/probability/randomVariable.d.ts.map +1 -1
  262. package/lib/math/probability/randomVariable.js +7 -1
  263. package/lib/math/utils/arithmetic/primeFactors.d.ts +1 -1
  264. package/lib/math/utils/arithmetic/primeFactors.d.ts.map +1 -1
  265. package/lib/math/utils/arithmetic/primeFactors.js +23 -9
  266. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts +53 -0
  267. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -0
  268. package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +1928 -0
  269. package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts +15 -0
  270. package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -0
  271. package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +136 -0
  272. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts +42 -0
  273. package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -0
  274. package/lib/math/utils/sequences/situations/seqGeometricSituations.js +932 -0
  275. package/lib/math/utils/sequences/situations/seqGeometricUtils.d.ts +12 -0
  276. package/lib/math/utils/sequences/situations/seqGeometricUtils.d.ts.map +1 -0
  277. package/lib/math/utils/sequences/situations/seqGeometricUtils.js +90 -0
  278. package/lib/tests/pdfs/mdTableToLatexTabular.js +1 -1
  279. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  280. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  281. package/lib/tree/nodes/complex/complexNode.d.ts +1 -0
  282. package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
  283. package/lib/tree/nodes/complex/complexNode.js +3 -0
  284. package/lib/tree/nodes/equations/equalNode.d.ts +1 -0
  285. package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
  286. package/lib/tree/nodes/equations/equalNode.js +3 -0
  287. package/lib/tree/nodes/equations/equationSolutionNode.d.ts +1 -0
  288. package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
  289. package/lib/tree/nodes/equations/equationSolutionNode.js +3 -0
  290. package/lib/tree/nodes/equations/multiEqualNode.d.ts +1 -0
  291. package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -1
  292. package/lib/tree/nodes/equations/multiEqualNode.js +3 -0
  293. package/lib/tree/nodes/equations/notEqualNode.d.ts +1 -0
  294. package/lib/tree/nodes/equations/notEqualNode.d.ts.map +1 -1
  295. package/lib/tree/nodes/equations/notEqualNode.js +3 -0
  296. package/lib/tree/nodes/functions/absNode.d.ts +1 -0
  297. package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
  298. package/lib/tree/nodes/functions/absNode.js +7 -0
  299. package/lib/tree/nodes/functions/arcSinNode.d.ts +1 -0
  300. package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
  301. package/lib/tree/nodes/functions/arcSinNode.js +7 -0
  302. package/lib/tree/nodes/functions/arccosNode.d.ts +1 -0
  303. package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
  304. package/lib/tree/nodes/functions/arccosNode.js +7 -0
  305. package/lib/tree/nodes/functions/arctanNode.d.ts +1 -0
  306. package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
  307. package/lib/tree/nodes/functions/arctanNode.js +7 -0
  308. package/lib/tree/nodes/functions/cosNode.d.ts +1 -0
  309. package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
  310. package/lib/tree/nodes/functions/cosNode.js +7 -0
  311. package/lib/tree/nodes/functions/expNode.d.ts +1 -0
  312. package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
  313. package/lib/tree/nodes/functions/expNode.js +7 -0
  314. package/lib/tree/nodes/functions/factorialNode.d.ts +30 -0
  315. package/lib/tree/nodes/functions/factorialNode.d.ts.map +1 -0
  316. package/lib/tree/nodes/functions/factorialNode.js +79 -0
  317. package/lib/tree/nodes/functions/functionNode.d.ts +2 -1
  318. package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
  319. package/lib/tree/nodes/functions/functionNode.js +1 -0
  320. package/lib/tree/nodes/functions/integralNode.d.ts +1 -0
  321. package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
  322. package/lib/tree/nodes/functions/integralNode.js +7 -0
  323. package/lib/tree/nodes/functions/log10Node.d.ts +1 -0
  324. package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
  325. package/lib/tree/nodes/functions/log10Node.js +7 -0
  326. package/lib/tree/nodes/functions/logNode.d.ts +1 -0
  327. package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
  328. package/lib/tree/nodes/functions/logNode.js +9 -0
  329. package/lib/tree/nodes/functions/oppositeNode.d.ts +1 -0
  330. package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
  331. package/lib/tree/nodes/functions/oppositeNode.js +7 -0
  332. package/lib/tree/nodes/functions/sinNode.d.ts +1 -0
  333. package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
  334. package/lib/tree/nodes/functions/sinNode.js +7 -0
  335. package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -0
  336. package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
  337. package/lib/tree/nodes/functions/sqrtNode.js +7 -0
  338. package/lib/tree/nodes/functions/tanNode.d.ts +1 -0
  339. package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
  340. package/lib/tree/nodes/functions/tanNode.js +7 -0
  341. package/lib/tree/nodes/geometry/degree.d.ts +1 -0
  342. package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
  343. package/lib/tree/nodes/geometry/degree.js +7 -0
  344. package/lib/tree/nodes/geometry/lengthNode.d.ts +1 -0
  345. package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
  346. package/lib/tree/nodes/geometry/lengthNode.js +7 -0
  347. package/lib/tree/nodes/geometry/pointNode.d.ts +1 -0
  348. package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
  349. package/lib/tree/nodes/geometry/pointNode.js +7 -0
  350. package/lib/tree/nodes/geometry/vectorNode.d.ts +1 -0
  351. package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
  352. package/lib/tree/nodes/geometry/vectorNode.js +7 -0
  353. package/lib/tree/nodes/inequations/inequationNode.d.ts +1 -0
  354. package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
  355. package/lib/tree/nodes/inequations/inequationNode.js +7 -0
  356. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +1 -0
  357. package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
  358. package/lib/tree/nodes/inequations/inequationSolutionNode.js +7 -0
  359. package/lib/tree/nodes/node.d.ts +2 -1
  360. package/lib/tree/nodes/node.d.ts.map +1 -1
  361. package/lib/tree/nodes/node.js +2 -0
  362. package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
  363. package/lib/tree/nodes/nodeConstructor.js +4 -0
  364. package/lib/tree/nodes/numbers/percentNode.d.ts +1 -0
  365. package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
  366. package/lib/tree/nodes/numbers/percentNode.js +7 -0
  367. package/lib/tree/nodes/operators/addNode.d.ts +1 -0
  368. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  369. package/lib/tree/nodes/operators/addNode.js +7 -0
  370. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +4 -3
  371. package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -1
  372. package/lib/tree/nodes/operators/binomialCoefficientNode.js +24 -5
  373. package/lib/tree/nodes/operators/divideNode.d.ts +1 -0
  374. package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
  375. package/lib/tree/nodes/operators/divideNode.js +7 -0
  376. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -0
  377. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  378. package/lib/tree/nodes/operators/fractionNode.js +7 -0
  379. package/lib/tree/nodes/operators/limitNode.d.ts +1 -0
  380. package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
  381. package/lib/tree/nodes/operators/limitNode.js +7 -0
  382. package/lib/tree/nodes/operators/multiplyNode.d.ts +1 -0
  383. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  384. package/lib/tree/nodes/operators/multiplyNode.js +7 -0
  385. package/lib/tree/nodes/operators/powerNode.d.ts +1 -0
  386. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  387. package/lib/tree/nodes/operators/powerNode.js +7 -0
  388. package/lib/tree/nodes/operators/substractNode.d.ts +1 -0
  389. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  390. package/lib/tree/nodes/operators/substractNode.js +7 -0
  391. package/lib/tree/nodes/polynomials/monomNode.d.ts +1 -0
  392. package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -1
  393. package/lib/tree/nodes/polynomials/monomNode.js +7 -0
  394. package/lib/tree/nodes/polynomials/trinomNode.d.ts +1 -0
  395. package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -1
  396. package/lib/tree/nodes/polynomials/trinomNode.js +7 -0
  397. package/lib/tree/nodes/sets/belongsNode.d.ts +1 -0
  398. package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
  399. package/lib/tree/nodes/sets/belongsNode.js +7 -0
  400. package/lib/tree/nodes/sets/discreteSetNode.d.ts +1 -0
  401. package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
  402. package/lib/tree/nodes/sets/discreteSetNode.js +7 -0
  403. package/lib/tree/nodes/sets/intervalNode.d.ts +1 -0
  404. package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
  405. package/lib/tree/nodes/sets/intervalNode.js +7 -0
  406. package/lib/tree/nodes/sets/unionIntervalNode.d.ts +1 -0
  407. package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
  408. package/lib/tree/nodes/sets/unionIntervalNode.js +7 -0
  409. package/lib/tree/nodes/variables/variableNode.d.ts +1 -0
  410. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  411. package/lib/tree/nodes/variables/variableNode.js +7 -0
  412. package/lib/tree/parsers/vectorParser.d.ts.map +1 -1
  413. package/lib/tree/parsers/vectorParser.js +8 -0
  414. package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -1
  415. package/lib/tree/utilities/nodeShuffler.js +3 -0
  416. package/lib/tree/utilities/nodeSimplifier.d.ts.map +1 -1
  417. package/lib/tree/utilities/nodeSimplifier.js +3 -0
  418. package/package.json +1 -1
@@ -0,0 +1,298 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getOptionFirstTermRankOneStuff, } from "../../../../exercises/options/optionFirstTermRankOne.js";
3
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
4
+ import { Trinom } from "../../../../math/polynomials/trinom.js";
5
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
6
+ import { randint } from "../../../../math/utils/random/randint.js";
7
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
8
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
9
+ import { power } from "../../../../tree/nodes/operators/powerNode.js";
10
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
11
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
12
+ const codify = (strPython) => {
13
+ return `\`\`\`python
14
+ ${strPython}
15
+ \`\`\``;
16
+ };
17
+ const codifyChunk = (strPython) => {
18
+ return `\`${strPython}\``;
19
+ };
20
+ const createStrPythonForNodeUNext = (nodeUNext) => {
21
+ return nodeUNext
22
+ .toMathString()
23
+ .replaceAll("u_{n}", "u")
24
+ .replaceAll("^", "**");
25
+ };
26
+ const createNodeUNext = (coeffs) => {
27
+ const nodeUn = "u_{n}".toTree();
28
+ let nodeUNext;
29
+ const [c, b, a] = coeffs;
30
+ if (a !== undefined) {
31
+ //trinom recur
32
+ const trinom = new Trinom(a, b, c, { variable: nodeUn.toTex() });
33
+ nodeUNext = trinom.toTree();
34
+ }
35
+ else if (b !== undefined) {
36
+ if (c !== 0) {
37
+ //arithmetico-geometric (=== affine recur)
38
+ nodeUNext = add(multiply(b, nodeUn), c);
39
+ }
40
+ else {
41
+ //geometric
42
+ nodeUNext = multiply(b, nodeUn);
43
+ }
44
+ }
45
+ else {
46
+ //arithmetic
47
+ nodeUNext = add(nodeUn, c);
48
+ }
49
+ return nodeUNext;
50
+ };
51
+ const createNodeUExplicit = (firstValue, firstRank, coeffs) => {
52
+ const nodeFactor = firstRank === 0 ? "n".toTree() : substract("n".toTree(), firstRank);
53
+ const [c, b, a] = coeffs;
54
+ if (a !== undefined) {
55
+ return undefined;
56
+ }
57
+ else if (b !== undefined) {
58
+ if (c !== 0) {
59
+ return undefined;
60
+ }
61
+ else {
62
+ //geometric
63
+ return multiply(firstValue, power(b, nodeFactor));
64
+ }
65
+ }
66
+ else {
67
+ //arithmetic
68
+ return add(firstValue, multiply(c, nodeFactor));
69
+ }
70
+ };
71
+ const getStrPythonProgramIncomplete = (identifiers, optsIn) => {
72
+ const opts = optsIn ?? optsDefault;
73
+ const firstRank = opts.firstTermRankOne ? 1 : 0;
74
+ const { firstValue, rankAsked } = identifiers;
75
+ return `u = ${firstValue}
76
+ for i in range(${rankAsked - firstRank}):
77
+ ...
78
+ print(u)
79
+ `;
80
+ };
81
+ const getInstruction = (identifiers, optsIn) => {
82
+ const opts = optsIn ?? optsDefault;
83
+ const firstRank = opts.firstTermRankOne ? 1 : 0;
84
+ const { firstValue, rankAsked, coeffs } = identifiers;
85
+ const nodeUNext = createNodeUNext(coeffs);
86
+ return `On considère la suite $(u_{n})$ définie par
87
+
88
+ ${alignTex([
89
+ [`u_{${firstRank}}`, "=", `${firstValue.frenchify()}`],
90
+ [`u_{n+1}`, "=", `${nodeUNext.toTex()}`],
91
+ ])}
92
+
93
+ Par quoi faut-il remplacer les pointillés dans le programme suivant pour calculer $u_{${rankAsked}}$ ?
94
+
95
+ ${codify(getStrPythonProgramIncomplete(identifiers, opts))}
96
+
97
+ `;
98
+ };
99
+ const getAnswer = (identifiers) => {
100
+ const { coeffs } = identifiers;
101
+ const nodeUNext = createNodeUNext(coeffs);
102
+ const strPythonNodeUNext = createStrPythonForNodeUNext(nodeUNext);
103
+ return codify(`u = ${strPythonNodeUNext}`);
104
+ };
105
+ const getHint = () => {
106
+ return `Trouve une instruction dont l'exécution réalisera ces $3$ actions :
107
+ - récupérer la valeur contenue dans $u$
108
+ - calculer une nouvelle valeur en effectuant des opérations avec la valeur récupérée dans $u$
109
+ - affecter cette nouvelle valeur à $u$
110
+ `;
111
+ };
112
+ const getCorrection = (identifiers, optsIn) => {
113
+ const opts = optsIn ?? optsDefault;
114
+ const firstRank = opts.firstTermRankOne ? 1 : 0;
115
+ const { firstValue, rankAsked, coeffs } = identifiers;
116
+ const nodeUNext = createNodeUNext(coeffs);
117
+ const strPythonNodeUNext = createStrPythonForNodeUNext(nodeUNext);
118
+ return `Dans le programme proposé, la ligne
119
+
120
+ ${codify(`u = ${firstValue}`)}
121
+
122
+ traduit l'égalité :
123
+
124
+ $$
125
+ u_{${firstRank}} = ${firstValue.frenchify()}
126
+ $$
127
+
128
+ La variable $u$ est bien initialisée.
129
+
130
+ $\\ $
131
+
132
+ Ensuite, pour calculer $u_{${rankAsked}}$, on calcule $u_{${firstRank + 1}}$ à partir de $u_{${firstRank}}$, puis $u_{${firstRank + 2}}$ à partir de $u_{${firstRank + 1}}$, et ainsi de suite de proche en proche.
133
+
134
+ Le bout de code ${codifyChunk(strPythonNodeUNext)} :
135
+ - récupère la valeur au rang précédent
136
+ - calcule une nouvelle valeur en effectuant des opérations avec la valeur au rang précédent.
137
+
138
+ $\\ $
139
+
140
+ Il n'y a plus qu'à mettre à jour $u$ avec cette valeur pour pouvoir répéter la procédure.
141
+ On écrit donc :
142
+
143
+ ${codify(`u = ${strPythonNodeUNext}`)}
144
+
145
+ `;
146
+ };
147
+ const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
148
+ const opts = optsIn ?? optsDefault;
149
+ const firstRank = opts.firstTermRankOne ? 1 : 0;
150
+ const propositions = [];
151
+ const correctAnswer = answer;
152
+ addValidProp(propositions, correctAnswer, "raw");
153
+ const { firstValue, coeffs } = identifiers;
154
+ const nodeUNext = createNodeUNext(coeffs);
155
+ const strPythonNodeUNext = createStrPythonForNodeUNext(nodeUNext);
156
+ // oublie l'assignation
157
+ {
158
+ const strProgramChunk = codify(strPythonNodeUNext);
159
+ tryToAddWrongProp(propositions, strProgramChunk, "raw");
160
+ }
161
+ // prend u pour une liste
162
+ {
163
+ const strProgramChunk = codify(`u[i+1] = ${strPythonNodeUNext.replaceAll("u", "u[i]")}`);
164
+ tryToAddWrongProp(propositions, strProgramChunk, "raw");
165
+ }
166
+ // fait une tambouille avec i
167
+ {
168
+ const strProgramChunk = codify(`u = ${strPythonNodeUNext.replaceAll("u", "i")}`);
169
+ tryToAddWrongProp(propositions, strProgramChunk, "raw");
170
+ }
171
+ // oublie l'assignation + fait une tambouille avec i
172
+ {
173
+ const strProgramChunk = codify(`${strPythonNodeUNext.replaceAll("u", "i")}`);
174
+ tryToAddWrongProp(propositions, strProgramChunk, "raw");
175
+ }
176
+ // prend u pour une liste + toujours la même chose
177
+ {
178
+ const strProgramChunk = codify(`u[i+1] = ${strPythonNodeUNext}`);
179
+ tryToAddWrongProp(propositions, strProgramChunk, "raw");
180
+ }
181
+ // avec la forme explicite
182
+ const nodeUExplicit = createNodeUExplicit(firstValue, firstRank, coeffs);
183
+ if (nodeUExplicit !== undefined) {
184
+ const strPythonNodeUExplicit = createStrPythonForNodeUNext(nodeUExplicit);
185
+ //laisse n au lieu de i
186
+ {
187
+ const strProgramChunk = codify(`u = ${strPythonNodeUExplicit}`);
188
+ tryToAddWrongProp(propositions, strProgramChunk, "raw");
189
+ }
190
+ //NE PAS DECOMMENTER CAR C'EST AUSSI REPONSE VALIDE (discutable)
191
+ // //utilise la forme explicite
192
+ // {
193
+ // const strProgramChunk = codify(
194
+ // `u = ${strPythonNodeUExplicit.replaceAll("n", "i")}`,
195
+ // );
196
+ // tryToAddWrongProp(propositions, strProgramChunk, "raw");
197
+ // }
198
+ //utilise la forme explicite avec u[i+1]
199
+ {
200
+ const strProgramChunk = codify(`u[i+1] = ${strPythonNodeUExplicit.replaceAll("n", "i")}`);
201
+ tryToAddWrongProp(propositions, strProgramChunk, "raw");
202
+ }
203
+ //oublie l'assignation
204
+ {
205
+ const strProgramChunk = codify(`${strPythonNodeUExplicit.replaceAll("n", "i")}`);
206
+ tryToAddWrongProp(propositions, strProgramChunk, "raw");
207
+ }
208
+ //diabolique: u au lieu de i
209
+ {
210
+ const strProgramChunk = codify(`u = ${strPythonNodeUExplicit.replaceAll("n", "u")}`);
211
+ tryToAddWrongProp(propositions, strProgramChunk, "raw");
212
+ }
213
+ }
214
+ //terror
215
+ {
216
+ const identifiersWrong = createRandomIdentifiers(opts);
217
+ const strWrong = getAnswer(identifiersWrong, opts);
218
+ tryToAddWrongProp(propositions, strWrong, "raw");
219
+ }
220
+ return shuffleProps(propositions, n);
221
+ };
222
+ const createRandomIdentifiers = (_opts) => {
223
+ const firstValue = randint(-10, 10);
224
+ const rankAsked = randint(500, 1001);
225
+ const coeffs = [];
226
+ const rand = randint(0, 4);
227
+ switch (rand) {
228
+ case 0:
229
+ {
230
+ //arithmetic
231
+ const c = randint(-10, 10, [0]);
232
+ coeffs.push(c);
233
+ }
234
+ break;
235
+ case 1:
236
+ {
237
+ //geometric
238
+ const c = 0;
239
+ const b = randfloat(-10, 10, 2, [0]);
240
+ coeffs.push(...[c, b]);
241
+ }
242
+ break;
243
+ case 2:
244
+ {
245
+ //arithmetico-geometric (=== affine recur)
246
+ const c = randint(-10, 10, [0]);
247
+ const b = randfloat(-10, 10, 2, [0]);
248
+ coeffs.push(...[c, b]);
249
+ }
250
+ break;
251
+ case 3:
252
+ {
253
+ //trinom recur
254
+ const c = randint(-10, 10, [0]);
255
+ const b = randfloat(-10, 10, 2, [0]);
256
+ const a = randint(-2, 3, [0]);
257
+ coeffs.push(...[c, b, a]);
258
+ }
259
+ break;
260
+ }
261
+ const identifiers = { firstValue, rankAsked, coeffs };
262
+ return identifiers;
263
+ };
264
+ const getPySequenceTermForLoopInstructionCompletionQuestion = (optsIn) => {
265
+ const opts = optsIn ?? optsDefault;
266
+ const identifiers = createRandomIdentifiers(opts);
267
+ return getQuestionFromIdentifiers(identifiers, opts);
268
+ };
269
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
270
+ const question = {
271
+ answer: getAnswer(identifiers, opts),
272
+ instruction: getInstruction(identifiers, opts),
273
+ keys: [],
274
+ answerFormat: "tex",
275
+ identifiers,
276
+ hint: getHint(identifiers, opts),
277
+ correction: getCorrection(identifiers, opts),
278
+ options: opts,
279
+ };
280
+ return question;
281
+ };
282
+ const { optsDefaultFirstTermRankOne, generatorOptionFirstTermRankOne } = getOptionFirstTermRankOneStuff(false);
283
+ const optsDefault = Object.assign({}, optsDefaultFirstTermRankOne);
284
+ const options = [generatorOptionFirstTermRankOne];
285
+ export const pySequenceTermForLoopInstructionCompletion = {
286
+ id: "pySequenceTermForLoopInstructionCompletion",
287
+ label: "Compléter un algorithme de calcul de terme à l'aide d'une boucle \"for\" (sans fonction)",
288
+ isSingleStep: true,
289
+ generator: (nb, opts) => getDistinctQuestions(() => getPySequenceTermForLoopInstructionCompletionQuestion(opts), nb),
290
+ options,
291
+ qcmTimer: 60,
292
+ freeTimer: 60,
293
+ getPropositions,
294
+ subject: "Mathématiques",
295
+ getQuestionFromIdentifiers,
296
+ hasHintAndCorrection: true,
297
+ answerType: "QCU",
298
+ };
@@ -0,0 +1,12 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { OptionFirstTermRankOne } from "../../../../exercises/options/optionFirstTermRankOne.js";
3
+ type Identifiers = {
4
+ firstValue: number;
5
+ coeffs: number[];
6
+ rankAsked: number;
7
+ keyIncomplete: string;
8
+ };
9
+ type Options = OptionFirstTermRankOne;
10
+ export declare const pySequenceTermFromFunctionCallInstructionCompletion: Exercise<Identifiers, Options>;
11
+ export {};
12
+ //# sourceMappingURL=pySequenceTermFromFunctionCallInstructionCompletion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pySequenceTermFromFunctionCallInstructionCompletion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAqD3D,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAwbF,KAAK,OAAO,GAAG,sBAAsB,CAAC;AAMtC,eAAO,MAAM,mDAAmD,EAAE,QAAQ,CACxE,WAAW,EACX,OAAO,CAoBR,CAAC"}