math-exercises 3.0.125 → 3.0.127

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 (291) hide show
  1. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.d.ts.map +1 -1
  2. package/lib/exercises/math/calcul/fractions/fractionsSumsPrimeDenominators.js +61 -1
  3. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +1 -0
  4. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
  5. package/lib/exercises/math/calcul/mentalCaluls/index.js +1 -0
  6. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts +15 -0
  7. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.d.ts.map +1 -0
  8. package/lib/exercises/math/calcul/mentalCaluls/mentalProgramSolve.js +231 -0
  9. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts +16 -0
  10. package/lib/exercises/math/calcul/ordering/compareA10N.d.ts.map +1 -0
  11. package/lib/exercises/math/calcul/ordering/compareA10N.js +327 -0
  12. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts +8 -0
  13. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.d.ts.map +1 -0
  14. package/lib/exercises/math/calcul/ordering/compareABUsingQuotient.js +123 -0
  15. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts +9 -0
  16. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.d.ts.map +1 -0
  17. package/lib/exercises/math/calcul/ordering/compareFracABWithFracAPlusCBPlusC.js +149 -0
  18. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts +29 -0
  19. package/lib/exercises/math/calcul/ordering/compareFracAndDec.d.ts.map +1 -0
  20. package/lib/exercises/math/calcul/ordering/compareFracAndDec.js +368 -0
  21. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts +12 -0
  22. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.d.ts.map +1 -0
  23. package/lib/exercises/math/calcul/ordering/comparePowersOfFracs.js +164 -0
  24. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts +9 -0
  25. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.d.ts.map +1 -0
  26. package/lib/exercises/math/calcul/ordering/compareWithSquareRoots.js +140 -0
  27. package/lib/exercises/math/calcul/ordering/index.d.ts +6 -0
  28. package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -1
  29. package/lib/exercises/math/calcul/ordering/index.js +6 -0
  30. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts +9 -0
  31. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.d.ts.map +1 -0
  32. package/lib/exercises/math/calcul/rounding/estimateAroundPow10NTimesAroundPow10N.js +84 -0
  33. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts +8 -0
  34. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.d.ts.map +1 -0
  35. package/lib/exercises/math/calcul/rounding/estimatePow10NPlusPow10MinusN.js +90 -0
  36. package/lib/exercises/math/calcul/rounding/index.d.ts +2 -0
  37. package/lib/exercises/math/calcul/rounding/index.d.ts.map +1 -1
  38. package/lib/exercises/math/calcul/rounding/index.js +2 -0
  39. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts +13 -0
  40. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.d.ts.map +1 -0
  41. package/lib/exercises/math/calculLitteral/equation/equationFromProblem.js +454 -0
  42. package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
  43. package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
  44. package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
  45. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts +10 -0
  46. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.d.ts.map +1 -0
  47. package/lib/exercises/math/calculLitteral/factorisation/factorizeAX2PlusBX.js +70 -0
  48. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
  49. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  50. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
  51. package/lib/exercises/math/calculLitteral/index.d.ts +2 -0
  52. package/lib/exercises/math/calculLitteral/index.d.ts.map +1 -1
  53. package/lib/exercises/math/calculLitteral/index.js +2 -0
  54. package/lib/exercises/math/calculLitteral/isolate/index.d.ts +2 -1
  55. package/lib/exercises/math/calculLitteral/isolate/index.d.ts.map +1 -1
  56. package/lib/exercises/math/calculLitteral/isolate/index.js +2 -1
  57. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts +8 -0
  58. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
  59. package/lib/exercises/math/calculLitteral/isolate/isolateUInInvXPlusInvYEqualsInvU.js +86 -0
  60. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts +7 -0
  61. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.d.ts.map +1 -0
  62. package/lib/exercises/math/calculLitteral/isolate/isolateXInInvXPlusInvYEqualsInvU.js +80 -0
  63. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts +10 -0
  64. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.d.ts.map +1 -0
  65. package/lib/exercises/math/calculLitteral/ordering/compareAMinusB.js +180 -0
  66. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts +9 -0
  67. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.d.ts.map +1 -0
  68. package/lib/exercises/math/calculLitteral/ordering/compareFromPiMinusFrac.js +144 -0
  69. package/lib/exercises/math/calculLitteral/ordering/index.d.ts +3 -0
  70. package/lib/exercises/math/calculLitteral/ordering/index.d.ts.map +1 -0
  71. package/lib/exercises/math/calculLitteral/ordering/index.js +2 -0
  72. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts +11 -0
  73. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.d.ts.map +1 -0
  74. package/lib/exercises/math/calculLitteral/simplifying/compareATimes0.js +120 -0
  75. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts +8 -0
  76. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.d.ts.map +1 -0
  77. package/lib/exercises/math/calculLitteral/simplifying/compareFracXA.js +67 -0
  78. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts +11 -0
  79. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.d.ts.map +1 -0
  80. package/lib/exercises/math/calculLitteral/simplifying/compareMinusA.js +114 -0
  81. package/lib/exercises/math/calculLitteral/simplifying/index.d.ts +5 -0
  82. package/lib/exercises/math/calculLitteral/simplifying/index.d.ts.map +1 -1
  83. package/lib/exercises/math/calculLitteral/simplifying/index.js +5 -0
  84. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts +13 -0
  85. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.d.ts.map +1 -0
  86. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsAPercentOfB.js +125 -0
  87. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts +14 -0
  88. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.d.ts.map +1 -0
  89. package/lib/exercises/math/calculLitteral/simplifying/pickSameAsInverseOfFracAB.js +148 -0
  90. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts +5 -27
  91. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.d.ts.map +1 -1
  92. package/lib/exercises/math/calculLitteral/writing/writeLitExpFromFrenchExp.js +231 -248
  93. package/lib/exercises/math/conversion/index.d.ts +4 -0
  94. package/lib/exercises/math/conversion/index.d.ts.map +1 -1
  95. package/lib/exercises/math/conversion/index.js +4 -0
  96. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts +11 -0
  97. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.d.ts.map +1 -0
  98. package/lib/exercises/math/conversion/kmPerMinToKmPerHourConversion.js +116 -0
  99. package/lib/exercises/math/conversion/minutesToHours.d.ts +10 -0
  100. package/lib/exercises/math/conversion/minutesToHours.d.ts.map +1 -0
  101. package/lib/exercises/math/conversion/minutesToHours.js +150 -0
  102. package/lib/exercises/math/conversion/prefixToNumber.d.ts +15 -0
  103. package/lib/exercises/math/conversion/prefixToNumber.d.ts.map +1 -0
  104. package/lib/exercises/math/conversion/prefixToNumber.js +243 -0
  105. package/lib/exercises/math/conversion/secondsToHours.d.ts +10 -0
  106. package/lib/exercises/math/conversion/secondsToHours.d.ts.map +1 -0
  107. package/lib/exercises/math/conversion/secondsToHours.js +150 -0
  108. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts +53 -0
  109. package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -0
  110. package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +533 -0
  111. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts +7 -0
  112. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.d.ts.map +1 -0
  113. package/lib/exercises/math/dataRepresentations/boxPlotInterpreting.js +223 -0
  114. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts +10 -0
  115. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.d.ts.map +1 -0
  116. package/lib/exercises/math/dataRepresentations/cartesianGraphExtremaReading.js +140 -0
  117. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts +8 -0
  118. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.d.ts.map +1 -0
  119. package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +133 -0
  120. package/lib/exercises/math/dataRepresentations/graphReading.d.ts +8 -0
  121. package/lib/exercises/math/dataRepresentations/graphReading.d.ts.map +1 -0
  122. package/lib/exercises/math/dataRepresentations/graphReading.js +136 -0
  123. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts +18 -0
  124. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts.map +1 -0
  125. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.js +228 -0
  126. package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts +8 -0
  127. package/lib/exercises/math/dataRepresentations/halfPieChartReading.d.ts.map +1 -0
  128. package/lib/exercises/math/dataRepresentations/halfPieChartReading.js +213 -0
  129. package/lib/exercises/math/dataRepresentations/histogramReading.d.ts +9 -0
  130. package/lib/exercises/math/dataRepresentations/histogramReading.d.ts.map +1 -0
  131. package/lib/exercises/math/dataRepresentations/histogramReading.js +163 -0
  132. package/lib/exercises/math/dataRepresentations/index.d.ts +10 -0
  133. package/lib/exercises/math/dataRepresentations/index.d.ts.map +1 -1
  134. package/lib/exercises/math/dataRepresentations/index.js +10 -0
  135. package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts +9 -0
  136. package/lib/exercises/math/dataRepresentations/plausibleGraph.d.ts.map +1 -0
  137. package/lib/exercises/math/dataRepresentations/plausibleGraph.js +194 -0
  138. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts +9 -0
  139. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.d.ts.map +1 -0
  140. package/lib/exercises/math/dataRepresentations/scatterPlotCommenting.js +308 -0
  141. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
  142. package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +5 -6
  143. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts +8 -0
  144. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -0
  145. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +117 -0
  146. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts +8 -0
  147. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.d.ts.map +1 -0
  148. package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindY.js +118 -0
  149. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts +16 -0
  150. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -0
  151. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +215 -0
  152. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts +13 -0
  153. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.d.ts.map +1 -0
  154. package/lib/exercises/math/functions/affines/drawAffineFromProgCalc.js +223 -0
  155. package/lib/exercises/math/functions/affines/index.d.ts +7 -0
  156. package/lib/exercises/math/functions/affines/index.d.ts.map +1 -1
  157. package/lib/exercises/math/functions/affines/index.js +7 -0
  158. package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts +20 -0
  159. package/lib/exercises/math/functions/affines/recognizeExprAffine.d.ts.map +1 -0
  160. package/lib/exercises/math/functions/affines/recognizeExprAffine.js +284 -0
  161. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts +16 -0
  162. package/lib/exercises/math/functions/affines/representationOfAffine.d.ts.map +1 -0
  163. package/lib/exercises/math/functions/affines/representationOfAffine.js +275 -0
  164. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts +14 -0
  165. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.d.ts.map +1 -0
  166. package/lib/exercises/math/functions/basics/coordsOfPointOnCurveFindY.js +235 -0
  167. package/lib/exercises/math/functions/basics/index.d.ts +1 -0
  168. package/lib/exercises/math/functions/basics/index.d.ts.map +1 -1
  169. package/lib/exercises/math/functions/basics/index.js +1 -0
  170. package/lib/exercises/math/functions/composition/functionComposition.d.ts +8 -0
  171. package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -0
  172. package/lib/exercises/math/functions/composition/functionComposition.js +238 -0
  173. package/lib/exercises/math/functions/composition/index.d.ts +2 -0
  174. package/lib/exercises/math/functions/composition/index.d.ts.map +1 -0
  175. package/lib/exercises/math/functions/composition/index.js +1 -0
  176. package/lib/exercises/math/functions/index.d.ts +1 -0
  177. package/lib/exercises/math/functions/index.d.ts.map +1 -1
  178. package/lib/exercises/math/functions/index.js +1 -0
  179. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts +23 -0
  180. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.d.ts.map +1 -0
  181. package/lib/exercises/math/geometry/angles/anglesUsingIsParallel.js +448 -0
  182. package/lib/exercises/math/geometry/angles/index.js +2 -0
  183. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts +23 -0
  184. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.d.ts.map +1 -0
  185. package/lib/exercises/math/geometry/angles/isParallelUsingAngles.js +402 -0
  186. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts +9 -6
  187. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.d.ts.map +1 -1
  188. package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLine.js +140 -60
  189. package/lib/exercises/math/geometry/convexity/convexityQuadrinomialsGeo.js +1 -1
  190. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.d.ts.map +1 -1
  191. package/lib/exercises/math/geometry/vectors/colinearity/colinearityFromPicture.js +121 -104
  192. package/lib/exercises/math/geometry/vectors/vectorRepresentative.d.ts.map +1 -1
  193. package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +3 -2
  194. package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
  195. package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
  196. package/lib/exercises/math/probaStat/basicProbas/index.js +1 -0
  197. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts +0 -1
  198. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.d.ts.map +1 -1
  199. package/lib/exercises/math/probaStat/basicProbas/possibleValuesForProba.js +65 -88
  200. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts +9 -0
  201. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.d.ts.map +1 -0
  202. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +221 -0
  203. package/lib/exercises/math/probaStat/index.d.ts +2 -0
  204. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  205. package/lib/exercises/math/probaStat/index.js +2 -0
  206. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts +29 -0
  207. package/lib/exercises/math/probaStat/probaAsSumOfProbas.d.ts.map +1 -0
  208. package/lib/exercises/math/probaStat/probaAsSumOfProbas.js +547 -0
  209. package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
  210. package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
  211. package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
  212. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts +9 -0
  213. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.d.ts.map +1 -0
  214. package/lib/exercises/math/probaStat/stats1var/interpretIndicatorsForLists.js +89 -0
  215. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts +10 -0
  216. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.d.ts.map +1 -0
  217. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +152 -0
  218. package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts +7 -0
  219. package/lib/exercises/pc/electricity/calculateUEqualsRI.d.ts.map +1 -0
  220. package/lib/exercises/pc/electricity/calculateUEqualsRI.js +73 -0
  221. package/lib/exercises/pc/electricity/index.d.ts +1 -0
  222. package/lib/exercises/pc/electricity/index.d.ts.map +1 -1
  223. package/lib/exercises/pc/electricity/index.js +1 -0
  224. package/lib/exercises/pc/index.d.ts +1 -0
  225. package/lib/exercises/pc/index.d.ts.map +1 -1
  226. package/lib/exercises/pc/index.js +1 -0
  227. package/lib/exercises/pc/moleculeFormula.d.ts.map +1 -1
  228. package/lib/exercises/pc/moleculeFormula.js +4 -3
  229. package/lib/exercises/pc/optics/index.d.ts +2 -0
  230. package/lib/exercises/pc/optics/index.d.ts.map +1 -0
  231. package/lib/exercises/pc/optics/index.js +1 -0
  232. package/lib/exercises/pc/optics/lensFormula.d.ts +21 -0
  233. package/lib/exercises/pc/optics/lensFormula.d.ts.map +1 -0
  234. package/lib/exercises/pc/optics/lensFormula.js +415 -0
  235. package/lib/exercises/pc/weight/calculateWeight.d.ts +8 -1
  236. package/lib/exercises/pc/weight/calculateWeight.d.ts.map +1 -1
  237. package/lib/exercises/pc/weight/calculateWeight.js +113 -38
  238. package/lib/geogebra/parsers/geogebraParser.d.ts +4 -0
  239. package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
  240. package/lib/geogebra/parsers/geogebraParser.js +17 -0
  241. package/lib/index.d.ts +351 -12
  242. package/lib/index.d.ts.map +1 -1
  243. package/lib/latexTester.d.ts.map +1 -1
  244. package/lib/latexTester.js +1 -0
  245. package/lib/math/geometry/CloudPoints.d.ts +10 -0
  246. package/lib/math/geometry/CloudPoints.d.ts.map +1 -1
  247. package/lib/math/geometry/CloudPoints.js +119 -0
  248. package/lib/math/geometry/line.d.ts +1 -0
  249. package/lib/math/geometry/line.d.ts.map +1 -1
  250. package/lib/math/geometry/line.js +10 -2
  251. package/lib/math/geometry/vector.d.ts +1 -0
  252. package/lib/math/geometry/vector.d.ts.map +1 -1
  253. package/lib/math/geometry/vector.js +12 -0
  254. package/lib/math/progCalc/progCalc.d.ts +46 -0
  255. package/lib/math/progCalc/progCalc.d.ts.map +1 -0
  256. package/lib/math/progCalc/progCalc.js +239 -0
  257. package/lib/math/utils/latex/realize.d.ts +12 -0
  258. package/lib/math/utils/latex/realize.d.ts.map +1 -0
  259. package/lib/math/utils/latex/realize.js +43 -0
  260. package/lib/pc/constants/molecularChemistry/molecule.d.ts +2 -0
  261. package/lib/pc/constants/molecularChemistry/molecule.d.ts.map +1 -1
  262. package/lib/pc/constants/molecularChemistry/molecule.js +52 -0
  263. package/lib/tests/questionTest.d.ts.map +1 -1
  264. package/lib/tests/questionTest.js +1 -1
  265. package/lib/tests/singleExo.test.js +3 -3
  266. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  267. package/lib/tree/nodes/operators/addNode.d.ts +4 -2
  268. package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
  269. package/lib/tree/nodes/operators/addNode.js +8 -17
  270. package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
  271. package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
  272. package/lib/tree/nodes/operators/fractionNode.js +5 -1
  273. package/lib/tree/nodes/operators/multiplyNode.d.ts +4 -2
  274. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  275. package/lib/tree/nodes/operators/multiplyNode.js +8 -17
  276. package/lib/tree/nodes/operators/operatorNode.d.ts +3 -3
  277. package/lib/tree/nodes/operators/operatorNode.d.ts.map +1 -1
  278. package/lib/tree/nodes/variables/variableNode.d.ts +1 -1
  279. package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
  280. package/lib/tree/utilities/nodeShuffler.d.ts +12 -0
  281. package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -0
  282. package/lib/tree/utilities/nodeShuffler.js +123 -0
  283. package/lib/utils/arrays/getAllPicks.d.ts +2 -0
  284. package/lib/utils/arrays/getAllPicks.d.ts.map +1 -0
  285. package/lib/utils/arrays/getAllPicks.js +17 -0
  286. package/lib/utils/errors/handleVEAError.d.ts +1 -1
  287. package/lib/utils/errors/handleVEAError.d.ts.map +1 -1
  288. package/lib/utils/strings/decapitalize.d.ts +2 -0
  289. package/lib/utils/strings/decapitalize.d.ts.map +1 -0
  290. package/lib/utils/strings/decapitalize.js +3 -0
  291. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
