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
@@ -5,25 +5,113 @@ import { round } from "../../../math/utils/round.js";
5
5
  import { shuffle } from "../../../utils/alea/shuffle.js";
6
6
  import { alignTex } from "../../../utils/latex/alignTex.js";
7
7
  import { numberVEA } from "../../../exercises/vea/numberVEA.js";
8
- const getConditionalProbability = () => {
9
- let pA, pB, pAB, pA_B, pB_A;
10
- let pAStr, pBStr, pABStr, pA_BStr, pB_AStr;
11
- const flip = randint(1, 7);
8
+ const getInstruction = (identifiers) => {
9
+ const { flip, pA, pAB, pA_B, pB, pB_A } = identifiers;
12
10
  let instruction = `On considère deux événements $A$ et $B$ tels que `;
13
- let startStatement = "";
14
- let answer = "";
15
- let correction = "";
16
11
  switch (flip) {
17
12
  case 1: {
18
- pA = randint(2, 100);
19
- pAB = randint(1, pA);
20
- pAStr = (pA / 100).frenchify();
21
- pABStr = (pAB / 100).frenchify();
22
- pB_AStr = round(pAB / pA, 2).frenchify();
23
- instruction += `$P(A) = ${pAStr}\\ $ et $\\ P(A \\cap B) = ${pABStr}$.$\\\\$Déterminer $P_A(B)$ (arrondir au centième).`;
24
- startStatement = `P_A(B)`;
25
- answer = pB_AStr;
26
- correction = `
13
+ const pAStr = (pA / 100).frenchify();
14
+ const pABStr = (pAB / 100).frenchify();
15
+ instruction += `$P(A) = ${pAStr}\\ $ et $\\ P(A \\cap B) = ${pABStr}$.
16
+
17
+ Déterminer $P_A(B)$ (arrondir au centième).`;
18
+ break;
19
+ }
20
+ case 2: {
21
+ const pBStr = (pB / 100).frenchify();
22
+ const pABStr = (pAB / 100).frenchify();
23
+ instruction += `$P(B) = ${pBStr}\\ $ et $\\ P(B \\cap A) = ${pABStr}$.
24
+
25
+ Déterminer $P_B(A)$ (arrondir au centième).`;
26
+ break;
27
+ }
28
+ case 3: {
29
+ const pAStr = (pA / 100).frenchify();
30
+ const pB_AStr = (pB_A / 100).frenchify();
31
+ instruction += `$P(A) = ${pAStr}\\ $ et $\\ P_A(B) = ${pB_AStr}$.
32
+
33
+ Déterminer $P(A \\cap B)$ (arrondir au centième).`;
34
+ break;
35
+ }
36
+ case 4: {
37
+ const pBStr = (pB / 100).frenchify();
38
+ const pA_BStr = (pA_B / 100).frenchify();
39
+ instruction += `$P(B) = ${pBStr}\\ $ et $\\ P_B(A) = ${pA_BStr}$.
40
+
41
+ Déterminer $P(A \\cap B)$ (arrondir au centième).`;
42
+ break;
43
+ }
44
+ case 5: {
45
+ const pABStr = (pAB / 100).frenchify();
46
+ const pA_BStr = (pA_B / 100).frenchify();
47
+ instruction += `$P(A \\cap B) = ${pABStr}\\ $ et $\\ P_B(A) = ${pA_BStr}$.
48
+
49
+ Déterminer $P(B)$ (arrondir au centième).`;
50
+ }
51
+ case 6: {
52
+ const pABStr = (pAB / 100).frenchify();
53
+ const pB_AStr = (pB_A / 100).frenchify();
54
+ instruction += `$P(A \\cap B) = ${pABStr}\\ $ et $\\ P_A(B) = ${pB_AStr}$.
55
+
56
+ Déterminer $P(A)$ (arrondir au centième).`;
57
+ break;
58
+ }
59
+ }
60
+ return instruction;
61
+ };
62
+ const getAnswer = (identifiers) => {
63
+ const { flip, pA, pAB, pA_B, pB, pB_A } = identifiers;
64
+ switch (flip) {
65
+ case 1:
66
+ return round(pAB / pA, 2).frenchify();
67
+ case 2:
68
+ return round(pAB / pB, 2).frenchify();
69
+ case 3:
70
+ return pAB.frenchify();
71
+ case 4:
72
+ return pAB.frenchify();
73
+ case 5:
74
+ return pB.frenchify();
75
+ case 6:
76
+ default:
77
+ return pA.frenchify();
78
+ }
79
+ };
80
+ const getHint = (identifiers) => {
81
+ const { flip, pA, pAB, pA_B, pB, pB_A } = identifiers;
82
+ return `Pour deux événements $M$ et $N$, on a:
83
+
84
+ $$
85
+ P_M(N) = \\frac{P(M \\cap N)}{P(M)}
86
+ $$
87
+ `;
88
+ };
89
+ const getStartStatement = (identifiers) => {
90
+ const { flip, pA, pAB, pA_B, pB, pB_A } = identifiers;
91
+ switch (flip) {
92
+ case 1:
93
+ return `P_A(B)`;
94
+ case 2:
95
+ return `P_B(A)`;
96
+ case 3:
97
+ return `P(A \\cap B)`;
98
+ case 4:
99
+ return `P(A \\cap B)`;
100
+ case 5:
101
+ return `P(B)`;
102
+ case 6:
103
+ default:
104
+ return `P(A)`;
105
+ }
106
+ };
107
+ const getCorrection = (identifiers) => {
108
+ const { flip, pA, pAB, pA_B, pB, pB_A } = identifiers;
109
+ const answer = getAnswer(identifiers);
110
+ switch (flip) {
111
+ case 1: {
112
+ const pAStr = (pA / 100).frenchify();
113
+ const pABStr = (pAB / 100).frenchify();
114
+ return `
27
115
  On sait que :
28
116
 
29
117
  $$
@@ -36,18 +124,11 @@ $$
36
124
  P_A(B) = \\frac{${pABStr}}{${pAStr}} \\approx ${answer}
37
125
  $$
38
126
  `;
39
- break;
40
127
  }
41
128
  case 2: {
42
- pB = randint(2, 100);
43
- pAB = randint(1, pB);
44
- pBStr = (pB / 100).frenchify();
45
- pABStr = (pAB / 100).frenchify();
46
- pA_BStr = round(pAB / pB, 2).frenchify();
47
- instruction += `$P(B) = ${pBStr}\\ $ et $\\ P(B \\cap A) = ${pABStr}$.$\\\\$Déterminer $P_B(A)$ (arrondir au centième).`;
48
- startStatement = `P_B(A)`;
49
- answer = pA_BStr;
50
- correction = `
129
+ const pBStr = (pB / 100).frenchify();
130
+ const pABStr = (pAB / 100).frenchify();
131
+ return `
51
132
  On sait que :
52
133
 
53
134
  $$
@@ -60,19 +141,11 @@ $$
60
141
  P_B(A) = \\frac{${pABStr}}{${pBStr}} \\approx ${answer}
61
142
  $$
62
143
  `;
63
- break;
64
144
  }
65
145
  case 3: {
66
- pA = randint(2, 100);
67
- pAStr = (pA / 100).frenchify();
68
- pB_A = randint(1, pA);
69
- pB_AStr = (pB_A / 100).frenchify();
70
- pAB = round((pB_A * pA) / 10000, 2);
71
- pABStr = pAB.frenchify();
72
- instruction += `$P(A) = ${pAStr}\\ $ et $\\ P_A(B) = ${pB_AStr}$.$\\\\$Déterminer $P(A \\cap B)$ (arrondir au centième).`;
73
- startStatement = `P(A \\cap B)`;
74
- answer = pABStr;
75
- correction = `
146
+ const pAStr = (pA / 100).frenchify();
147
+ const pB_AStr = (pB_A / 100).frenchify();
148
+ return `
76
149
  On sait que :
77
150
 
78
151
  $$
@@ -86,20 +159,12 @@ ${alignTex([
86
159
  ["", "=", `${pB_AStr}\\times ${pAStr}`],
87
160
  ["", "\\approx", answer],
88
161
  ])}
89
- `;
90
- break;
162
+ `;
91
163
  }
92
164
  case 4: {
93
- pB = randint(2, 100);
94
- pBStr = (pB / 100).frenchify();
95
- pA_B = randint(1, pB);
96
- pA_BStr = (pA_B / 100).frenchify();
97
- pAB = round((pA_B * pB) / 10000, 2);
98
- pABStr = pAB.frenchify();
99
- instruction += `$P(B) = ${pBStr}\\ $ et $\\ P_B(A) = ${pA_BStr}$.$\\\\$Déterminer $P(A \\cap B)$ (arrondir au centième).`;
100
- startStatement = `P(A \\cap B)`;
101
- answer = pABStr;
102
- correction = `
165
+ const pBStr = (pB / 100).frenchify();
166
+ const pA_BStr = (pA_B / 100).frenchify();
167
+ return `
103
168
  On sait que :
104
169
 
105
170
  $$
@@ -114,19 +179,11 @@ ${alignTex([
114
179
  ["", "\\approx", answer],
115
180
  ])}
116
181
  `;
117
- break;
118
182
  }
119
183
  case 5: {
120
- pA_B = randint(1, 100);
121
- pAB = randint(1, pA_B);
122
- pABStr = (pAB / 100).frenchify();
123
- pA_BStr = (pA_B / 100).frenchify();
124
- pB = round(pAB / pA_B, 2);
125
- pBStr = pB.frenchify();
126
- instruction += `$P(A \\cap B) = ${pABStr}\\ $ et $\\ P_B(A) = ${pA_BStr}$.$\\\\$Déterminer $P(B)$ (arrondir au centième).`;
127
- startStatement = `P(B)`;
128
- answer = pBStr;
129
- correction = `
184
+ const pABStr = (pAB / 100).frenchify();
185
+ const pA_BStr = (pA_B / 100).frenchify();
186
+ return `
130
187
  On sait que :
131
188
 
132
189
  $$
@@ -140,20 +197,13 @@ ${alignTex([
140
197
  ["", "=", `\\frac{${pABStr}}{${pA_BStr}}`],
141
198
  ["", "\\approx", answer],
142
199
  ])}
143
- `;
144
- break;
200
+ `;
145
201
  }
146
- case 6: {
147
- pB_A = randint(1, 100);
148
- pAB = randint(1, pB_A);
149
- pABStr = (pAB / 100).frenchify();
150
- pB_AStr = (pB_A / 100).frenchify();
151
- pA = round(pAB / pB_A, 2);
152
- pAStr = pA.frenchify();
153
- instruction += `$P(A \\cap B) = ${pABStr}\\ $ et $\\ P_A(B) = ${pB_AStr}$.$\\\\$Déterminer $P(A)$ (arrondir au centième).`;
154
- startStatement = `P(A)`;
155
- answer = pAStr;
156
- correction = `
202
+ case 6:
203
+ default: {
204
+ const pABStr = (pAB / 100).frenchify();
205
+ const pB_AStr = (pB_A / 100).frenchify();
206
+ return `
157
207
  On sait que :
158
208
 
159
209
  $$
@@ -167,24 +217,55 @@ ${alignTex([
167
217
  ["", "=", `\\frac{${pABStr}}{${pB_AStr}}`],
168
218
  ["", "\\approx", answer],
169
219
  ])}
170
- `;
171
- break;
220
+ `;
172
221
  }
173
222
  }
223
+ };
224
+ const getConditionalProbability = () => {
225
+ let pA, pB, pAB, pA_B, pB_A;
226
+ const flip = randint(1, 7);
227
+ switch (flip) {
228
+ case 1:
229
+ pA = randint(2, 100);
230
+ pAB = randint(1, pA);
231
+ break;
232
+ case 2:
233
+ pB = randint(2, 100);
234
+ pAB = randint(1, pB);
235
+ break;
236
+ case 3:
237
+ pA = randint(2, 100);
238
+ pB_A = randint(1, pA);
239
+ pAB = round((pB_A * pA) / 10000, 2);
240
+ break;
241
+ case 4:
242
+ pB = randint(2, 100);
243
+ pA_B = randint(1, pB);
244
+ pAB = round((pA_B * pB) / 10000, 2);
245
+ break;
246
+ case 5:
247
+ pA_B = randint(1, 100);
248
+ pAB = randint(1, pA_B);
249
+ pB = round(pAB / pA_B, 2);
250
+ case 6:
251
+ default:
252
+ pB_A = randint(1, 100);
253
+ pAB = randint(1, pB_A);
254
+ pA = round(pAB / pB_A, 2);
255
+ }
256
+ const identifiers = { flip, pA, pAB, pB, pA_B, pB_A };
257
+ return getQuestionFromIdentifiers(identifiers);
258
+ };
259
+ const getQuestionFromIdentifiers = (identifiers) => {
174
260
  const question = {
175
- instruction,
176
- startStatement,
177
- answer,
261
+ instruction: getInstruction(identifiers),
262
+ startStatement: getStartStatement(identifiers),
263
+ answer: getAnswer(identifiers),
178
264
  keys: ["p", "cap", "underscore"],
179
265
  answerFormat: "tex",
180
- identifiers: { flip, pA, pAB, pB, pA_B, pB_A },
181
- hint: `Pour deux événements $M$ et $N$, on a:
182
-
183
- $$
184
- P_M(N) = \\frac{P(M \\cap N)}{P(M)}
185
- $$
186
- `,
187
- correction,
266
+ identifiers,
267
+ hint: getHint(identifiers),
268
+ correction: getCorrection(identifiers),
188
269
  };
189
270
  return question;
190
271
  };
@@ -203,9 +284,7 @@ export const conditionalProbability = {
203
284
  id: "conditionalProbability",
204
285
  connector: "=",
205
286
  label: "Calcul de probabilité conditionnelle avec la formule de Bayes",
206
- levels: ["1reESM", "1reSpé", "1reTech", "TermTech", "1rePro", "TermPro"],
207
287
  isSingleStep: false,
208
- sections: ["Probabilités"],
209
288
  generator: (nb) => getDistinctQuestions(getConditionalProbability, nb),
210
289
  qcmTimer: 60,
211
290
  freeTimer: 60,
@@ -213,4 +292,5 @@ export const conditionalProbability = {
213
292
  isAnswerValid,
214
293
  subject: "Mathématiques",
215
294
  hasHintAndCorrection: true,
295
+ getQuestionFromIdentifiers,
216
296
  };
@@ -1 +1 @@
1
- {"version":3,"file":"diceBasicProbas.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/diceBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAwIF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAgBjD,CAAC"}
1
+ {"version":3,"file":"diceBasicProbas.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/diceBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA8IF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAgBjD,CAAC"}
@@ -77,6 +77,9 @@ const getDiceBasicProbasQuestion = () => {
77
77
  const isEvenQuestion = coinFlip();
78
78
  const faceAsked = randint(1, nbFaces + 1);
79
79
  const identifiers = { isParityQuestion, isEvenQuestion, nbFaces, faceAsked };
80
+ return getQuestionFromIdentifiers(identifiers);
81
+ };
82
+ const getQuestionFromIdentifiers = (identifiers) => {
80
83
  const question = {
81
84
  answer: getAnswer(identifiers),
82
85
  instruction: getInstruction(identifiers),
@@ -1 +1 @@
1
- {"version":3,"file":"independancy.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/independancy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAiDF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
1
+ {"version":3,"file":"independancy.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/independancy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA6DF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAa9C,CAAC"}
@@ -6,13 +6,20 @@ import { randint } from "../../../math/utils/random/randint.js";
6
6
  import { round } from "../../../math/utils/round.js";
7
7
  import { coinFlip } from "../../../utils/alea/coinFlip.js";
8
8
  import { shuffle } from "../../../utils/alea/shuffle.js";
9
+ const getInstruction = (identifiers) => {
10
+ const { pA, pB, pUnion } = identifiers;
11
+ return `Soient deux événements $A$ et $B$ tels que $P(A) = ${frenchify(pA)}$, $P(B) = ${frenchify(pB)}$ et $P(A\\cup B) = ${frenchify(pUnion)}$.
12
+
13
+ Les événements $A$ et $B$ sont-ils indépendants ?`;
14
+ };
15
+ const getAnswer = (identifiers) => {
16
+ const { pA, pB, pUnion } = identifiers;
17
+ return Math.abs(pA + pB - pA * pB - pUnion) < 0.0001 ? "Oui" : "Non";
18
+ };
9
19
  const getIndependancyQuestion = () => {
10
20
  const pA = DecimalConstructor.random(0, 1, randint(1, 3));
11
- const pATree = pA.toTree();
12
21
  const pB = DecimalConstructor.random(0, 1, randint(1, 3));
13
- const pBTree = pB.toTree();
14
22
  const areIndependants = coinFlip();
15
- const answer = areIndependants ? "Oui" : "Non";
16
23
  let pUnion;
17
24
  const unionValueIfIndependants = round(pA.value + pB.value - pA.value * pB.value, 5);
18
25
  if (areIndependants)
@@ -24,12 +31,16 @@ const getIndependancyQuestion = () => {
24
31
  pUnion === unionValueIfIndependants ||
25
32
  pUnion > pA.value + pB.value);
26
33
  }
34
+ const identifiers = { pA: pA.value, pB: pB.value, pUnion };
35
+ return getQuestionFromIdentifiers(identifiers);
36
+ };
37
+ const getQuestionFromIdentifiers = (identifiers) => {
27
38
  const question = {
28
- answer,
29
- instruction: `Soient deux événements $A$ et $B$ tels que $P(A) = ${frenchify(pA.value)}$, $P(B) = ${frenchify(pB.value)}$ et $P(A\\cup B) = ${frenchify(pUnion)}$. Les événements $A$ et $B$ sont-ils indépendants ?`,
39
+ answer: getAnswer(identifiers),
40
+ instruction: getInstruction(identifiers),
30
41
  keys: [],
31
42
  answerFormat: "raw",
32
- identifiers: { pA: pA.value, pB: pB.value, pUnion },
43
+ identifiers,
33
44
  };
34
45
  return question;
35
46
  };
@@ -45,13 +56,12 @@ export const independancy = {
45
56
  id: "independancy",
46
57
  connector: "=",
47
58
  label: "Déterminer l'indépendance de deux événements via la formule de Poincaré",
48
- levels: ["1reSpé", "TermTech"],
49
59
  isSingleStep: true,
50
- sections: ["Probabilités"],
51
60
  generator: (nb) => getDistinctQuestions(getIndependancyQuestion, nb),
52
61
  qcmTimer: 60,
53
62
  freeTimer: 60,
54
63
  getPropositions,
55
64
  answerType: "QCU",
56
65
  subject: "Mathématiques",
66
+ getQuestionFromIdentifiers,
57
67
  };
@@ -1 +1 @@
1
- {"version":3,"file":"issuesCountingForCards.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/issuesCountingForCards.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAiEF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
1
+ {"version":3,"file":"issuesCountingForCards.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/issuesCountingForCards.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AA+FF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAaxD,CAAC"}
@@ -5,6 +5,39 @@ import { probaLawFlip } from "../../../utils/alea/probaLawFlip.js";
5
5
  import { random } from "../../../utils/alea/random.js";
6
6
  import { randomEnumValue } from "../../../utils/alea/randomEnumValue.js";
7
7
  import { CardsColor, CardsValues } from "../../utils/cardsData.js";
8
+ const getInstruction = (identifiers) => {
9
+ const { questionType, value, color } = identifiers;
10
+ let target = "";
11
+ switch (questionType) {
12
+ case "oneCard":
13
+ target = `${value === "dame" ? "une" : "un"} ${value} de ${color}`;
14
+ break;
15
+ case "valueCard":
16
+ target = `${value === "dame" ? "une" : "un"} ${value}`;
17
+ break;
18
+ case "colorCard":
19
+ target = `une carte ${color}`;
20
+ break;
21
+ case "suitCard":
22
+ target = `un ${color}`;
23
+ break;
24
+ }
25
+ return `On tire une carte dans un jeu de $52$ cartes. Combien l'événement $A = $ "obtenir ${target}" compte-t-il d'issues ?`;
26
+ };
27
+ const getAnswer = (identifiers) => {
28
+ const { questionType, value, color } = identifiers;
29
+ switch (questionType) {
30
+ case "oneCard":
31
+ return `1`;
32
+ case "valueCard":
33
+ return "4";
34
+ case "colorCard":
35
+ return `26`;
36
+ case "suitCard":
37
+ default:
38
+ return `13`;
39
+ }
40
+ };
8
41
  const getIssuesCountingForCardsQuestion = () => {
9
42
  const questionType = probaLawFlip([
10
43
  ["oneCard", 0.25],
@@ -12,39 +45,33 @@ const getIssuesCountingForCardsQuestion = () => {
12
45
  ["suitCard", 0.25],
13
46
  ["colorCard", 0.25],
14
47
  ]);
15
- let answer = "";
16
- let target = "";
17
48
  let value;
18
49
  let color;
19
50
  switch (questionType) {
20
51
  case "oneCard":
21
52
  value = randomEnumValue(CardsValues);
22
53
  color = randomEnumValue(CardsColor);
23
- target = `${value === "dame" ? "une" : "un"} ${value} de ${color}`;
24
- answer = `1`;
25
54
  break;
26
55
  case "valueCard":
27
56
  value = randomEnumValue(CardsValues);
28
- target = `${value === "dame" ? "une" : "un"} ${value}`;
29
- answer = "4";
30
57
  break;
31
58
  case "colorCard":
32
59
  color = random(["rouge", "noire"]);
33
- target = `une carte ${color}`;
34
- answer = `26`;
35
60
  break;
36
61
  case "suitCard":
37
62
  color = randomEnumValue(CardsColor);
38
- target = `un ${color}`;
39
- answer = `13`;
40
63
  break;
41
64
  }
65
+ const identifiers = { questionType, value, color };
66
+ return getQuestionFromIdentifiers(identifiers);
67
+ };
68
+ const getQuestionFromIdentifiers = (identifiers) => {
42
69
  const question = {
43
- answer,
44
- instruction: `On tire une carte dans un jeu de $52$ cartes. Combien l'événement $A = $ "obtenir ${target}" compte-t-il d'issues ?`,
70
+ answer: getAnswer(identifiers),
71
+ instruction: getInstruction(identifiers),
45
72
  keys: [],
46
73
  answerFormat: "tex",
47
- identifiers: { questionType, value, color },
74
+ identifiers,
48
75
  };
49
76
  return question;
50
77
  };
@@ -64,13 +91,12 @@ export const issuesCountingForCards = {
64
91
  id: "issuesCountingForCards",
65
92
  connector: "=",
66
93
  label: "Compter le nombre d'issues d'un événement avec un jeu de cartes",
67
- levels: ["3ème", "2nde", "2ndPro", "1rePro"],
68
94
  isSingleStep: true,
69
- sections: ["Probabilités"],
70
95
  generator: (nb) => getDistinctQuestions(getIssuesCountingForCardsQuestion, nb),
71
96
  qcmTimer: 60,
72
97
  freeTimer: 60,
73
98
  getPropositions,
74
99
  isAnswerValid,
75
100
  subject: "Mathématiques",
101
+ getQuestionFromIdentifiers,
76
102
  };
@@ -1 +1 @@
1
- {"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AA4IF,KAAK,OAAO,GAAG,EAEd,CAAC;AAgBF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBlE,CAAC"}
1
+ {"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAkJF,KAAK,OAAO,GAAG,EAEd,CAAC;AAgBF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAclE,CAAC"}
@@ -99,6 +99,9 @@ const getProbaFromTableNoContextQuestion = () => {
99
99
  type,
100
100
  probaFrac: proba,
101
101
  };
102
+ return getQuestionFromIdentifiers(identifiers);
103
+ };
104
+ const getQuestionFromIdentifiers = (identifiers) => {
102
105
  const question = {
103
106
  answer: getAnswer(identifiers),
104
107
  instruction: getInstruction(identifiers),
@@ -136,15 +139,12 @@ export const probaFromTableNoContext = {
136
139
  id: "probaFromTableNoContext",
137
140
  connector: "=",
138
141
  label: "Utiliser un tableau à double entrée pour calculer une probabilité (sans contexte)",
139
- levels: ["1rePro", "1reSpé", "1reTech", "1reESM", "2ndPro"],
140
142
  isSingleStep: true,
141
- sections: ["Probabilités"],
142
143
  generator: (nb) => getDistinctQuestions(getProbaFromTableNoContextQuestion, nb),
143
144
  qcmTimer: 60,
144
145
  freeTimer: 60,
145
146
  getPropositions,
146
147
  isAnswerValid,
147
148
  subject: "Mathématiques",
148
- getInstruction,
149
- // options,
149
+ getQuestionFromIdentifiers,
150
150
  };
@@ -1 +1 @@
1
- {"version":3,"file":"probaFromTableWithContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableWithContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAoJF,KAAK,OAAO,GAAG,EAEd,CAAC;AAgBF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBpE,CAAC"}
1
+ {"version":3,"file":"probaFromTableWithContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableWithContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AA0JF,KAAK,OAAO,GAAG,EAEd,CAAC;AAgBF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBpE,CAAC"}
@@ -108,6 +108,9 @@ const getProbaFromTableWithContextQuestion = () => {
108
108
  type,
109
109
  probaFrac: proba,
110
110
  };
111
+ return getQuestionFromIdentifiers(identifiers);
112
+ };
113
+ const getQuestionFromIdentifiers = (identifiers) => {
111
114
  const question = {
112
115
  answer: getAnswer(identifiers),
113
116
  instruction: getInstruction(identifiers),
@@ -135,7 +138,7 @@ const isAnswerValid = (ans, { answer, probaFrac }, options) => {
135
138
  const parsed = rationalParser(ans);
136
139
  if (!parsed)
137
140
  return false;
138
- return parsed.simplify().toTex() === answer;
141
+ return parsed.simplify({ decimalToFractions: true }).toTex() === answer;
139
142
  }
140
143
  catch (err) {
141
144
  return handleVEAError(err);
@@ -152,6 +155,6 @@ export const probaFromTableWithContext = {
152
155
  getPropositions,
153
156
  isAnswerValid,
154
157
  subject: "Mathématiques",
155
- getInstruction,
158
+ getQuestionFromIdentifiers,
156
159
  options,
157
160
  };
@@ -1 +1 @@
1
- {"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probabilityTree.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAa7C,OAAO,EACL,QAAQ,EAeT,MAAM,mBAAmB,CAAC;AAmC3B,KAAK,WAAW,GAAG;IAIjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;IACnB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4MF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA+CF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiB1D,CAAC"}
1
+ {"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probabilityTree.ts"],"names":[],"mappings":"AAWA,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAa7C,OAAO,EACL,QAAQ,EAiBT,MAAM,mBAAmB,CAAC;AAmC3B,KAAK,WAAW,GAAG;IAIjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;IACnB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAqNF,KAAK,OAAO,GAAG;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA+CF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe1D,CAAC"}
@@ -122,6 +122,9 @@ const getProbaAndOpposite = (decimal = false) => {
122
122
  return [proba.toTree(), round(1 - proba, 2).toTree()];
123
123
  }
124
124
  };
125
+ const getStartStatement = (identifiers) => {
126
+ return identifiers.probaName;
127
+ };
125
128
  const getProbabilityTree = (opts) => {
126
129
  const isDecimal = opts?.probaType === "Décimales";
127
130
  const [pA, pB] = getProbaAndOpposite(isDecimal);
@@ -161,9 +164,12 @@ const getProbabilityTree = (opts) => {
161
164
  BD: pD_B.toIdentifiers(),
162
165
  probaName,
163
166
  };
167
+ return getQuestionFromIdentifiers(identifiers, opts);
168
+ };
169
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
164
170
  const question = {
165
171
  instruction: getInstruction(identifiers, opts),
166
- startStatement: probaName,
172
+ startStatement: getStartStatement(identifiers, opts),
167
173
  answer: getAnswer(identifiers),
168
174
  keys: [],
169
175
  ggbOptions: getGGBOptions(identifiers, opts),
@@ -273,7 +279,5 @@ export const probabilityTree = {
273
279
  hasGeogebra: true,
274
280
  subject: "Mathématiques",
275
281
  options,
276
- rebuildIdentifiers,
277
- getInstruction,
278
- getAnswer,
282
+ getQuestionFromIdentifiers,
279
283
  };
@@ -1 +1 @@
1
- {"version":3,"file":"medianList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/medianList.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAYT,MAAM,sBAAsB,CAAC;AAE9B,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAuEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAehD,CAAC"}
1
+ {"version":3,"file":"medianList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/medianList.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAYT,MAAM,sBAAsB,CAAC;AAE9B,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAuEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAYhD,CAAC"}
@@ -59,15 +59,12 @@ export const medianWithList = {
59
59
  id: "medianWithList",
60
60
  connector: "=",
61
61
  label: "Calcul de la médiane d'une liste de valeurs",
62
- levels: ["3ème", "2nde", "CAP", "2ndPro", "1rePro", "1reTech"],
63
62
  isSingleStep: false,
64
- sections: ["Statistiques"],
65
63
  generator: (nb) => getDistinctQuestions(getMedianList, nb),
66
64
  qcmTimer: 60,
67
65
  freeTimer: 60,
68
66
  getPropositions,
69
67
  isAnswerValid,
70
68
  subject: "Mathématiques",
71
- getAnswer,
72
- getInstruction,
69
+ getQuestionFromIdentifiers,
73
70
  };
@@ -38,7 +38,7 @@ $$
38
38
  V = \\frac{(x_1-\\overline{x})^2 + (x_2-\\overline{x})^2 + \\ldots + (x_N-\\overline{x})^2}{N}
39
39
  $$
40
40
 
41
- Puis, l'écart-type est la racine carrée de la variance.`;
41
+ Puis l'écart-type est la racine carrée de la variance.`;
42
42
  };
43
43
  const getCorrection = (identifiers) => {
44
44
  const n = identifiers.sortedValues.length;