math-exercises 3.0.64 → 3.0.65

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 (338) hide show
  1. package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.js +4 -6
  3. package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.d.ts.map +1 -1
  4. package/lib/exercises/math/calcul/arithmetics/divisibiltyCriteria.js +4 -5
  5. package/lib/exercises/math/calcul/arithmetics/divisorsList.d.ts.map +1 -1
  6. package/lib/exercises/math/calcul/arithmetics/divisorsList.js +18 -7
  7. package/lib/exercises/math/calcul/arithmetics/euclideanDivision.d.ts.map +1 -1
  8. package/lib/exercises/math/calcul/arithmetics/euclideanDivision.js +18 -7
  9. package/lib/exercises/math/calcul/arithmetics/paritySumsAndProducts.d.ts.map +1 -1
  10. package/lib/exercises/math/calcul/arithmetics/paritySumsAndProducts.js +56 -47
  11. package/lib/exercises/math/calcul/arithmetics/pgcdCalcul.d.ts.map +1 -1
  12. package/lib/exercises/math/calcul/arithmetics/pgcdCalcul.js +4 -4
  13. package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.d.ts.map +1 -1
  14. package/lib/exercises/math/calcul/arithmetics/ppcmCalcul.js +0 -4
  15. package/lib/exercises/math/calcul/arithmetics/primeNumbers.d.ts.map +1 -1
  16. package/lib/exercises/math/calcul/arithmetics/primeNumbers.js +4 -3
  17. package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +2 -2
  18. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -1
  19. package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +6 -8
  20. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.d.ts.map +1 -1
  21. package/lib/exercises/math/calcul/fractions/fractionAndIntegerDivision.js +2 -5
  22. package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +1 -1
  23. package/lib/exercises/math/calcul/fractions/simplifyFraction.js +2 -2
  24. package/lib/exercises/math/calcul/operations/index.d.ts +1 -0
  25. package/lib/exercises/math/calcul/operations/index.d.ts.map +1 -1
  26. package/lib/exercises/math/calcul/operations/index.js +1 -0
  27. package/lib/exercises/math/calcul/operations/numberInverse.d.ts +8 -0
  28. package/lib/exercises/math/calcul/operations/numberInverse.d.ts.map +1 -0
  29. package/lib/exercises/math/calcul/operations/numberInverse.js +113 -0
  30. package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.d.ts.map +1 -1
  31. package/lib/exercises/math/calcul/proportionality/rectangleSideAfterReduction.js +4 -2
  32. package/lib/exercises/math/calcul/proportionality/scaleCalculation.d.ts.map +1 -1
  33. package/lib/exercises/math/calcul/proportionality/scaleCalculation.js +65 -35
  34. package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivityWithCoeff.js +2 -2
  35. package/lib/exercises/math/calculLitteral/distributivity/simpleDistriXCoeff.js +1 -1
  36. package/lib/exercises/math/calculLitteral/equation/choseOperationToSolveEquation.js +17 -17
  37. package/lib/exercises/math/calculLitteral/equation/equa1.js +1 -1
  38. package/lib/exercises/math/calculLitteral/equation/equa2.js +1 -1
  39. package/lib/exercises/math/calculLitteral/equation/equa3.d.ts.map +1 -1
  40. package/lib/exercises/math/calculLitteral/equation/equa3.js +2 -4
  41. package/lib/exercises/math/calculLitteral/equation/equa4.js +1 -1
  42. package/lib/exercises/math/calculLitteral/equation/equationFromSentenceExercise.d.ts.map +1 -1
  43. package/lib/exercises/math/calculLitteral/equation/equationFromSentenceExercise.js +78 -63
  44. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquation.js +3 -3
  45. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType1.js +1 -1
  46. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.d.ts.map +1 -1
  47. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType2.js +2 -4
  48. package/lib/exercises/math/calculLitteral/equation/firstDegreeEquationIntType3.js +1 -1
  49. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +1 -1
  50. package/lib/exercises/math/calculLitteral/factorisation/factoType2.js +1 -1
  51. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.d.ts.map +1 -1
  52. package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType0.js +4 -5
  53. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.d.ts.map +1 -1
  54. package/lib/exercises/math/calculLitteral/simplifying/evaluateExpression.js +1 -0
  55. package/lib/exercises/math/calculLitteral/simplifying/valuateExpression.js +1 -1
  56. package/lib/exercises/math/conversion/aeraConversion.d.ts.map +1 -1
  57. package/lib/exercises/math/conversion/aeraConversion.js +4 -4
  58. package/lib/exercises/math/conversion/hoursToDecimal.d.ts.map +1 -1
  59. package/lib/exercises/math/conversion/hoursToDecimal.js +6 -5
  60. package/lib/exercises/math/conversion/hoursToSecond.d.ts.map +1 -1
  61. package/lib/exercises/math/conversion/hoursToSecond.js +8 -7
  62. package/lib/exercises/math/conversion/lengthConversion.js +1 -1
  63. package/lib/exercises/math/conversion/massConversion.js +2 -2
  64. package/lib/exercises/math/conversion/volumeCapacityConversion.d.ts.map +1 -1
  65. package/lib/exercises/math/conversion/volumeCapacityConversion.js +42 -23
  66. package/lib/exercises/math/conversion/volumeConversion.js +2 -2
  67. package/lib/exercises/math/dataRepresentations/barChartReading.d.ts.map +1 -1
  68. package/lib/exercises/math/dataRepresentations/barChartReading.js +5 -5
  69. package/lib/exercises/math/dataRepresentations/tableReading.d.ts.map +1 -1
  70. package/lib/exercises/math/dataRepresentations/tableReading.js +4 -4
  71. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.d.ts.map +1 -1
  72. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeOne.js +27 -14
  73. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.d.ts.map +1 -1
  74. package/lib/exercises/math/derivation/derivative/ln/lnDerivativeThree.js +4 -5
  75. package/lib/exercises/math/derivation/derivative/polynomial/firstDegreeDerivative.js +1 -1
  76. package/lib/exercises/math/derivation/derivative/polynomial/secondDegreeDerivative.js +1 -1
  77. package/lib/exercises/math/derivation/derivative/polynomial/thirdDegreeDerivative.js +1 -1
  78. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.d.ts.map +1 -1
  79. package/lib/exercises/math/derivation/derivative/sqrt/sqrtProductDerivative.js +8 -5
  80. package/lib/exercises/math/derivation/tangent/derivativeNumberOrImageReading.d.ts +10 -0
  81. package/lib/exercises/math/derivation/tangent/derivativeNumberOrImageReading.d.ts.map +1 -0
  82. package/lib/exercises/math/derivation/tangent/derivativeNumberOrImageReading.js +144 -0
  83. package/lib/exercises/math/derivation/tangent/derivativeNumberReading.d.ts.map +1 -1
  84. package/lib/exercises/math/derivation/tangent/derivativeNumberReading.js +17 -12
  85. package/lib/exercises/math/derivation/tangent/derivativeTangentEquationReading.js +2 -2
  86. package/lib/exercises/math/derivation/tangent/horizontalTangentFromAlgebraic.d.ts +7 -0
  87. package/lib/exercises/math/derivation/tangent/horizontalTangentFromAlgebraic.d.ts.map +1 -0
  88. package/lib/exercises/math/derivation/tangent/horizontalTangentFromAlgebraic.js +108 -0
  89. package/lib/exercises/math/derivation/tangent/index.d.ts +3 -0
  90. package/lib/exercises/math/derivation/tangent/index.d.ts.map +1 -1
  91. package/lib/exercises/math/derivation/tangent/index.js +3 -0
  92. package/lib/exercises/math/derivation/tangent/tangentEquationWithData.d.ts +9 -0
  93. package/lib/exercises/math/derivation/tangent/tangentEquationWithData.d.ts.map +1 -0
  94. package/lib/exercises/math/derivation/tangent/tangentEquationWithData.js +121 -0
  95. package/lib/exercises/math/derivation/tangent/tangentEquations.d.ts.map +1 -1
  96. package/lib/exercises/math/derivation/tangent/tangentEquations.js +5 -5
  97. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.d.ts.map +1 -1
  98. package/lib/exercises/math/equaDiff/exponentialDifferentialEquationWithIC.js +6 -0
  99. package/lib/exercises/math/functions/affines/signFunction.d.ts.map +1 -1
  100. package/lib/exercises/math/functions/affines/signFunction.js +7 -7
  101. package/lib/exercises/math/functions/exponential/expEquation.d.ts.map +1 -1
  102. package/lib/exercises/math/functions/exponential/expEquation.js +4 -6
  103. package/lib/exercises/math/functions/exponentials/exponentialsVariations.js +1 -1
  104. package/lib/exercises/math/geometry/areas/circleArea.d.ts.map +1 -1
  105. package/lib/exercises/math/geometry/areas/circleArea.js +6 -3
  106. package/lib/exercises/math/geometry/areas/circleRadiusFromArea.d.ts.map +1 -1
  107. package/lib/exercises/math/geometry/areas/circleRadiusFromArea.js +6 -5
  108. package/lib/exercises/math/geometry/areas/rectangleArea.d.ts.map +1 -1
  109. package/lib/exercises/math/geometry/areas/rectangleArea.js +5 -4
  110. package/lib/exercises/math/geometry/areas/rectangleSideFromArea.d.ts.map +1 -1
  111. package/lib/exercises/math/geometry/areas/rectangleSideFromArea.js +3 -2
  112. package/lib/exercises/math/geometry/areas/rightTriangleArea.js +1 -1
  113. package/lib/exercises/math/geometry/areas/squareArea.d.ts.map +1 -1
  114. package/lib/exercises/math/geometry/areas/squareArea.js +4 -3
  115. package/lib/exercises/math/geometry/areas/triangleArea.d.ts.map +1 -1
  116. package/lib/exercises/math/geometry/areas/triangleArea.js +8 -5
  117. package/lib/exercises/math/geometry/areas/triangleAreaV2.d.ts.map +1 -1
  118. package/lib/exercises/math/geometry/areas/triangleAreaV2.js +3 -2
  119. package/lib/exercises/math/geometry/cartesian/drawAlineInGGB.js +1 -1
  120. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.d.ts.map +1 -1
  121. package/lib/exercises/math/geometry/cartesian/readAbscissOnLine.js +8 -6
  122. package/lib/exercises/math/geometry/cartesian/readAbscissOnSemiLine.js +1 -1
  123. package/lib/exercises/math/geometry/euclidianConstructions/buildTriangleWithSizes.js +1 -1
  124. package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
  125. package/lib/exercises/math/geometry/perimeters/circleCircumference.js +10 -8
  126. package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.d.ts.map +1 -1
  127. package/lib/exercises/math/geometry/perimeters/circleRadiusFromPerimeter.js +15 -13
  128. package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.d.ts.map +1 -1
  129. package/lib/exercises/math/geometry/perimeters/rectanglePerimeter.js +4 -3
  130. package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.d.ts.map +1 -1
  131. package/lib/exercises/math/geometry/perimeters/rectangleSideFromPerimeter.js +1 -0
  132. package/lib/exercises/math/geometry/perimeters/squarePerimeter.d.ts.map +1 -1
  133. package/lib/exercises/math/geometry/perimeters/squarePerimeter.js +3 -2
  134. package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.d.ts.map +1 -1
  135. package/lib/exercises/math/geometry/perimeters/squareSideFromPerimeter.js +1 -0
  136. package/lib/exercises/math/geometry/perimeters/trianglePerimeter.js +1 -1
  137. package/lib/exercises/math/geometry/pythagore/isTriangleRight.d.ts.map +1 -1
  138. package/lib/exercises/math/geometry/pythagore/isTriangleRight.js +6 -3
  139. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.d.ts.map +1 -1
  140. package/lib/exercises/math/geometry/pythagore/pythagoreCalcul.js +4 -3
  141. package/lib/exercises/math/geometry/triangles/triangleNature.js +1 -1
  142. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.d.ts.map +1 -1
  143. package/lib/exercises/math/geometry/triangles/triangleThirdAngleValue.js +11 -4
  144. package/lib/exercises/math/geometry/vectors/lineFromDirectorVector.js +1 -1
  145. package/lib/exercises/math/geometry/volumes/coneVolume.d.ts.map +1 -1
  146. package/lib/exercises/math/geometry/volumes/coneVolume.js +7 -8
  147. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
  148. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +21 -22
  149. package/lib/exercises/math/geometry/volumes/sphereVolume.d.ts.map +1 -1
  150. package/lib/exercises/math/geometry/volumes/sphereVolume.js +2 -1
  151. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.d.ts.map +1 -1
  152. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +6 -3
  153. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -1
  154. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +3 -2
  155. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts.map +1 -1
  156. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +3 -2
  157. package/lib/exercises/math/percent/averageEvolutionRate.js +1 -1
  158. package/lib/exercises/math/percent/evolutions/applyPercent.d.ts +9 -0
  159. package/lib/exercises/math/percent/evolutions/applyPercent.d.ts.map +1 -0
  160. package/lib/exercises/math/percent/evolutions/applyPercent.js +114 -0
  161. package/lib/exercises/math/percent/evolutions/averageEvolutionRate.d.ts +8 -0
  162. package/lib/exercises/math/percent/evolutions/averageEvolutionRate.d.ts.map +1 -0
  163. package/lib/exercises/math/percent/evolutions/averageEvolutionRate.js +104 -0
  164. package/lib/exercises/math/percent/evolutions/cmToEvolution.d.ts +7 -0
  165. package/lib/exercises/math/percent/evolutions/cmToEvolution.d.ts.map +1 -0
  166. package/lib/exercises/math/percent/evolutions/cmToEvolution.js +88 -0
  167. package/lib/exercises/math/percent/evolutions/compoundInterest.d.ts +12 -0
  168. package/lib/exercises/math/percent/evolutions/compoundInterest.d.ts.map +1 -0
  169. package/lib/exercises/math/percent/evolutions/compoundInterest.js +128 -0
  170. package/lib/exercises/math/percent/evolutions/evolutionRateFromValues.d.ts +8 -0
  171. package/lib/exercises/math/percent/evolutions/evolutionRateFromValues.d.ts.map +1 -0
  172. package/lib/exercises/math/percent/evolutions/evolutionRateFromValues.js +100 -0
  173. package/lib/exercises/math/percent/evolutions/evolutionToCM.d.ts +7 -0
  174. package/lib/exercises/math/percent/evolutions/evolutionToCM.d.ts.map +1 -0
  175. package/lib/exercises/math/percent/evolutions/evolutionToCM.js +83 -0
  176. package/lib/exercises/math/percent/evolutions/findEndValueAfterEvolution.d.ts +8 -0
  177. package/lib/exercises/math/percent/evolutions/findEndValueAfterEvolution.d.ts.map +1 -0
  178. package/lib/exercises/math/percent/evolutions/findEndValueAfterEvolution.js +102 -0
  179. package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.d.ts +10 -0
  180. package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.d.ts.map +1 -0
  181. package/lib/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.js +113 -0
  182. package/lib/exercises/math/percent/evolutions/findStartValueAfterEvolution.d.ts +8 -0
  183. package/lib/exercises/math/percent/evolutions/findStartValueAfterEvolution.d.ts.map +1 -0
  184. package/lib/exercises/math/percent/evolutions/findStartValueAfterEvolution.js +100 -0
  185. package/lib/exercises/math/percent/evolutions/globalPercent.d.ts +7 -0
  186. package/lib/exercises/math/percent/evolutions/globalPercent.d.ts.map +1 -0
  187. package/lib/exercises/math/percent/evolutions/globalPercent.js +104 -0
  188. package/lib/exercises/math/percent/evolutions/index.d.ts +12 -0
  189. package/lib/exercises/math/percent/evolutions/index.d.ts.map +1 -0
  190. package/lib/exercises/math/percent/evolutions/index.js +11 -0
  191. package/lib/exercises/math/percent/evolutions/reciprocalPercentage.d.ts +8 -0
  192. package/lib/exercises/math/percent/evolutions/reciprocalPercentage.d.ts.map +1 -0
  193. package/lib/exercises/math/percent/evolutions/reciprocalPercentage.js +108 -0
  194. package/lib/exercises/math/percent/findEndValueAfterEvolution.js +1 -1
  195. package/lib/exercises/math/percent/findProportion.d.ts.map +1 -1
  196. package/lib/exercises/math/percent/findProportion.js +12 -10
  197. package/lib/exercises/math/percent/findStartValueAfterEvolution.js +1 -1
  198. package/lib/exercises/math/percent/findTVA.d.ts.map +1 -1
  199. package/lib/exercises/math/percent/findTVA.js +4 -4
  200. package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -1
  201. package/lib/exercises/math/percent/htToTTC.js +11 -7
  202. package/lib/exercises/math/percent/index.d.ts +1 -10
  203. package/lib/exercises/math/percent/index.d.ts.map +1 -1
  204. package/lib/exercises/math/percent/index.js +1 -10
  205. package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
  206. package/lib/exercises/math/percent/percentToDecimal.js +4 -0
  207. package/lib/exercises/math/percent/percentWritings.d.ts.map +1 -1
  208. package/lib/exercises/math/percent/percentWritings.js +4 -4
  209. package/lib/exercises/math/percent/populationEffectifFromSubPopulation.d.ts.map +1 -1
  210. package/lib/exercises/math/percent/populationEffectifFromSubPopulation.js +7 -5
  211. package/lib/exercises/math/percent/reciprocalPercentage.js +1 -1
  212. package/lib/exercises/math/percent/subPopulationEffectifFromPercent.d.ts.map +1 -1
  213. package/lib/exercises/math/percent/subPopulationEffectifFromPercent.js +6 -4
  214. package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -1
  215. package/lib/exercises/math/percent/ttcToHT.js +4 -4
  216. package/lib/exercises/math/percent/valuePercent.d.ts.map +1 -1
  217. package/lib/exercises/math/percent/valuePercent.js +4 -4
  218. package/lib/exercises/math/powers/calculateNegativePower.d.ts.map +1 -1
  219. package/lib/exercises/math/powers/calculateNegativePower.js +6 -10
  220. package/lib/exercises/math/powers/calculatePower.d.ts.map +1 -1
  221. package/lib/exercises/math/powers/calculatePower.js +1 -0
  222. package/lib/exercises/math/powers/decimalToScientific.d.ts.map +1 -1
  223. package/lib/exercises/math/powers/decimalToScientific.js +36 -9
  224. package/lib/exercises/math/powers/powersMixOperations.d.ts.map +1 -1
  225. package/lib/exercises/math/powers/powersMixOperations.js +0 -4
  226. package/lib/exercises/math/powers/powersOfTenMixOperations.d.ts.map +1 -1
  227. package/lib/exercises/math/powers/powersOfTenMixOperations.js +0 -4
  228. package/lib/exercises/math/powers/powersOfTenToDecimal.js +2 -2
  229. package/lib/exercises/math/powers/powersProduct.d.ts.map +1 -1
  230. package/lib/exercises/math/powers/powersProduct.js +0 -5
  231. package/lib/exercises/math/powers/scientificToDecimal.js +2 -2
  232. package/lib/exercises/math/probaStat/ballsBasicProbas.d.ts.map +1 -1
  233. package/lib/exercises/math/probaStat/ballsBasicProbas.js +4 -4
  234. package/lib/exercises/math/probaStat/basicStats/calculateFrequency.d.ts.map +1 -1
  235. package/lib/exercises/math/probaStat/basicStats/calculateFrequency.js +4 -4
  236. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.d.ts +8 -0
  237. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.d.ts.map +1 -0
  238. package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.js +117 -0
  239. package/lib/exercises/math/probaStat/basicStats/index.d.ts +1 -0
  240. package/lib/exercises/math/probaStat/basicStats/index.d.ts.map +1 -1
  241. package/lib/exercises/math/probaStat/basicStats/index.js +1 -0
  242. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.d.ts.map +1 -1
  243. package/lib/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.js +66 -41
  244. package/lib/exercises/math/probaStat/cardBasicProbas.d.ts.map +1 -1
  245. package/lib/exercises/math/probaStat/cardBasicProbas.js +4 -2
  246. package/lib/exercises/math/probaStat/conditionalProbability.d.ts.map +1 -1
  247. package/lib/exercises/math/probaStat/conditionalProbability.js +168 -88
  248. package/lib/exercises/math/probaStat/diceBasicProbas.d.ts.map +1 -1
  249. package/lib/exercises/math/probaStat/diceBasicProbas.js +3 -0
  250. package/lib/exercises/math/probaStat/independancy.d.ts.map +1 -1
  251. package/lib/exercises/math/probaStat/independancy.js +18 -8
  252. package/lib/exercises/math/probaStat/issuesCountingForCards.d.ts.map +1 -1
  253. package/lib/exercises/math/probaStat/issuesCountingForCards.js +41 -15
  254. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
  255. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +4 -4
  256. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  257. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +5 -2
  258. package/lib/exercises/math/probaStat/probabilityTree.d.ts.map +1 -1
  259. package/lib/exercises/math/probaStat/probabilityTree.js +8 -4
  260. package/lib/exercises/math/probaStat/stats1var/medianList.d.ts.map +1 -1
  261. package/lib/exercises/math/probaStat/stats1var/medianList.js +1 -4
  262. package/lib/exercises/math/probaStat/stats1var/standardDeviationList.js +1 -1
  263. package/lib/exercises/math/probaStat/stats1var/standardDeviationTable.js +1 -1
  264. package/lib/exercises/math/probaStat/stats2var/averagePoint.d.ts.map +1 -1
  265. package/lib/exercises/math/probaStat/stats2var/averagePoint.js +25 -22
  266. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
  267. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +52 -43
  268. package/lib/exercises/math/sampling/confidenceInterval.d.ts.map +1 -1
  269. package/lib/exercises/math/sampling/confidenceInterval.js +4 -4
  270. package/lib/exercises/math/sampling/fluctuationInterval.d.ts.map +1 -1
  271. package/lib/exercises/math/sampling/fluctuationInterval.js +4 -4
  272. package/lib/exercises/math/sampling/isSamplingRepresentative.d.ts.map +1 -1
  273. package/lib/exercises/math/sampling/isSamplingRepresentative.js +5 -5
  274. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -1
  275. package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +0 -2
  276. package/lib/exercises/math/sequences/geometric/geometricVariations.js +1 -1
  277. package/lib/exercises/math/sets/intervals/inequalityToInterval.d.ts.map +1 -1
  278. package/lib/exercises/math/sets/intervals/inequalityToInterval.js +4 -4
  279. package/lib/exercises/math/sets/intervals/intervalToInequality.d.ts.map +1 -1
  280. package/lib/exercises/math/sets/intervals/intervalToInequality.js +4 -4
  281. package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts.map +1 -1
  282. package/lib/exercises/math/sets/intervals/intervalsIntersection.js +8 -1
  283. package/lib/exercises/math/sets/intervals/intervalsUnion.d.ts.map +1 -1
  284. package/lib/exercises/math/sets/intervals/intervalsUnion.js +3 -0
  285. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.d.ts.map +1 -1
  286. package/lib/exercises/math/spaceGeometry/basis/spaceCoordinatesInPrism.js +0 -5
  287. package/lib/exercises/math/spaceGeometry/index.js +1 -0
  288. package/lib/exercises/math/spaceGeometry/planes/index.d.ts +2 -0
  289. package/lib/exercises/math/spaceGeometry/planes/index.d.ts.map +1 -0
  290. package/lib/exercises/math/spaceGeometry/planes/index.js +2 -0
  291. package/lib/exercises/math/spaceGeometry/planes/isPointOnCartesianPlane.d.ts +2 -0
  292. package/lib/exercises/math/spaceGeometry/planes/isPointOnCartesianPlane.d.ts.map +1 -0
  293. package/lib/exercises/math/spaceGeometry/planes/isPointOnCartesianPlane.js +102 -0
  294. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.d.ts.map +1 -1
  295. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorCoordinatesFromPoints.js +4 -4
  296. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.d.ts.map +1 -1
  297. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorLinearCombinationCoords.js +4 -2
  298. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.d.ts.map +1 -1
  299. package/lib/exercises/math/spaceGeometry/vectors/spaceVectorNormCalculation.js +4 -6
  300. package/lib/exercises/math/trigonometry/arcLength.d.ts.map +1 -1
  301. package/lib/exercises/math/trigonometry/arcLength.js +5 -2
  302. package/lib/exercises/math/trigonometry/basicEquationCos.d.ts.map +1 -1
  303. package/lib/exercises/math/trigonometry/basicEquationCos.js +4 -3
  304. package/lib/exercises/math/trigonometry/basicEquationSin.d.ts.map +1 -1
  305. package/lib/exercises/math/trigonometry/basicEquationSin.js +4 -3
  306. package/lib/exercises/math/trigonometry/basicTrigoSystemEquation.d.ts.map +1 -1
  307. package/lib/exercises/math/trigonometry/basicTrigoSystemEquation.js +4 -3
  308. package/lib/exercises/math/trigonometry/calculateCosSinAndTan.d.ts.map +1 -1
  309. package/lib/exercises/math/trigonometry/calculateCosSinAndTan.js +1 -0
  310. package/lib/exercises/math/trigonometry/degreeToRadians.d.ts.map +1 -1
  311. package/lib/exercises/math/trigonometry/degreeToRadians.js +7 -6
  312. package/lib/exercises/math/trigonometry/equationCosOnRandomInterval.d.ts.map +1 -1
  313. package/lib/exercises/math/trigonometry/equationCosOnRandomInterval.js +4 -3
  314. package/lib/exercises/math/trigonometry/equationSinOnRandomInterval.d.ts.map +1 -1
  315. package/lib/exercises/math/trigonometry/equationSinOnRandomInterval.js +4 -3
  316. package/lib/exercises/math/trigonometry/mainAngleMeasure.d.ts.map +1 -1
  317. package/lib/exercises/math/trigonometry/mainAngleMeasure.js +4 -5
  318. package/lib/exercises/math/trigonometry/mainRemarkableValues.d.ts.map +1 -1
  319. package/lib/exercises/math/trigonometry/mainRemarkableValues.js +4 -3
  320. package/lib/exercises/math/trigonometry/trigonometry.js +2 -2
  321. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.d.ts.map +1 -1
  322. package/lib/exercises/math/trigonometry/trigonometryAngleCalcul.js +5 -3
  323. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.d.ts.map +1 -1
  324. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +6 -6
  325. package/lib/exercises/pc/chemicalElements/atomicStructureOfNucleus.js +1 -1
  326. package/lib/index.d.ts +47 -25
  327. package/lib/index.d.ts.map +1 -1
  328. package/lib/math/spaceGeometry/plane.d.ts +9 -0
  329. package/lib/math/spaceGeometry/plane.d.ts.map +1 -0
  330. package/lib/math/spaceGeometry/plane.js +22 -0
  331. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  332. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  333. package/lib/tree/nodes/equations/equationSolutionNode.d.ts +2 -2
  334. package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
  335. package/lib/tree/nodes/equations/equationSolutionNode.js +2 -2
  336. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  337. package/lib/tree/nodes/operators/fractionNode.js +4 -0
  338. package/package.json +1 -1