1
+ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { randfloat } from "../../../../math/utils/random/randfloat.js";
4
4
  import { randint } from "../../../../math/utils/random/randint.js";
@@ -13,93 +13,70 @@ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
13
13
  import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
14
14
  import { power } from "../../../../tree/nodes/operators/powerNode.js";
15
15
  import { substract } from "../../../../tree/nodes/operators/substractNode.js";
16
- import { parseLatex } from "../../../../tree/parsers/latexParser.js";
17
16
  import { coinFlip } from "../../../../utils/alea/coinFlip.js";
18
17
  import { probaFlip } from "../../../../utils/alea/probaFlip.js";
19
18
  import { random } from "../../../../utils/alea/random.js";
20
19
  import { shuffle } from "../../../../utils/alea/shuffle.js";
21
- const getAnswer = (identifiers) => {
22
- const { arrayOfNodeIds, isFilterPossibleProba } = identifiers;
23
- const arrayOfPossibleProbas = arrayOfNodeIds
24
- .map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds))
25
- .filter((node) => {
26
- return isFilterPossibleProba
27
- ? node.evaluate() >= 0 && substract(node, 1).evaluate() <= 0
28
- : node.evaluate() < 0 || substract(node, 1).evaluate() > 0;
29
- })
30
- .toSorted((nodeA, nodeB) => substract(nodeA, nodeB).evaluate());
31
- const answer = arrayOfPossibleProbas.map((node) => node.toTex()).join(";");
32
- return answer;
33
- };
34
20
  const getInstruction = (identifiers) => {
35
- const { arrayOfNodeIds, isFilterPossibleProba } = identifiers;
36
- const arrNode = arrayOfNodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
37
- return `Parmi les valeurs de la liste ci-dessous, donner celles qui sont des valeurs ${isFilterPossibleProba ? "possibles" : "impossibles"} pour une probabilité
38
- (séparer les valeurs par des points-virgules) :
39
- $$
40
- ${arrNode.map((node) => node.toTex()).join(" \\hspace{2mm} ; \\hspace{2mm} ")}
41
- $$
42
- `;
21
+ const { isFilterPossibleProba } = identifiers;
22
+ return `Parmi les valeurs de la liste ci-dessous, donner celles qui sont des valeurs ${isFilterPossibleProba ? "**possibles**" : "**impossibles**"} pour une probabilité.`;
43
23
  };
