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
@@ -149,11 +149,6 @@ export const powersProduct = {
149
149
  isAnswerValid,
150
150
  subject: "Mathématiques",
151
151
  hasHintAndCorrection: true,
152
- getAnswer,
153
- getCorrection,
154
- getHint,
155
- getInstruction,
156
- getStartStatement,
157
152
  options,
158
153
  getQuestionFromIdentifiers,
159
154
  };
@@ -24,9 +24,9 @@ const getAnswer = (identifiers) => {
24
24
  };
25
25
  const getHint = (identifiers) => {
26
26
  const { decimal, tenPower } = identifiers;
27
- return `Si $x$ est un entier négatif, alors multiplier par $10^x$ revient à déplacer la virgule de $x$ rangs vers la gauche.
27
+ return `Si $n$ est un entier négatif, alors multiplier par $10^n$ revient à déplacer la virgule de $n$ rangs vers la gauche.
28
28
 
29
- Si $x$ est un entier positif, alors multiplier par $10^x$ revient à déplacer la virgule de $x$ rangs vers la droite.`;
29
+ Si $n$ est un entier positif, alors multiplier par $10^n$ revient à déplacer la virgule de $n$ rangs vers la droite.`;
30
30
  };
31
31
  const getCorrection = (identifiers) => {
32
32
  const { decimal, tenPower } = identifiers;
@@ -1 +1 @@
1
- {"version":3,"file":"ballsBasicProbas.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/ballsBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AA8FF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAmBlD,CAAC"}
1
+ {"version":3,"file":"ballsBasicProbas.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/ballsBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAoGF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAgBlD,CAAC"}
@@ -41,6 +41,9 @@ const getBallsBasicProbasQuestion = () => {
41
41
  const repartitions = [randint(1, 4), randint(1, 4), randint(1, 4)];
42
42
  const colorAskedIndex = randint(0, 3);
43
43
  const identifiers = { colorAskedIndex, repartitions };
44
+ return getQuestionFromIdentifiers(identifiers);
45
+ };
46
+ const getQuestionFromIdentifiers = (identifiers) => {
44
47
  const question = {
45
48
  answer: getAnswer(identifiers),
46
49
  instruction: getInstruction(identifiers),
@@ -90,9 +93,6 @@ export const ballsBasicProbas = {
90
93
  getPropositions,
91
94
  isAnswerValid,
92
95
  subject: "Mathématiques",
93
- getInstruction,
94
- getAnswer,
95
96
  hasHintAndCorrection: true,
96
- getHint,
97
- getCorrection,
97
+ getQuestionFromIdentifiers,
98
98
  };
@@ -1 +1 @@
1
- {"version":3,"file":"calculateFrequency.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicStats/calculateFrequency.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA2IF,KAAK,OAAO,GAAG;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAUF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkB7D,CAAC"}
1
+ {"version":3,"file":"calculateFrequency.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicStats/calculateFrequency.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAgJF,KAAK,OAAO,GAAG;IACb,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAUF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe7D,CAAC"}
@@ -40,10 +40,13 @@ const getInstruction = (identifiers, opts) => {
40
40
  switch (type) {
41
41
  case 0: //pièce
42
42
  instruction = `On lance une pièce de monnaie $${nbEssais}$ fois. On tombe $${k}$ fois sur ${caracType}.`;
43
+ break;
43
44
  case 1: //dé 6 faces
44
45
  instruction = `On lance un dé à $6$ faces $${nbEssais}$ fois. On tombe $${k}$ fois sur ${caracType}.`;
46
+ break;
45
47
  case 2: // dé X faces
46
48
  instruction = `On lance un dé à $12$ faces $${nbEssais}$ fois. On tombe $${k}$ fois sur ${caracType}.`;
49
+ break;
47
50
  case 3:
48
51
  default: //deux dés 6 faces
49
52
  instruction = `On lance deux dés à $6$ faces $${nbEssais}$ fois. On note la somme obtenue. On tombe $${k}$ fois sur ${caracType}.`;
@@ -125,10 +128,7 @@ export const calculateFrequency = {
125
128
  getPropositions,
126
129
  isAnswerValid,
127
130
  subject: "Mathématiques",
128
- getInstruction,
129
- getHint,
130
- getCorrection,
131
- getAnswer,
131
+ getQuestionFromIdentifiers,
132
132
  hasHintAndCorrection: true,
133
133
  options,
134
134
  };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ values: number[];
4
+ target: number;
5
+ };
6
+ export declare const calculateFrequencyInList: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=calculateFrequencyInList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculateFrequencyInList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicStats/calculateFrequencyInList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAoHF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAc1D,CAAC"}
@@ -0,0 +1,117 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
4
+ import { randint } from "../../../../math/utils/random/randint.js";
5
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
6
+ import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
7
+ import { probaFlip } from "../../../../utils/alea/probaFlip.js";
8
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
9
+ const getPropositions = (n, { answer, ...identifiers }) => {
10
+ const propositions = [];
11
+ addValidProp(propositions, answer);
12
+ const { target, values } = identifiers;
13
+ const nb = values.filter((v) => v === target).length;
14
+ tryToAddWrongProp(propositions, nb.frenchify());
15
+ while (propositions.length < n) {
16
+ tryToAddWrongProp(propositions, RationalConstructor.randomIrreductible().toTree().toTex());
17
+ }
18
+ return shuffleProps(propositions, n);
19
+ };
20
+ const getAnswer = (identifiers) => {
21
+ const { target, values } = identifiers;
22
+ const nb = values.filter((v) => v === target).length;
23
+ return frac(nb, values.length).simplify({ fractionsToDecimal: true }).toTex();
24
+ };
25
+ const getInstruction = (identifiers) => {
26
+ const { target, values } = identifiers;
27
+ const length = values.length;
28
+ return `Voici une liste de nombres :
29
+
30
+ $$
31
+ ${values.slice(0, length / 2).join("\\ ; \\ ")} \\ ; \\
32
+ \\newline
33
+ ${values.slice(length / 2, 20).join("\\ ; \\ ")}
34
+ $$
35
+
36
+ Quelle est la fréquence d'apparition du nombre $${target}$ dans cette liste ?
37
+
38
+ Donner la réponse sous forme de fraction, ou si possible de nombre décimal ou de pourcentage.`;
39
+ };
40
+ const getHint = (identifiers) => {
41
+ const { target, values } = identifiers;
42
+ return `La fréquence d'apparition du nombre $${target}$ est égale au nombre de fois qu'il apparait dans la liste divisé par le nombre total d'élements de la liste.`;
43
+ };
44
+ const getCorrection = (identifiers) => {
45
+ const { target, values } = identifiers;
46
+ const nb = values.filter((v) => v === target).length;
47
+ const rawFrac = frac(nb, values.length);
48
+ const answer = getAnswer(identifiers);
49
+ const hasSimp = rawFrac.toTex() !== answer;
50
+ return `Il y a $${values.length}$ nombres dans cette liste, dont $${nb}$ fois le nombre $${target}$.
51
+
52
+ La fréquence d'apparition de $${target}$ est donc :
53
+
54
+ $$
55
+ ${hasSimp ? rawFrac.toTex() + "=" + answer : answer}
56
+ $$
57
+ `;
58
+ };
59
+ const getKeys = (identifiers) => {
60
+ return ["percent"];
61
+ };
62
+ const isAnswerValid = (ans, { answer }) => {
63
+ try {
64
+ if (ans.includes("%")) {
65
+ const formated = ans.replace("\\%", "");
66
+ const nb = formated.unfrenchify();
67
+ if (isNaN(nb))
68
+ return false;
69
+ return (frac(nb, 100).simplify({ fractionsToDecimal: true }).toTex() === answer);
70
+ }
71
+ else {
72
+ const parsed = parseAlgebraic(ans);
73
+ return parsed.simplify({ fractionsToDecimal: true }).toTex() === answer;
74
+ }
75
+ }
76
+ catch (err) {
77
+ return handleVEAError(err);
78
+ }
79
+ };
80
+ const getCalculateFrequencyInListQuestion = (ops) => {
81
+ const target = randint(1, 10);
82
+ const length = randint(6, 13);
83
+ const values = [];
84
+ for (let i = 0; i < length; i++) {
85
+ values.push(probaFlip(0.4) ? target : randint(1, 10));
86
+ }
87
+ const identifiers = {
88
+ target,
89
+ values,
90
+ };
91
+ return getQuestionFromIdentifiers(identifiers);
92
+ };
93
+ const getQuestionFromIdentifiers = (identifiers) => {
94
+ return {
95
+ answer: getAnswer(identifiers),
96
+ instruction: getInstruction(identifiers),
97
+ keys: getKeys(identifiers),
98
+ answerFormat: "tex",
99
+ identifiers,
100
+ hint: getHint(identifiers),
101
+ correction: getCorrection(identifiers),
102
+ };
103
+ };
104
+ export const calculateFrequencyInList = {
105
+ id: "calculateFrequencyInList",
106
+ connector: "=",
107
+ label: "Calculer la fréquence d'apparition d'un nombre dans une liste",
108
+ isSingleStep: true,
109
+ generator: (nb, opts) => getDistinctQuestions(() => getCalculateFrequencyInListQuestion(opts), nb),
110
+ qcmTimer: 60,
111
+ freeTimer: 60,
112
+ getPropositions,
113
+ isAnswerValid,
114
+ subject: "Mathématiques",
115
+ getQuestionFromIdentifiers,
116
+ hasHintAndCorrection: true,
117
+ };
@@ -1,2 +1,3 @@
1
1
  export * from "./calculateFrequency.js";
2
+ export * from "./calculateFrequencyInList.js";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicStats/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicStats/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from "./calculateFrequency.js";
2
+ export * from "./calculateFrequencyInList.js";
@@ -1 +1 @@
1
- {"version":3,"file":"calculateProbaOfBinomialDistribution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqHF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,WAAW,CActE,CAAC"}
1
+ {"version":3,"file":"calculateProbaOfBinomialDistribution.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/binomial/calculateProbaOfBinomialDistribution.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AA0IF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,WAAW,CAatE,CAAC"}
@@ -4,40 +4,81 @@ import { Rational } from "../../../../math/numbers/rationals/rational.js";
4
4
  import { combinations } from "../../../../math/utils/combinatorics/combination.js";
5
5
  import { randfloat } from "../../../../math/utils/random/randfloat.js";
6
6
  import { randint } from "../../../../math/utils/random/randint.js";
7
+ import { round } from "../../../../math/utils/round.js";
7
8
  import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
9
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
8
10
  import { MultiplyNode } from "../../../../tree/nodes/operators/multiplyNode.js";
9
11
  import { PowerNode } from "../../../../tree/nodes/operators/powerNode.js";
10
12
  import { alignTex } from "../../../../utils/latex/alignTex.js";
11
- const getCalculateProbaOfBinomialDistributionQuestion = () => {
12
- const exercise = generateExercise();
13
- const p = new Rational(exercise.a, exercise.b);
14
- const correctAns = new NumberNode(getCorrectAnswer(exercise.n, p.value, exercise.k));
15
- const question = {
16
- answer: correctAns.toTex(),
17
- instruction: `Soit $X$ une variable aléatoire qui suit une loi binomiale de paramètres $n=${exercise.n}$ et $p=${p
18
- .toTree()
19
- .simplify()
20
- .toTex()}$. Donner une valeur arrondie au centième de $P(X=${exercise.k}).$`,
21
- keys: [],
22
- answerFormat: "tex",
23
- hint: `Si $X$ est une variable aléatoire qui suit une loi binomiale de paramètres $n$ et $p$, alors on a :
13
+ const getInstruction = (identifiers) => {
14
+ const { exerciseVars } = identifiers;
15
+ const { n, k, a, b } = exerciseVars;
16
+ const p = frac(a, b).simplify().toTex();
17
+ return `Soit $X$ une variable aléatoire qui suit une loi binomiale de paramètres $n=${n}$ et $p=${p}$.
18
+
19
+ Donner une valeur arrondie au centième de $P(X=${k}).$`;
20
+ };
21
+ const getAnswer = (identifiers) => {
22
+ const { exerciseVars } = identifiers;
23
+ const { n, k, a, b } = exerciseVars;
24
+ const p = a / b;
25
+ const kChooseN = combinations(k, n);
26
+ return round(kChooseN * Math.pow(p, k) * Math.pow(1 - p, n - k), 2).frenchify();
27
+ };
28
+ const getHint = (identifiers) => {
29
+ return `Si $X$ est une variable aléatoire qui suit une loi binomiale de paramètres $n$ et $p$, alors on a :
24
30
 
25
- $P(X=k) = \\binom{n}{k} p^k (1-p)^{n-k}$`,
26
- correction: `Si $X$ est une variable aléatoire qui suit une loi binomiale de paramètres $n$ et $p$, alors on a :
31
+ $$
32
+ P(X=k) = \\binom{n}{k} p^k (1-p)^{n-k}
33
+ $$`;
34
+ };
35
+ const getCorrection = (identifiers) => {
36
+ const { exerciseVars } = identifiers;
37
+ const { n, k, a, b } = exerciseVars;
38
+ const p = frac(a, b).simplify();
39
+ const answer = getAnswer(identifiers);
40
+ return `Si $X$ est une variable aléatoire qui suit une loi binomiale de paramètres $n$ et $p$, alors on a :
27
41
 
28
- $P(X=k) = \\binom{n}{k} p^k (1-p)^{n-k}$
42
+ $$
43
+ P(X=k) = \\binom{n}{k} p^k (1-p)^{n-k}
44
+ $$
29
45
 
30
46
  Ici, on a donc :
31
47
 
32
48
  ${alignTex([
33
- [
34
- `P(X=${exercise.k})`,
35
- "=",
36
- `\\binom{${exercise.n}}{${exercise.k}} ${new MultiplyNode(new PowerNode(p.toTree(), exercise.k.toTree()), new PowerNode(new Rational(exercise.b - exercise.a, exercise.b).toTree(), (exercise.n - exercise.k).toTree())).toTex()}`,
37
- ],
38
- ["", "\\approx", correctAns.toTex()],
39
- ])}`,
40
- identifiers: { exerciseVars: exercise },
49
+ [
50
+ `P(X=${k})`,
51
+ "=",
52
+ `\\binom{${n}}{${k}} ${new MultiplyNode(new PowerNode(p, k.toTree()), new PowerNode(new Rational(b - a, b).toTree(), (n - k).toTree())).toTex()}`,
53
+ ],
54
+ ["", "\\approx", answer],
55
+ ])}`;
56
+ };
57
+ const getCalculateProbaOfBinomialDistributionQuestion = () => {
58
+ let n;
59
+ let k;
60
+ let a;
61
+ let b;
62
+ let correctAns;
63
+ do {
64
+ n = randint(2, 9);
65
+ k = randint(1, n);
66
+ b = randint(2, 11);
67
+ a = randint(1, b);
68
+ correctAns = getCorrectAnswer(n, a / b, k);
69
+ } while (correctAns === 0);
70
+ const identifiers = { exerciseVars: { a, b, k, n } };
71
+ return getQuestionFromIdentifiers(identifiers);
72
+ };
73
+ const getQuestionFromIdentifiers = (identifiers) => {
74
+ const question = {
75
+ answer: getAnswer(identifiers),
76
+ instruction: getInstruction(identifiers),
77
+ keys: [],
78
+ answerFormat: "tex",
79
+ hint: getHint(identifiers),
80
+ correction: getCorrection(identifiers),
81
+ identifiers,
41
82
  };
42
83
  return question;
43
84
  };
@@ -72,27 +113,10 @@ const getCorrectAnswer = (n, p, k) => {
72
113
  const kChooseN = combinations(k, n);
73
114
  return +(kChooseN * Math.pow(p, k) * Math.pow(1 - p, n - k)).toFixed(2);
74
115
  };
75
- const generateExercise = () => {
76
- let n;
77
- let k;
78
- let a;
79
- let b;
80
- let correctAns;
81
- do {
82
- n = randint(2, 9);
83
- k = randint(1, n);
84
- b = randint(2, 11);
85
- a = randint(1, b);
86
- correctAns = getCorrectAnswer(n, a / b, k);
87
- } while (correctAns === 0);
88
- return { n, k, a, b };
89
- };
90
116
  export const calculateProbaOfBinomialDistribution = {
91
117
  id: "calculateProbaOfBinomialDistribution",
92
118
  label: "Calculer une probabilité avec la loi binomiale",
93
- levels: ["TermTech"],
94
119
  isSingleStep: true,
95
- sections: ["Probabilités"],
96
120
  generator: (nb) => getDistinctQuestions(getCalculateProbaOfBinomialDistributionQuestion, nb),
97
121
  qcmTimer: 60,
98
122
  freeTimer: 60,
@@ -100,4 +124,5 @@ export const calculateProbaOfBinomialDistribution = {
100
124
  isAnswerValid,
101
125
  subject: "Mathématiques",
102
126
  hasHintAndCorrection: true,
127
+ getQuestionFromIdentifiers,
103
128
  };
@@ -1 +1 @@
1
- {"version":3,"file":"cardBasicProbas.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/cardBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAAE,UAAU,EAAe,MAAM,oCAAoC,CAAC;AAI7E,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAsGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAgBjD,CAAC"}
1
+ {"version":3,"file":"cardBasicProbas.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/cardBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAWT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAAE,UAAU,EAAe,MAAM,oCAAoC,CAAC;AAI7E,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AA4GF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAejD,CAAC"}
@@ -58,6 +58,9 @@ const getCardBasicProbasQuestion = () => {
58
58
  break;
59
59
  }
60
60
  const identifiers = { questionType, value, color: color };
61
+ return getQuestionFromIdentifiers(identifiers);
62
+ };
63
+ const getQuestionFromIdentifiers = (identifiers) => {
61
64
  const question = {
62
65
  answer: getAnswer(identifiers),
63
66
  instruction: getInstruction(identifiers),
@@ -109,6 +112,5 @@ export const cardBasicProbas = {
109
112
  getPropositions,
110
113
  isAnswerValid,
111
114
  subject: "Mathématiques",
112
- getInstruction,
113
- getAnswer,
115
+ getQuestionFromIdentifiers,
114
116
  };
@@ -1 +1 @@
1
- {"version":3,"file":"conditionalProbability.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/conditionalProbability.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAQT,MAAM,mBAAmB,CAAC;AAM3B,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAyNF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAexD,CAAC"}
1
+ {"version":3,"file":"conditionalProbability.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/conditionalProbability.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAcT,MAAM,mBAAmB,CAAC;AAM3B,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AA8SF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}