@@ -0,0 +1,102 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
4
+ import { round } from "../../../../math/utils/round.js";
5
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
6
+ import { euroParser } from "../../../../tree/parsers/euroParser.js";
7
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
8
+ import { approxOrEqual } from "../../../../utils/latex/approxOrEqual.js";
9
+ const getPropositions = (n, { answer, percentRate, vd }) => {
10
+ const propositions = [];
11
+ addValidProp(propositions, answer);
12
+ const cm = 1 + percentRate / 100;
13
+ tryToAddWrongProp(propositions, round(vd * percentRate, 2).frenchify());
14
+ const invCm = 1 - percentRate / 100;
15
+ tryToAddWrongProp(propositions, round(vd * invCm, 2).frenchify());
16
+ while (propositions.length < n) {
17
+ tryToAddWrongProp(propositions, round(randfloat(1, 100, 2), 2).frenchify());
18
+ }
19
+ return shuffleProps(propositions, n);
20
+ };
21
+ const getAnswer = (identifiers) => {
22
+ const cm = 1 + identifiers.percentRate / 100;
23
+ const vf = round(identifiers.vd * cm, 2);
24
+ return vf.frenchify();
25
+ };
26
+ const getInstruction = (identifiers) => {
27
+ const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
28
+ return `Le prix initial d'un objet est $${identifiers.vd.frenchify()}€$. Quel sera son prix après une ${evolution} de $${identifiers.percentRate.frenchify()}\\%$ ? Arrondir au centième.`;
29
+ };
30
+ const getHint = (identifiers) => {
31
+ return `Transforme le taux d'évolution en coefficient multiplicateur. Puis multiplie le prix initial par ce coefficient multiplicateur.`;
32
+ };
33
+ const getCorrection = (identifiers) => {
34
+ const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
35
+ const answer = getAnswer(identifiers);
36
+ const cm = round(1 + identifiers.percentRate / 100, 4);
37
+ const vd = identifiers.vd;
38
+ const percentRate = identifiers.percentRate;
39
+ return `Le coefficient multiplicateur associé à une ${evolution} de $${percentRate.frenchify()}\\%$ est :
40
+
41
+ ${alignTex([
42
+ ["CM", "=", "1+\\frac{t}{100}"],
43
+ ["", "=", `1+\\frac{${percentRate.frenchify()}}{100}`],
44
+ ["", "=", cm.frenchify()],
45
+ ])}
46
+
47
+ Si on note $V_d$ la valeur de départ et $V_a$ la valeur d'arrivée, alors on sait que :
48
+
49
+ $$
50
+ V_d\\times CM = V_a
51
+ $$
52
+
53
+ Le prix final arrondi au centième est donc :
54
+
55
+ ${alignTex([
56
+ ["V_a", "=", multiply(vd.frenchify(), cm.frenchify()).toTex()],
57
+ ["", ...approxOrEqual(cm * vd, 2)],
58
+ ])}
59
+ `;
60
+ };
61
+ const getKeys = (identifiers) => {
62
+ return [];
63
+ };
64
+ const isAnswerValid = (ans, { answer }) => {
65
+ return euroParser(ans) === answer + "€";
66
+ };
67
+ const getFindEndValueAfterEvolutionQuestion = () => {
68
+ const vd = randfloat(1, 100, 2);
69
+ const percentRate = randfloat(-100, 100, 2, [0]);
70
+ const identifiers = {
71
+ vd,
72
+ percentRate,
73
+ };
74
+ return getQuestionFromIdentifiers(identifiers);
75
+ };
76
+ const getQuestionFromIdentifiers = (identifiers) => {
77
+ const question = {
78
+ answer: getAnswer(identifiers),
79
+ instruction: getInstruction(identifiers),
80
+ keys: getKeys(identifiers),
81
+ answerFormat: "tex",
82
+ identifiers,
83
+ hint: getHint(identifiers),
84
+ correction: getCorrection(identifiers),
85
+ };
86
+ return question;
87
+ };
88
+ export const findEndValueAfterEvolution = {
89
+ id: "findEndValueAfterEvolution",
90
+ connector: "=",
91
+ label: "Retrouver un prix final à partir du prix initial et du taux d'évolution",
92
+ isSingleStep: true,
93
+ generator: (nb) => getDistinctQuestions(getFindEndValueAfterEvolutionQuestion, nb),
94
+ qcmTimer: 60,
95
+ freeTimer: 60,
96
+ ggbTimer: 60,
97
+ getPropositions,
98
+ isAnswerValid,
99
+ subject: "Mathématiques",
100
+ getQuestionFromIdentifiers,
101
+ hasHintAndCorrection: true,
102
+ };
@@ -0,0 +1,10 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ type: number;
4
+ price: number;
5
+ evolution: number;
6
+ askingFinalPrice: boolean;
7
+ };
8
+ export declare const findRightCalculForPriceEvolution: Exercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=findRightCalculForPriceEvolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findRightCalculForPriceEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findRightCalculForPriceEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAyIF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CAclE,CAAC"}
@@ -0,0 +1,113 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randint } from "../../../../math/utils/random/randint.js";
4
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
5
+ import { divide } from "../../../../tree/nodes/operators/divideNode.js";
6
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
7
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
8
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
9
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
10
+ import { random } from "../../../../utils/alea/random.js";
11
+ const getPropositions = (n, { answer, evolution, price, type }) => {
12
+ const propositions = [];
13
+ addValidProp(propositions, answer);
14
+ if (evolution > 0) {
15
+ tryToAddWrongProp(propositions, multiply(price, add(1, frac(Math.abs(evolution), 100))).toTex());
16
+ tryToAddWrongProp(propositions, multiply(price, Math.abs(evolution) / 100).toTex());
17
+ tryToAddWrongProp(propositions, divide(price, Math.abs(evolution)).toTex());
18
+ tryToAddWrongProp(propositions, divide(price, add(1, frac(Math.abs(evolution), 100))).toTex());
19
+ }
20
+ else {
21
+ tryToAddWrongProp(propositions, multiply(price, substract(1, frac(Math.abs(evolution), 100))).toTex());
22
+ tryToAddWrongProp(propositions, multiply(price, Math.abs(evolution) / 100).toTex());
23
+ tryToAddWrongProp(propositions, divide(price, Math.abs(evolution)).toTex());
24
+ tryToAddWrongProp(propositions, divide(price, substract(1, frac(Math.abs(evolution), 100))).toTex());
25
+ }
26
+ return shuffleProps(propositions, n);
27
+ };
28
+ const getAnswer = (identifiers) => {
29
+ const { type, price, evolution, askingFinalPrice } = identifiers;
30
+ if (askingFinalPrice)
31
+ return multiply(price, (evolution > 0 ? add : substract)(1, frac(Math.abs(evolution), 100))).toTex();
32
+ else
33
+ return multiply(price, Math.abs(evolution) / 100).toTex();
34
+ };
35
+ const getInstruction = (identifiers) => {
36
+ const { type, price, evolution, askingFinalPrice } = identifiers;
37
+ switch (type) {
38
+ case 1:
39
+ return `Un manteau coûte $${price}€$. Le magasin propose une réduction de $${Math.abs(evolution)}\\%$ sur cet article. Quel calcul peut-on faire pour trouver le ${askingFinalPrice
40
+ ? "nouveau prix de l'article"
41
+ : "montant de la réduction"} ?`;
42
+ case 2:
43
+ return `Le budget d'un club de sport est de $${price}€$. Suite à des pertes d'abonnés, ce budget diminuera de $${Math.abs(evolution)}\\%$ l'année prochaine. Quel calcul peut-on faire pour trouver le ${askingFinalPrice
44
+ ? "budget du club l'an prochain"
45
+ : "montant de la diminution"} ?`;
46
+ case 3:
47
+ return `L'abonnement à une plateforme de streaming coûte $${price}€$. Le mois prochain, ce prix augmentera de $${evolution}\\%$. Quel calcul peut-on faire pour trouver le ${askingFinalPrice
48
+ ? "nouveau prix de l'abonnement"
49
+ : "montant de l'augmentation"} ?`;
50
+ case 4:
51
+ return `Le salaire de M. Moulin est de $${price}€$. Le mois prochain, il recevra une augmentation de $${evolution}\\%$. Quel calcul peut-on faire pour trouver le ${askingFinalPrice
52
+ ? "nouveau salaire de M. Moulin"
53
+ : "montant de l'augmentation"} ?`;
54
+ }
55
+ return "";
56
+ };
57
+ // const getHint: GetHint<Identifiers> = (identifiers) => {
58
+ // return "";
59
+ // };
60
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
61
+ // return "";
62
+ // };
63
+ const getKeys = (identifiers) => {
64
+ return [];
65
+ };
66
+ const isAnswerValid = (ans, { answer }) => {
67
+ throw Error("VEA not implemented");
68
+ };
69
+ const getFindRightCalculQuestion = (ops) => {
70
+ const evolution = randint(-6, 7, [0]) * 10;
71
+ const type = evolution < 0 ? random([1, 2]) : random([3, 4]);
72
+ const price = type === 1
73
+ ? randint(30, 400)
74
+ : type === 2
75
+ ? 10000 * randint(5, 20)
76
+ : type === 3
77
+ ? randint(10, 50)
78
+ : randint(1300, 2000);
79
+ const askingFinalPrice = coinFlip();
80
+ const identifiers = {
81
+ type,
82
+ price,
83
+ evolution,
84
+ askingFinalPrice,
85
+ };
86
+ return getQuestionFromIdentifiers(identifiers);
87
+ };
88
+ const getQuestionFromIdentifiers = (identifiers) => {
89
+ const question = {
90
+ answer: getAnswer(identifiers),
91
+ instruction: getInstruction(identifiers),
92
+ keys: getKeys(identifiers),
93
+ answerFormat: "tex",
94
+ identifiers,
95
+ // hint: getHint(identifiers),
96
+ // correction: getCorrection(identifiers),
97
+ };
98
+ return question;
99
+ };
100
+ export const findRightCalculForPriceEvolution = {
101
+ id: "findRightCalculForPriceEvolution",
102
+ connector: "=",
103
+ label: "Choisir le bon calcul pour appliquer une évolution en pourcentage",
104
+ isSingleStep: true,
105
+ generator: (nb, opts) => getDistinctQuestions(() => getFindRightCalculQuestion(opts), nb),
106
+ qcmTimer: 60,
107
+ freeTimer: 60,
108
+ getPropositions,
109
+ isAnswerValid,
110
+ subject: "Mathématiques",
111
+ answerType: "QCU",
112
+ getQuestionFromIdentifiers,
113
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ vf: number;
4
+ percentRate: number;
5
+ };
6
+ export declare const findStartValueAfterEvolution: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=findStartValueAfterEvolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findStartValueAfterEvolution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/findStartValueAfterEvolution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAiGF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAgB9D,CAAC"}
@@ -0,0 +1,100 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
4
+ import { round } from "../../../../math/utils/round.js";
5
+ import { euroParser } from "../../../../tree/parsers/euroParser.js";
6
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
7
+ const getPropositions = (n, { answer, percentRate, vf }) => {
8
+ const propositions = [];
9
+ addValidProp(propositions, answer);
10
+ const invCm = 1 - percentRate / 100;
11
+ tryToAddWrongProp(propositions, round(vf * invCm, 2).frenchify());
12
+ while (propositions.length < n) {
13
+ tryToAddWrongProp(propositions, round(randfloat(1, 100, 2), 2).frenchify());
14
+ }
15
+ return shuffleProps(propositions, n);
16
+ };
17
+ const getAnswer = (identifiers) => {
18
+ const cm = 1 + identifiers.percentRate / 100;
19
+ const vd = round(identifiers.vf / cm, 2);
20
+ return vd.frenchify();
21
+ };
22
+ const getInstruction = (identifiers) => {
23
+ const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
24
+ return `Après une ${evolution} de $${identifiers.percentRate.frenchify()}\\%$, le prix d'un objet est de $${identifiers.vf.frenchify()}€$.
25
+
26
+ Quel était son prix initial ? Arrondir au centième.`;
27
+ };
28
+ const getHint = (identifiers) => {
29
+ return `Transforme le taux d'évolution en coefficient multiplicateur. Puis divise le prix final par ce coefficient multiplicateur.`;
30
+ };
31
+ const getCorrection = (identifiers) => {
32
+ const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
33
+ const answer = getAnswer(identifiers);
34
+ const cm = round(1 + identifiers.percentRate / 100, 4);
35
+ return `Le coefficient multiplicateur associé à une ${evolution} de $${identifiers.percentRate.frenchify()}\\%$ est :
36
+
37
+
38
+ ${alignTex([
39
+ ["CM", "=", "1+\\frac{t}{100}"],
40
+ ["", "=", `1+\\frac{${identifiers.percentRate.frenchify()}}{100}`],
41
+ ["", "=", cm.frenchify()],
42
+ ])}
43
+
44
+
45
+ Si on note $V_d$ la valeur de départ et $V_a$ la valeur d'arrivée, alors on sait que :
46
+
47
+ $$
48
+ V_d\\times CM = V_a
49
+ $$
50
+
51
+ Donc, pour trouver $V_d$, il faut diviser $V_a$ par le coefficient multiplicateur :
52
+
53
+ ${alignTex([
54
+ ["V_d", "=", `\\frac{${identifiers.vf.frenchify()}}{${cm.frenchify()}}`],
55
+ ["", "\\approx", answer],
56
+ ])}
57
+ `;
58
+ };
59
+ const getKeys = (identifiers) => {
60
+ return [];
61
+ };
62
+ const isAnswerValid = (ans, { answer }) => {
63
+ return euroParser(ans) === answer + "€";
64
+ };
65
+ const getFindStartValueAfterEvolutionQuestion = () => {
66
+ const vf = randfloat(1, 100, 2);
67
+ const percentRate = randfloat(-99, 100, 2, [0]);
68
+ const identifiers = {
69
+ vf,
70
+ percentRate,
71
+ };
72
+ return getQuestionFromIdentifiers(identifiers);
73
+ };
74
+ const getQuestionFromIdentifiers = (identifiers) => {
75
+ const question = {
76
+ answer: getAnswer(identifiers),
77
+ instruction: getInstruction(identifiers),
78
+ keys: getKeys(identifiers),
79
+ answerFormat: "tex",
80
+ identifiers,
81
+ hint: getHint(identifiers),
82
+ correction: getCorrection(identifiers),
83
+ };
84
+ return question;
85
+ };
86
+ export const findStartValueAfterEvolution = {
87
+ id: "findStartValueAfterEvolution",
88
+ connector: "=",
89
+ label: "Retrouver un prix initial à partir du prix final et du taux d'évolution",
90
+ isSingleStep: true,
91
+ generator: (nb) => getDistinctQuestions(getFindStartValueAfterEvolutionQuestion, nb),
92
+ qcmTimer: 60,
93
+ freeTimer: 60,
94
+ ggbTimer: 60,
95
+ getPropositions,
96
+ isAnswerValid,
97
+ subject: "Mathématiques",
98
+ getQuestionFromIdentifiers,
99
+ hasHintAndCorrection: true,
100
+ };
@@ -0,0 +1,7 @@
1
+ import { Exercise } from "../../../exercise.js";
2
+ type Identifiers = {
3
+ evolutions: string[];
4
+ };
5
+ export declare const globalPercent: Exercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=globalPercent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalPercent.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/globalPercent.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAaT,MAAM,sBAAsB,CAAC;AAO9B,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AA4GF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAc/C,CAAC"}
@@ -0,0 +1,104 @@
1
+ import { randint } from "../../../../math/utils/random/randint.js";
2
+ import { addValidProp, tryToAddWrongProp, } from "../../../exercise.js";
3
+ import { getDistinctQuestions } from "../../../utils/getDistinctQuestions.js";
4
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
5
+ import { round } from "../../../../math/utils/round.js";
6
+ import { percentParser } from "../../../../tree/parsers/percentParser.js";
7
+ const getInstruction = (identifiers) => {
8
+ let instruction = "Le prix d'un article subit une ";
9
+ identifiers.evolutions.forEach((evolution, i) => {
10
+ const type = evolution[0] === "-" ? "baisse" : "hausse";
11
+ if (i === 0)
12
+ instruction += `${type} de $${evolution.substring(1)}\\%$`;
13
+ else
14
+ instruction += `, puis une ${type} de $${evolution.substring(1)}\\%$`;
15
+ });
16
+ instruction += `.
17
+
18
+ Déterminer le taux d'évolution global du prix de cet article (arrondir au centième de pourcentage).`;
19
+ return instruction;
20
+ };
21
+ const getAnswer = (identifiers) => {
22
+ const { evolutions } = identifiers;
23
+ const cms = evolutions.map((e) => 1 + Number(e) / 100);
24
+ const prod = cms.reduce((acc, curr) => acc * curr, 1);
25
+ const answer = round((prod - 1) * 100, 2).frenchify() + "\\%";
26
+ return answer;
27
+ };
28
+ const getHint = (identifiers) => {
29
+ return "Transforme chaque taux d'évolution en coefficient multiplicateur, puis multiplie ces coefficients multiplicateurs entre eux pour obtenir le coefficient multiplicateur global. Transforme alors ce CM global en taux d'évolution.";
30
+ };
31
+ const getCorrection = (identifiers) => {
32
+ const { evolutions } = identifiers;
33
+ const answer = getAnswer(identifiers);
34
+ return `On transforme les taux d'évolution en coefficients multiplicateurs puis on les multiplie entre eux :
35
+
36
+ $$
37
+ ${evolutions
38
+ .map((e) => round(1 + Number(e) / 100, 2).frenchify())
39
+ .join(" \\times ")} = ${round(evolutions.reduce((acc, curr) => acc * round(1 + Number(curr) / 100, 2), 1), 4).frenchify()}
40
+ $$
41
+
42
+ Enfin, on transforme ce CM global en taux d'évolution :
43
+
44
+ $$
45
+ (${round(evolutions.reduce((acc, curr) => acc * round(1 + Number(curr) / 100, 2), 1), 4).frenchify()} - 1)\\times 100 = ${answer.replace("\\%", "")}
46
+ $$
47
+
48
+ Le taux d'évolution global est donc de $${answer}$.
49
+ `;
50
+ };
51
+ const getGlobalPercentQuestion = () => {
52
+ const indice = randint(2, 4);
53
+ const evolutions = [];
54
+ for (let i = 0; i < indice; i++) {
55
+ const randPercent = randint(1, 50);
56
+ let a = randint(0, 2);
57
+ evolutions.push((a === 0 ? "+" : "-") + randPercent);
58
+ }
59
+ const identifiers = { evolutions };
60
+ return getQuestionFromIdentifiers(identifiers);
61
+ };
62
+ const getQuestionFromIdentifiers = (identifiers) => {
63
+ const question = {
64
+ instruction: getInstruction(identifiers),
65
+ answer: getAnswer(identifiers),
66
+ keys: ["percent"],
67
+ answerFormat: "tex",
68
+ identifiers,
69
+ hint: getHint(identifiers),
70
+ correction: getCorrection(identifiers),
71
+ };
72
+ return question;
73
+ };
74
+ const getPropositions = (n, { answer }) => {
75
+ const propositions = [];
76
+ addValidProp(propositions, answer);
77
+ while (propositions.length < n) {
78
+ let wrongAnswer = Number(answer.replace(",", ".").replace(`\\%`, ""));
79
+ const deviation = Math.random() < 0.5 ? -1 : 1;
80
+ const percentDeviation = Math.random() * 20 + 1;
81
+ wrongAnswer += deviation * percentDeviation;
82
+ wrongAnswer = round(wrongAnswer, 2);
83
+ tryToAddWrongProp(propositions, `${(wrongAnswer + "").replace(".", ",")} \\%`);
84
+ }
85
+ return shuffle(propositions);
86
+ };
87
+ const isAnswerValid = (ans, { answer }) => {
88
+ const parsed = percentParser(ans);
89
+ return parsed === answer.replace("+", "");
90
+ };
91
+ export const globalPercent = {
92
+ id: "globalPercent",
93
+ connector: "=",
94
+ label: "Calculer un taux d'évolution global à partir de taux d'évolution successifs",
95
+ isSingleStep: false,
96
+ generator: (nb) => getDistinctQuestions(getGlobalPercentQuestion, nb),
97
+ qcmTimer: 60,
98
+ freeTimer: 60,
99
+ getPropositions,
100
+ isAnswerValid,
101
+ subject: "Mathématiques",
102
+ hasHintAndCorrection: true,
103
+ getQuestionFromIdentifiers,
104
+ };
@@ -0,0 +1,12 @@
1
+ export * from "./applyPercent.js";
2
+ export * from "./averageEvolutionRate.js";
3
+ export * from "./evolutionToCM.js";
4
+ export * from "./globalPercent.js";
5
+ export * from "./reciprocalPercentage.js";
6
+ export * from "./cmToEvolution.js";
7
+ export * from "./evolutionRateFromValues.js";
8
+ export * from "./findStartValueAfterEvolution.js";
9
+ export * from "./findEndValueAfterEvolution.js";
10
+ export * from "./findRightCalculForPriceEvolution.js";
11
+ export * from "./compoundInterest.js";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAClD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uCAAuC,CAAC;AACtD,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,11 @@
1
+ export * from "./applyPercent.js";
2
+ export * from "./averageEvolutionRate.js";
3
+ export * from "./evolutionToCM.js";
4
+ export * from "./globalPercent.js";
5
+ export * from "./reciprocalPercentage.js";
6
+ export * from "./cmToEvolution.js";
7
+ export * from "./evolutionRateFromValues.js";
8
+ export * from "./findStartValueAfterEvolution.js";
9
+ export * from "./findEndValueAfterEvolution.js";
10
+ export * from "./findRightCalculForPriceEvolution.js";
11
+ export * from "./compoundInterest.js";
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercise.js";
2
+ type Identifiers = {
3
+ randPercent: number;
4
+ isUp: boolean;
5
+ };
6
+ export declare const reciprocalPercentage: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=reciprocalPercentage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reciprocalPercentage.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/percent/evolutions/reciprocalPercentage.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAaT,MAAM,sBAAsB,CAAC;AAM9B,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AA6HF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CActD,CAAC"}
@@ -0,0 +1,108 @@
1
+ import { randint } from "../../../../math/utils/random/randint.js";
2
+ import { addValidProp, tryToAddWrongProp, } from "../../../exercise.js";
3
+ import { getDistinctQuestions } from "../../../utils/getDistinctQuestions.js";
4
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
5
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
6
+ import { round } from "../../../../math/utils/round.js";
7
+ import { percentParser } from "../../../../tree/parsers/percentParser.js";
8
+ const getCorrection = (identifiers) => {
9
+ let ans = 0;
10
+ const { isUp, randPercent } = identifiers;
11
+ ans = identifiers.isUp
12
+ ? (1 / (1 + identifiers.randPercent / 100) - 1) * 100
13
+ : (1 / (1 - identifiers.randPercent / 100) - 1) * 100;
14
+ const answer = `${(ans > 0
15
+ ? "+" + round(ans, 2)
16
+ : "" + round(ans, 2)).replace(".", ",")}\\%`;
17
+ const cm = round(1 + (identifiers.isUp ? identifiers.randPercent / 100 : -randPercent / 100), 4);
18
+ const recipCm = round(1 / cm, 4);
19
+ return `Le coefficient multiplicateur correspondant à une ${isUp ? "hausse" : "baisse"} de $${randPercent}\\%$ est :
20
+
21
+ $$
22
+ 1${isUp ? "+" : "-"}\\frac{${randPercent}}{100} = ${cm.frenchify()}
23
+ $$
24
+
25
+ Le coefficient multiplicateur réciproque est l'inverse du coefficient multiplicateur :
26
+
27
+ $$
28
+ \\frac{1}{${cm.frenchify()}} = ${recipCm.frenchify()}
29
+ $$
30
+
31
+ On transforme ce coefficient multiplicateur en taux d'évolution :
32
+
33
+ $$
34
+ (${recipCm.frenchify()}-1)\\times 100 = ${round(ans, 2).frenchify()}\\%
35
+ $$
36
+
37
+ Ainsi, le taux d'évolution permettant de revenir au prix initial est de $${answer}$.
38
+ `;
39
+ };
40
+ const getHint = (identifiers) => {
41
+ const { isUp, randPercent } = identifiers;
42
+ return `Calcule le coefficient multiplicateur associé à une ${isUp ? "hausse" : "baisse"} de $${randPercent}\\%$. Puis calcule le coefficient multiplicateur réciproque : c'est l'inverse du coefficient multiplicateur. Il ne reste alors plus qu'à transformer le coefficient multiplicateur réciproque en taux d'évolution.`;
43
+ };
44
+ const getInstruction = (identifiers) => {
45
+ const { isUp, randPercent } = identifiers;
46
+ let instruction = `Le prix d'un article subit une ${isUp ? "hausse" : "baisse"} de $${randPercent}\\%$. Quelle évolution devra-t-il subir pour revenir à son prix initial ? Arrondir au centième de pourcentage.`;
47
+ return instruction;
48
+ };
49
+ const getAnswer = (identifiers) => {
50
+ const { isUp, randPercent } = identifiers;
51
+ let ans = 0;
52
+ ans = isUp
53
+ ? (1 / (1 + randPercent / 100) - 1) * 100
54
+ : (1 / (1 - randPercent / 100) - 1) * 100;
55
+ const answer = `${(ans > 0
56
+ ? "+" + round(ans, 2)
57
+ : "" + round(ans, 2)).replace(".", ",")}\\%`;
58
+ return answer;
59
+ };
60
+ const getReciprocalPercentageQuestion = () => {
61
+ const randPercent = randint(1, 50);
62
+ const isUp = coinFlip();
63
+ const identifiers = { isUp, randPercent };
64
+ return getQuestionFromIdentifiers(identifiers);
65
+ };
66
+ const getQuestionFromIdentifiers = (identifiers) => {
67
+ const question = {
68
+ instruction: getInstruction(identifiers),
69
+ answer: getAnswer(identifiers),
70
+ keys: ["percent"],
71
+ answerFormat: "tex",
72
+ identifiers,
73
+ hint: getHint(identifiers),
74
+ correction: getCorrection(identifiers),
75
+ };
76
+ return question;
77
+ };
78
+ const getPropositions = (n, { answer }) => {
79
+ const propositions = [];
80
+ addValidProp(propositions, answer);
81
+ while (propositions.length < n) {
82
+ let wrongAnswer = Number(answer.replace(",", ".").replace("+", "").replace(`\\%`, ""));
83
+ const deviation = Math.random() < 0.5 ? -1 : 1;
84
+ const percentDeviation = Math.random() * 20 + 1;
85
+ wrongAnswer += deviation * percentDeviation;
86
+ wrongAnswer = round(wrongAnswer, 2);
87
+ tryToAddWrongProp(propositions, `${(wrongAnswer > 0 ? "+" + wrongAnswer : "" + wrongAnswer).replace(".", ",")} \\%`);
88
+ }
89
+ return shuffle(propositions);
90
+ };
91
+ const isAnswerValid = (ans, { answer }) => {
92
+ const parsed = percentParser(ans);
93
+ return parsed === answer.replace("+", "");
94
+ };
95
+ export const reciprocalPercentage = {
96
+ id: "reciprocalPercentage",
97
+ connector: "=",
98
+ label: "Calculer un taux d'évolution réciproque",
99
+ isSingleStep: false,
100
+ generator: (nb) => getDistinctQuestions(getReciprocalPercentageQuestion, nb),
101
+ qcmTimer: 60,
102
+ freeTimer: 60,
103
+ getPropositions,
104
+ isAnswerValid,
105
+ subject: "Mathématiques",
106
+ hasHintAndCorrection: true,
107
+ getQuestionFromIdentifiers,
108
+ };
@@ -28,7 +28,7 @@ const getInstruction = (identifiers) => {
28
28
  return `Le prix initial d'un objet est $${identifiers.vd.frenchify()}€$. Quel sera son prix après une ${evolution} de $${identifiers.percentRate.frenchify()}\\%$ ? Arrondir au centième.`;
29
29
  };
30
30
  const getHint = (identifiers) => {
31
- return `Transforme le taux d'évolution en coefficient multiplicateur. Puis, multiplie le prix initial par ce coefficient multiplicateur.`;
31
+ return `Transforme le taux d'évolution en coefficient multiplicateur. Puis multiplie le prix initial par ce coefficient multiplicateur.`;
32
32
  };
33
33
  const getCorrection = (identifiers) => {
34
34
  const evolution = identifiers.percentRate < 0 ? "baisse" : "hausse";
@@ -1 +1 @@
1
- {"version":3,"file":"findProportion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findProportion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA0EF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAoBhD,CAAC"}
1
+ {"version":3,"file":"findProportion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/percent/findProportion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAkFF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}