44
24
  const getHint = () => {
45
- return "Une probabilité est toujours comprise entre $0\\%$ et $100\\%$.";
25
+ return "Une probabilité est un nombre compris entre $0$ et $1$.";
46
26
  };
47
27
  const getCorrection = (identifiers) => {
28
+ const { arrayOfNodeIds, isFilterPossibleProba } = identifiers;
29
+ const allAnswerTexs = arrayOfNodeIds
30
+ .map((nodeIds) => {
31
+ const node = NodeConstructor.fromIdentifiers(nodeIds);
32
+ const isPossibleProba = node.evaluate() >= 0 && substract(node, 1).evaluate() <= 0;
33
+ return { tex: node.toTex(), isPossibleProba };
34
+ })
35
+ .filter(({ isPossibleProba }) => isPossibleProba === isFilterPossibleProba)
36
+ .map(({ tex }) => tex);
48
37
  return `Les valeurs possibles pour une probabilité sont comprises entre $0$ inclus et $1$ inclus.
49
- La liste à constituer était donc :
38
+ ${allAnswerTexs.length > 1
39
+ ? `Les réponses attendues (valeurs ${isFilterPossibleProba ? `possibles` : `impossibles`}) étaient`
40
+ : `La réponse attendue (valeur ${isFilterPossibleProba ? `possible` : `impossible`}) était`} donc :
50
41
 
42
+ ${allAnswerTexs
43
+ .map((tex) => `
44
+
51
45
  $$
52
- ${getAnswer(identifiers)}
46
+ ${tex}
53
47
  $$
54
- `;
48
+
49
+ `)
50
+ .join("")}`;
55
51
  };
56
- const getPropositions = (n, { answer, ...identifiers }) => {
52
+ const getPropositions = (_, { answer, ...identifiers }) => {
57
53
  const { arrayOfNodeIds, isFilterPossibleProba } = identifiers;
58
54
  const propositions = [];
59
55
  // addValidProp(propositions, answer);
60
- const allProbas = arrayOfNodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
61
- const possibleNodes = allProbas.filter((node) => node.evaluate() >= 0 && substract(node, 1).evaluate() <= 0);
62
- const impossibleNodes = allProbas.filter((node) => node.evaluate() < 0 || substract(node, 1).evaluate() > 0);
63
- const validNodes = isFilterPossibleProba ? possibleNodes : impossibleNodes;
64
- //we keep the order of the question
65
- addValidProp(propositions, validNodes.map((node) => node.toTex()).join(" ; "));
66
- while (propositions.length < n) {
67
- const pickedNodes = allProbas.filter(coinFlip);
68
- tryToAddWrongProp(propositions, pickedNodes.map((node) => node.toTex()).join(" ; "));
69
- }
70
- return shuffleProps(propositions, n);
71
- };
72
- const isAnswerValid = (ans, { answer }) => {
73
- const ansWithoutTrailingSemicolon = ans.slice(-1) === ";" ? ans.slice(0, -1) : ans;
74
- const arrTex = ansWithoutTrailingSemicolon.split(";");
75
- const arrNode = arrTex
76
- .map((tex) => parseLatex(tex))
77
- .toSorted((nodeA, nodeB) => substract(nodeA, nodeB).evaluate());
78
- const arrTexSorted = arrNode.map((node) => node.toTex());
79
- const ansRefined = arrTexSorted.join(";");
80
- return ansRefined === answer;
81
- };
82
- const getKeys = (identifiers) => {
83
- const { arrayOfNodeIds } = identifiers;
84
- const arrNode = arrayOfNodeIds.map((nodeIds) => NodeConstructor.fromIdentifiers(nodeIds));
85
- return [
86
- "semicolon",
87
- ...arrNode.map((node) => {
88
- return {
89
- id: "custom",
90
- label: node.toTex(),
91
- labelType: "tex",
92
- mathfieldInstructions: {
93
- method: "write",
94
- content: node.toTex(),
95
- },
96
- };
97
- }),
98
- ];
56
+ const allProbasObj = arrayOfNodeIds.map((nodeIds) => {
57
+ const node = NodeConstructor.fromIdentifiers(nodeIds);
58
+ const isPossibleProba = node.evaluate() >= 0 && substract(node, 1).evaluate() <= 0;
59
+ return { tex: node.toTex(), isPossibleProba };
60
+ });
61
+ allProbasObj.forEach(({ tex, isPossibleProba }) => {
62
+ if (isPossibleProba === isFilterPossibleProba) {
63
+ addValidProp(propositions, tex);
64
+ }
65
+ else {
66
+ tryToAddWrongProp(propositions, tex);
67
+ }
68
+ });
69
+ return propositions;
99
70
  };
100
71
  const optsDefault = {
101
- numberTypes: ["Entier", "Décimal", "Fraction", "Puiss10", "Sci", "Réel"],
102
- nbValues: 8,
72
+ numberTypes: [
73
+ "Entier",
74
+ "Décimal",
75
+ "Fraction",
76
+ "Puissance de 10",
77
+ "Écriture scientifique",
78
+ "Réel",
79
+ ],
103
80
  };
104
81
  const options = [
105
82
  {
@@ -107,17 +84,16 @@ const options = [
107
84
  label: "Types de nombres",
108
85
  type: GeneratorOptionType.multiselect,
109
86
  target: GeneratorOptionTarget.generation,
110
- values: ["Entier", "Décimal", "Fraction", "Puiss10", "Sci", "Réel"],
87
+ values: [
88
+ "Entier",
89
+ "Décimal",
90
+ "Fraction",
91
+ "Puissance de 10",
92
+ "Écriture scientifique",
93
+ "Réel",
94
+ ],
111
95
  defaultValue: optsDefault.numberTypes,
112
96
  },
113
- {
114
- id: "nbValues",
115
- label: "Longueur de la liste",
116
- type: GeneratorOptionType.select,
117
- target: GeneratorOptionTarget.generation,
118
- values: [5, 6, 7, 8, 9, 10],
119
- defaultValue: optsDefault.nbValues,
120
- },
121
97
  ];
122
98
  const createRandomNode = (numberType, isPossibleProba) => {
123
99
  if (isPossibleProba) {
@@ -136,9 +112,9 @@ const createRandomNode = (numberType, isPossibleProba) => {
136
112
  return frac(num, den);
137
113
  }
138
114
  }
139
- case "Puiss10":
115
+ case "Puissance de 10":
140
116
  return power(10, randint(-15, 1));
141
- case "Sci":
117
+ case "Écriture scientifique":
142
118
  if (probaFlip(0.7)) {
143
119
  return multiply(randfloat(1, 10, randint(1, 5)), power(10, randint(-15, 0)));
144
120
  }
@@ -180,9 +156,9 @@ const createRandomNode = (numberType, isPossibleProba) => {
180
156
  return frac(num, den);
181
157
  }
182
158
  }
183
- case "Puiss10":
159
+ case "Puissance de 10":
184
160
  return power(10, randint(1, 15));
185
- case "Sci":
161
+ case "Écriture scientifique":
186
162
  if (probaFlip(0.7)) {
187
163
  return coinFlip()
188
164
  ? multiply(randfloat(1, 10, randint(1, 5), [1]), power(10, randint(0, 15)))
@@ -208,22 +184,24 @@ const createRandomNode = (numberType, isPossibleProba) => {
208
184
  };
209
185
  const getPossibleValuesForProbaQuestion = (optsIn) => {
210
186
  const opts = Object.assign(optsDefault, optsIn) ?? optsDefault;
187
+ const nbPropositions = 4;
211
188
  const isFilterPossibleProba = coinFlip();
212
189
  //create numberType list
213
190
  const dictNumberTypeToPriority = {
214
191
  Entier: 1,
215
- Puiss10: 2,
192
+ "Puissance de 10": 2,
216
193
  Décimal: 3,
217
194
  Fraction: 4,
218
195
  Réel: 5,
196
+ "Écriture scientifique": 6,
219
197
  };
220
198
  let arrNumberType = [...opts.numberTypes];
221
199
  //filler
222
- while (arrNumberType.length < opts.nbValues) {
200
+ while (arrNumberType.length < nbPropositions) {
223
201
  arrNumberType.push(...shuffle(opts.numberTypes));
224
202
  }
225
203
  arrNumberType = arrNumberType
226
- .slice(0, opts.nbValues)
204
+ .slice(0, nbPropositions)
227
205
  .toSorted((numberType1, numberType2) => dictNumberTypeToPriority[numberType1] -
228
206
  dictNumberTypeToPriority[numberType2]);
229
207
  //create list
@@ -265,9 +243,8 @@ const getPossibleValuesForProbaQuestion = (optsIn) => {
265
243
  };
266
244
  const getQuestionFromIdentifiers = (identifiers) => {
267
245
  const question = {
268
- answer: getAnswer(identifiers),
269
246
  instruction: getInstruction(identifiers),
270
- keys: getKeys(identifiers),
247
+ keys: [],
271
248
  answerFormat: "tex",
272
249
  identifiers,
273
250
  hint: getHint(identifiers),
@@ -284,10 +261,10 @@ export const possibleValuesForProba = {
284
261
  qcmTimer: 60,
285
262
  freeTimer: 60,
286
263
  getPropositions,
287
- isAnswerValid,
288
264
  subject: "Mathématiques",
289
265
  maxAllowedQuestions: 30,
290
266
  getQuestionFromIdentifiers,
291
267
  answerType: "QCM",
268
+ isQCM: true,
292
269
  hasHintAndCorrection: true,
293
270
  };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../exercise.js";
2
+ type Identifiers = {
3
+ situationIndex: number;
4
+ dictShuffle: Record<string, string>;
5
+ pType: string;
6
+ };
7
+ export declare const conditionalProbaWriteFromFrench: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=conditionalProbaWriteFromFrench.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conditionalProbaWriteFromFrench.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/conditionalProbaWriteFromFrench.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAcT,MAAM,mBAAmB,CAAC;AAK3B,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA8QF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAejE,CAAC"}
@@ -0,0 +1,221 @@
1
+ import { randint } from "../../../math/utils/random/randint.js";
2
+ import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../exercise.js";
3
+ import { getDistinctQuestions } from "../../utils/getDistinctQuestions.js";
4
+ import { shuffle } from "../../../utils/alea/shuffle.js";
5
+ import { random } from "../../../utils/alea/random.js";
6
+ const situations = [
7
+ {
8
+ context: "Martine est à la plage pour faire de la pêche à pied. Elle ramasse un coquillage.",
9
+ strA: "C'est une moule.",
10
+ strB: "Il y a un petit crabe à l'intérieur.",
11
+ "(A)": "que ce soit une moule",
12
+ "(B)": "qu'il y ait un petit crabe à l'intérieur",
13
+ "(A \\cap B)": "que ce soit une moule avec un petit crabe à l'intérieur",
14
+ "_A(B)": "qu'il y ait un petit crabe à l'intérieur, sachant que c'est une moule",
15
+ "_B(A)": "que ce soit une moule, sachant qu'il y a un petit crabe à l'intérieur",
16
+ },
17
+ {
18
+ context: "Pour payer sa baguette multi-graines, Ahmed prend un billet au hasard dans son portefeuille.",
19
+ strA: "C'est un billet de $10$ euros.",
20
+ strB: "Il est froissé.",
21
+ "(A)": "que ce soit un billet de $10$ euros",
22
+ "(B)": "qu'il soit froissé",
23
+ "(A \\cap B)": "que ce soit un billet froissé de $10$ euros",
24
+ "_A(B)": "qu'il soit froissé, sachant que c'est un billet de $10$ euros",
25
+ "_B(A)": "que ce soit un billet de $10$ euros, sachant qu'il est froissé",
26
+ },
27
+ {
28
+ context: "Cynthia change de station de radio. Elle tombe sur un morceau de musique.",
29
+ strA: "C'est de la pop.",
30
+ strB: "Les paroles sont en anglais.",
31
+ "(A)": "que ce soit de la pop",
32
+ "(B)": "que les paroles soient en anglais",
33
+ "(A \\cap B)": "que ce soit un morceau de pop en anglais",
34
+ "_A(B)": "que les paroles soient en anglais, sachant que c'est de la pop",
35
+ "_B(A)": "que ce soit de la pop, sachant que les paroles sont en anglais",
36
+ },
37
+ {
38
+ context: "À la maison, Henri et Raphaël jouent au Monopoly. Raphaël lance les dés.",
39
+ strA: "Le résultat du lancer est un double $6$.",
40
+ strB: "Les dés sont tombés par terre.",
41
+ "(A)": "que le résulat du lancer soit un double $6$",
42
+ "(B)": "que les dés soient tombés par terre",
43
+ "(A \\cap B)": "que les dés soient tombés par terre et aient donné un double $6$",
44
+ "_A(B)": "que les dés soient tombés par terre, sachant que le résultat du lancer est un double $6$",
45
+ "_B(A)": "que ce soit un double $6$, sachant que les dés sont tombés par terre",
46
+ },
47
+ {
48
+ context: "Au hasard, la maîtresse ouvre le dictionnaire et pose son doigt sur un mot.",
49
+ strA: "C'est un mot de $7$ lettres.",
50
+ strB: 'Le mot se termine par la lettre "e".',
51
+ "(A)": "que ce soit un mot de $7$ lettres",
52
+ "(B)": 'que le mot se termine par un "e"',
53
+ "(A \\cap B)": 'que ce soit un mot de $7$ lettres qui se termine par un "e"',
54
+ "_A(B)": 'que ce soit un mot qui se termine par un "e", sachant que c\'est un mot de $7$ lettres',
55
+ "_B(A)": 'que ce soit un mot de $7$ lettres sachant qu\'il se termine par un "e"',
56
+ },
57
+ {
58
+ context: "Dans une émission TV, le présentateur demande son prénom à quelqu'un dans le public.",
59
+ strA: "Le prénom est Jean-Michel.",
60
+ strB: 'Le prénom commence par la lettre "A".',
61
+ "(A)": "que le prénom soit Jean-Michel",
62
+ "(B)": 'que le prénom commence par la lettre "J"',
63
+ "(A \\cap B)": 'que le prénom soit Jean-Michel et qu\'il commence par un "A"',
64
+ "_A(B)": 'que le prénom commence par un "A", sachant que c\'est Jean-Michel',
65
+ "_B(A)": 'que le prénom soit Jean-Michel, sachant qu\'il commence par un "A"',
66
+ },
67
+ {
68
+ context: "Il est $14$h$37$. Yohann et Sarah sont assis en classe. C'est un cours sur les probabilités.",
69
+ strA: "Yohann dort.",
70
+ strB: "Sarah est attentive.",
71
+ "(A)": "que Yohann dorme",
72
+ "(B)": "que Sarah soit attentive",
73
+ "(A \\cap B)": "que Yohann dorme tandis que Sarah est attentive",
74
+ "_A(B)": "que Sarah soit attentive, sachant que Yohann dort",
75
+ "_B(A)": "que Yohann dorme, sachant que Sarah est attentive",
76
+ },
77
+ ];
78
+ const shuffleSituation = (situation, dictShuffle) => {
79
+ function replaceKey(strSrc, dictReplacement) {
80
+ return Object.keys(dictReplacement).reduce((acc, x) => {
81
+ return acc.replace(x, dictReplacement[x]);
82
+ }, strSrc);
83
+ }
84
+ const arrayOfTemporaryKeys = [
85
+ ...Array(Object.keys(dictShuffle).length).keys(),
86
+ ].map((i) => {
87
+ return `temporaryKey{${i}}`;
88
+ });
89
+ const dictReplacementOriginaltoTemporary = Object.fromEntries(Object.keys(dictShuffle).map((originalKey, i) => {
90
+ return [originalKey, arrayOfTemporaryKeys[i]];
91
+ }));
92
+ const dictReplacementTemporaryToShuffledOriginal = Object.fromEntries(Object.keys(dictShuffle).map((originalKey) => {
93
+ return [
94
+ dictReplacementOriginaltoTemporary[originalKey],
95
+ dictShuffle[originalKey],
96
+ ];
97
+ }));
98
+ return Object.fromEntries(Object.entries(situation).map(([k, v]) => [
99
+ k === "(A \\cap B)"
100
+ ? k
101
+ : replaceKey(replaceKey(k, dictReplacementOriginaltoTemporary), dictReplacementTemporaryToShuffledOriginal),
102
+ v,
103
+ ]));
104
+ };
105
+ const getInstruction = (identifiers) => {
106
+ const { situationIndex, dictShuffle, pType } = identifiers;
107
+ const situation = shuffleSituation(situations[situationIndex], dictShuffle);
108
+ let instruction = `${situation.context}`;
109
+ instruction += `
110
+
111
+ Soit $A$ l'évenement :
112
+
113
+ > ${situation.strA}
114
+
115
+ Soit $B$ l'évenement :
116
+
117
+ > ${situation.strB}`;
118
+ instruction += `
119
+
120
+ Écris en langage mathématique :
121
+
122
+ La probabilité ${situation[pType]}.`;
123
+ return instruction;
124
+ };
125
+ const getAnswer = (identifiers) => {
126
+ const { pType } = identifiers;
127
+ switch (pType) {
128
+ case "(A \\cap B)":
129
+ return `P\\left(A\\cap B\\right)`;
130
+ case "_A(B)":
131
+ return `P_A\\left(B\\right)`;
132
+ case "_B(A)":
133
+ return `P_B\\left(A\\right)`;
134
+ default:
135
+ return "";
136
+ }
137
+ };
138
+ const getHint = () => {
139
+ return `Si $M$ et $N$ sont deux évenements, alors
140
+
141
+ $P(M \\cap N)$ est la probabilité de l'évènement "$M$ et $N$".
142
+
143
+ $P_M(N)$ est la probabilité de l'évènement $N$, sachant que l'évènement $M$ est réalisé.
144
+
145
+ $P_N(M)$ est la probabilité de l'évènement $M$, sachant que l'évènement $N$ est réalisé.`;
146
+ };
147
+ const getCorrection = (identifiers) => {
148
+ const { situationIndex, dictShuffle, pType } = identifiers;
149
+ const situation = shuffleSituation(situations[situationIndex], dictShuffle);
150
+ return `La probabilité ${situation[pType]}${pType === "_A(B)" || pType === "_B(A)" ? ", est" : " n'est pas"} une probabilité conditionnelle.
151
+ ${(() => {
152
+ switch (pType) {
153
+ case "(A \\cap B)":
154
+ return `C'est la probabilité de l'évènement "$A$ et $B$", sans condition particulière.`;
155
+ case "_A(B)":
156
+ return `C'est la probabilité sachant A (donc conditionnelle), $P_A$, de l'évènement "$B$".`;
157
+ case "_B(A)":
158
+ return `C'est la probabilité sachant B (donc conditionnelle), $P_B$, de l'évènement "$A$".`;
159
+ }
160
+ })()}
161
+ Elle se note $P${pType}$.`;
162
+ };
163
+ const getConditionalProbaWriteFromFrenchQuestion = () => {
164
+ const pType = random(["(A \\cap B)", "_A(B)", "_B(A)"]);
165
+ const situationIndex = randint(0, situations.length);
166
+ const arrABShuffled = shuffle(["A", "B"]);
167
+ const dictShuffle = Object.fromEntries(["A", "B"].map((c, i) => [c, arrABShuffled[i]]));
168
+ const identifiers = { situationIndex, dictShuffle, pType };
169
+ return getQuestionFromIdentifiers(identifiers);
170
+ };
171
+ const getQuestionFromIdentifiers = (identifiers) => {
172
+ const question = {
173
+ instruction: getInstruction(identifiers),
174
+ answer: getAnswer(identifiers),
175
+ keys: ["P", "cap", "underscore", "A", "B"],
176
+ answerFormat: "tex",
177
+ identifiers,
178
+ hint: getHint(identifiers),
179
+ correction: getCorrection(identifiers),
180
+ };
181
+ return question;
182
+ };
183
+ const getPropositions = (n, { answer }) => {
184
+ const propositions = [];
185
+ addValidProp(propositions, answer);
186
+ tryToAddWrongProp(propositions, `P\\left(A\\cap B\\right)`, "tex");
187
+ tryToAddWrongProp(propositions, `P_A\\left(B\\right)`, "tex");
188
+ tryToAddWrongProp(propositions, `P_B\\left(A\\right)`, "tex");
189
+ tryToAddWrongProp(propositions, `P(A)`, "tex");
190
+ tryToAddWrongProp(propositions, `P(B)`, "tex");
191
+ return shuffleProps(propositions, n);
192
+ };
193
+ const isAnswerValid = (ans, { answer, ...identifiers }) => {
194
+ const { pType } = identifiers;
195
+ switch (pType) {
196
+ case "(A \\cap B)":
197
+ return (`P\\left(A\\cap B\\right)`.trim() === ans ||
198
+ `P\\left(B\\cap A\\right)`.trim() === ans);
199
+ case "_A(B)":
200
+ return `P_A\\left(B\\right)`.trim() === ans.trim();
201
+ case "_B(A)":
202
+ return `P_B\\left(A\\right)`.trim() === ans.trim();
203
+ default:
204
+ return false;
205
+ }
206
+ };
207
+ export const conditionalProbaWriteFromFrench = {
208
+ id: "conditionalProbaWriteFromFrench",
209
+ connector: "=",
210
+ label: "Ecrire une probabilité en langage mathématique",
211
+ isSingleStep: false,
212
+ generator: (nb) => getDistinctQuestions(getConditionalProbaWriteFromFrenchQuestion, nb),
213
+ qcmTimer: 60,
214
+ freeTimer: 60,
215
+ getPropositions,
216
+ isAnswerValid,
217
+ subject: "Mathématiques",
218
+ hasHintAndCorrection: true,
219
+ getQuestionFromIdentifiers,
220
+ answerType: "QCU",
221
+ };
@@ -13,4 +13,6 @@ export * from "./unionIntersectionProba.js";
13
13
  export * from "./checkEquiprobability.js";
14
14
  export * from "./events/index.js";
15
15
  export * from "./basicProbas/index.js";
16
+ export * from "./probaAsSumOfProbas.js";
17
+ export * from "./conditionalProbaWriteFromFrench.js";
16
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sCAAsC,CAAC"}
@@ -13,3 +13,5 @@ export * from "./unionIntersectionProba.js";
13
13
  export * from "./checkEquiprobability.js";
14
14
  export * from "./events/index.js";
15
15
  export * from "./basicProbas/index.js";
16
+ export * from "./probaAsSumOfProbas.js";
17
+ export * from "./conditionalProbaWriteFromFrench.js";
@@ -0,0 +1,29 @@
1
+ import { Exercise } from "../../exercise.js";
2
+ import { NodeIdentifiers } from "../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ indexSituation: number;
5
+ eventIds: EventIdentifiers;
6
+ arrProba: NodeIdentifiers[];
7
+ };
8
+ type EventIdentifiers = {
9
+ type: "elementary";
10
+ index: number;
11
+ id: string;
12
+ str: string;
13
+ p: NodeIdentifiers;
14
+ } | {
15
+ type: "union";
16
+ id: string;
17
+ str: string;
18
+ p: NodeIdentifiers;
19
+ arrSubEvent: EventIdentifiers[];
20
+ isTailoredStr: boolean;
21
+ };
22
+ type Options = {
23
+ nbElem: number[];
24
+ unionLength: number[];
25
+ isProbasAreNumbers: boolean[];
26
+ };
27
+ export declare const probaAsSumOfProbas: Exercise<Identifiers, Options>;
28
+ export {};
29
+ //# sourceMappingURL=probaAsSumOfProbas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"probaAsSumOfProbas.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaAsSumOfProbas.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAkBT,MAAM,mBAAmB,CAAC;AAK3B,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,gBAAgB,GACjB;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,eAAe,CAAC;CACpB,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,eAAe,CAAC;IACnB,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AA4eN,KAAK,OAAO,GAAG;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,kBAAkB,EAAE,OAAO,EAAE,CAAC;CAC/B,CAAC;AAyTF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe7D,CAAC"}