math-exercises 3.0.156 → 3.0.158

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 (321) hide show
  1. package/lib/exercises/exercise.d.ts +7 -0
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +1 -1
  4. package/lib/exercises/math/calculLitteral/equation/exp/expOfAffineEquals1Equation.d.ts +14 -0
  5. package/lib/exercises/math/calculLitteral/equation/exp/expOfAffineEquals1Equation.d.ts.map +1 -0
  6. package/lib/exercises/math/calculLitteral/equation/exp/expOfAffineEquals1Equation.js +145 -0
  7. package/lib/exercises/math/calculLitteral/equation/exp/expOfFEqualsExpOfGEquation.d.ts +16 -0
  8. package/lib/exercises/math/calculLitteral/equation/exp/expOfFEqualsExpOfGEquation.d.ts.map +1 -0
  9. package/lib/exercises/math/calculLitteral/equation/exp/expOfFEqualsExpOfGEquation.js +444 -0
  10. package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.d.ts +15 -0
  11. package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.d.ts.map +1 -0
  12. package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.js +292 -0
  13. package/lib/exercises/math/calculLitteral/equation/exp/index.d.ts +4 -0
  14. package/lib/exercises/math/calculLitteral/equation/exp/index.d.ts.map +1 -0
  15. package/lib/exercises/math/calculLitteral/equation/exp/index.js +3 -0
  16. package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts +4 -1
  17. package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -1
  18. package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +148 -31
  19. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts +4 -1
  20. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
  21. package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +124 -44
  22. package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.d.ts +18 -0
  23. package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.d.ts.map +1 -0
  24. package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.js +437 -0
  25. package/lib/exercises/math/calculLitteral/inequations/exp/index.d.ts +2 -0
  26. package/lib/exercises/math/calculLitteral/inequations/exp/index.d.ts.map +1 -0
  27. package/lib/exercises/math/calculLitteral/inequations/exp/index.js +1 -0
  28. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts.map +1 -1
  29. package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.js +4 -1
  30. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -1
  31. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +29 -0
  32. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -1
  33. package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +35 -2
  34. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -1
  35. package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +19 -0
  36. package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.d.ts +10 -0
  37. package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.d.ts.map +1 -0
  38. package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.js +282 -0
  39. package/lib/exercises/math/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
  40. package/lib/exercises/math/derivation/derivative/inverseFunctionDerivative.js +30 -2
  41. package/lib/exercises/math/derivation/derivative/productDerivative.d.ts.map +1 -1
  42. package/lib/exercises/math/derivation/derivative/productDerivative.js +68 -1
  43. package/lib/exercises/math/derivation/derivative/quotientDerivative.d.ts.map +1 -1
  44. package/lib/exercises/math/derivation/derivative/quotientDerivative.js +40 -4
  45. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts.map +1 -1
  46. package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.js +30 -3
  47. package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeAlgebraicExpression.d.ts +12 -0
  48. package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeAlgebraicExpression.d.ts.map +1 -0
  49. package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeAlgebraicExpression.js +127 -0
  50. package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromAlgebraic.d.ts +13 -0
  51. package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromAlgebraic.d.ts.map +1 -0
  52. package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromAlgebraic.js +161 -0
  53. package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromImages.d.ts +11 -0
  54. package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromImages.d.ts.map +1 -0
  55. package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromImages.js +116 -0
  56. package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberCalcul.d.ts +8 -0
  57. package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberCalcul.d.ts.map +1 -0
  58. package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberCalcul.js +142 -0
  59. package/lib/exercises/math/derivation/derivativeNumber/index.d.ts +4 -0
  60. package/lib/exercises/math/derivation/derivativeNumber/index.d.ts.map +1 -0
  61. package/lib/exercises/math/derivation/derivativeNumber/index.js +4 -0
  62. package/lib/exercises/math/derivation/index.d.ts +1 -1
  63. package/lib/exercises/math/derivation/index.js +1 -1
  64. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -1
  65. package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +5 -4
  66. package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.d.ts +13 -0
  67. package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.d.ts.map +1 -0
  68. package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.js +278 -0
  69. package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.d.ts +11 -0
  70. package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.d.ts.map +1 -0
  71. package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.js +211 -0
  72. package/lib/exercises/math/functions/exponential/algebraic/approxExpN.d.ts +9 -0
  73. package/lib/exercises/math/functions/exponential/algebraic/approxExpN.d.ts.map +1 -0
  74. package/lib/exercises/math/functions/exponential/algebraic/approxExpN.js +142 -0
  75. package/lib/exercises/math/functions/exponential/algebraic/index.d.ts +5 -0
  76. package/lib/exercises/math/functions/exponential/algebraic/index.d.ts.map +1 -0
  77. package/lib/exercises/math/functions/exponential/algebraic/index.js +4 -0
  78. package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.d.ts +14 -0
  79. package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.d.ts.map +1 -0
  80. package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.js +337 -0
  81. package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.d.ts +11 -0
  82. package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.d.ts.map +1 -0
  83. package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.js +234 -0
  84. package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.d.ts +9 -0
  85. package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.d.ts.map +1 -0
  86. package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.js +190 -0
  87. package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.d.ts +9 -0
  88. package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.d.ts.map +1 -0
  89. package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.js +190 -0
  90. package/lib/exercises/math/functions/exponential/definition/index.d.ts +5 -0
  91. package/lib/exercises/math/functions/exponential/definition/index.d.ts.map +1 -0
  92. package/lib/exercises/math/functions/exponential/definition/index.js +4 -0
  93. package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.d.ts +13 -0
  94. package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.d.ts.map +1 -0
  95. package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.js +375 -0
  96. package/lib/exercises/math/functions/linear/linearFromExercise.d.ts.map +1 -1
  97. package/lib/exercises/math/functions/linear/linearFromExercise.js +4 -3
  98. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.d.ts.map +1 -1
  99. package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.js +30 -3
  100. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.d.ts.map +1 -1
  101. package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.js +35 -1
  102. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -1
  103. package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.js +1 -1
  104. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.d.ts.map +1 -1
  105. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.js +23 -1
  106. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts.map +1 -1
  107. package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.js +29 -0
  108. package/lib/exercises/math/functions/variations/exp/index.d.ts +3 -0
  109. package/lib/exercises/math/functions/variations/exp/index.d.ts.map +1 -0
  110. package/lib/exercises/math/functions/variations/exp/index.js +2 -0
  111. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.d.ts +9 -0
  112. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.d.ts.map +1 -0
  113. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.js +101 -0
  114. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.d.ts +11 -0
  115. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.d.ts.map +1 -0
  116. package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.js +192 -0
  117. package/lib/exercises/math/geometry/euclidian/pinPointFromAxialOrCentralSymmetry.js +2 -2
  118. package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.js +1 -1
  119. package/lib/exercises/math/geometry/euclidian/recognizeHomothetyCenter.d.ts.map +1 -1
  120. package/lib/exercises/math/geometry/euclidian/recognizeHomothetyCenter.js +4 -5
  121. package/lib/exercises/math/geometry/euclidianConstructions/placeHomothetyCenter.js +4 -4
  122. package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
  123. package/lib/exercises/math/geometry/perimeters/circleCircumference.js +5 -3
  124. package/lib/exercises/math/geometry/thales/thales.js +1 -1
  125. package/lib/exercises/math/geometry/thales/thalesCalcul.js +1 -1
  126. package/lib/exercises/math/geometry/vectors/colinearity/determinant.js +1 -1
  127. package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +1 -1
  128. package/lib/exercises/math/geometry/vectors/scalarProduct/findCoordinatesToOrthogonalize.d.ts.map +1 -1
  129. package/lib/exercises/math/geometry/vectors/scalarProduct/findCoordinatesToOrthogonalize.js +33 -7
  130. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.js +1 -1
  131. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts.map +1 -1
  132. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +38 -1
  133. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
  134. package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +18 -5
  135. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.d.ts.map +1 -1
  136. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +45 -21
  137. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -1
  138. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +33 -12
  139. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts.map +1 -1
  140. package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +38 -15
  141. package/lib/exercises/math/percent/findTVA.d.ts.map +1 -1
  142. package/lib/exercises/math/percent/findTVA.js +17 -11
  143. package/lib/exercises/math/percent/populationEffectifFromSubPopulation.js +1 -1
  144. package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
  145. package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
  146. package/lib/exercises/math/probaStat/basicProbas/index.js +1 -1
  147. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableSituations.d.ts.map +1 -1
  148. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableSituations.js +114 -20
  149. package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.js +2 -2
  150. package/lib/exercises/math/probaStat/conditionalProbability.d.ts +4 -1
  151. package/lib/exercises/math/probaStat/conditionalProbability.d.ts.map +1 -1
  152. package/lib/exercises/math/probaStat/conditionalProbability.js +38 -5
  153. package/lib/exercises/math/probaStat/independancy/independancy.d.ts +9 -0
  154. package/lib/exercises/math/probaStat/independancy/independancy.d.ts.map +1 -0
  155. package/lib/exercises/math/probaStat/independancy/independancy.js +114 -0
  156. package/lib/exercises/math/probaStat/independancy/independancyFindCap.d.ts +9 -0
  157. package/lib/exercises/math/probaStat/independancy/independancyFindCap.d.ts.map +1 -0
  158. package/lib/exercises/math/probaStat/independancy/independancyFindCap.js +101 -0
  159. package/lib/exercises/math/probaStat/independancy/independancyFindCup.d.ts +9 -0
  160. package/lib/exercises/math/probaStat/independancy/independancyFindCup.d.ts.map +1 -0
  161. package/lib/exercises/math/probaStat/independancy/independancyFindCup.js +118 -0
  162. package/lib/exercises/math/probaStat/independancy/index.d.ts +5 -0
  163. package/lib/exercises/math/probaStat/independancy/index.d.ts.map +1 -0
  164. package/lib/exercises/math/probaStat/independancy/index.js +4 -0
  165. package/lib/exercises/math/probaStat/independancy/isIndependantFromDefinition.d.ts +10 -0
  166. package/lib/exercises/math/probaStat/independancy/isIndependantFromDefinition.d.ts.map +1 -0
  167. package/lib/exercises/math/probaStat/independancy/isIndependantFromDefinition.js +106 -0
  168. package/lib/exercises/math/probaStat/index.d.ts +1 -1
  169. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  170. package/lib/exercises/math/probaStat/index.js +1 -1
  171. package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.js +1 -1
  172. package/lib/exercises/math/probaStat/stats1var/etendueTable.d.ts.map +1 -1
  173. package/lib/exercises/math/probaStat/stats1var/etendueTable.js +5 -1
  174. package/lib/exercises/math/probaStat/stats1var/medianWithList.js +1 -1
  175. package/lib/exercises/math/probaStat/stats1var/medianWithTable.d.ts.map +1 -1
  176. package/lib/exercises/math/probaStat/stats1var/medianWithTable.js +19 -5
  177. package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +1 -1
  178. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts.map +1 -1
  179. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.js +41 -29
  180. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts.map +1 -1
  181. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.js +10 -3
  182. package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts.map +1 -1
  183. package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.js +9 -2
  184. package/lib/exercises/math/probaStat/twoStepExperiments/twoStepExperimentProbas.d.ts.map +1 -1
  185. package/lib/exercises/math/probaStat/twoStepExperiments/twoStepExperimentProbas.js +25 -10
  186. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFirstTermRandom.d.ts +9 -0
  187. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFirstTermRandom.d.ts.map +1 -0
  188. package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFirstTermRandom.js +118 -0
  189. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.d.ts.map +1 -1
  190. package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.js +55 -6
  191. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.d.ts.map +1 -1
  192. package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.js +42 -1
  193. package/lib/exercises/math/sequences/arithmetic/arithmeticFirstTermsSum.d.ts +4 -1
  194. package/lib/exercises/math/sequences/arithmetic/arithmeticFirstTermsSum.d.ts.map +1 -1
  195. package/lib/exercises/math/sequences/arithmetic/arithmeticFirstTermsSum.js +57 -7
  196. package/lib/exercises/math/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts.map +1 -1
  197. package/lib/exercises/math/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +24 -2
  198. package/lib/exercises/math/sequences/arithmetic/arithmeticThresholdFind.d.ts.map +1 -1
  199. package/lib/exercises/math/sequences/arithmetic/arithmeticThresholdFind.js +31 -8
  200. package/lib/exercises/math/sequences/arithmetic/index.d.ts +1 -1
  201. package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
  202. package/lib/exercises/math/sequences/arithmetic/index.js +1 -1
  203. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -1
  204. package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +11 -1
  205. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.js +5 -5
  206. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts.map +1 -1
  207. package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.js +3 -1
  208. package/lib/exercises/math/sequences/geometric/geometricFindReason.d.ts.map +1 -1
  209. package/lib/exercises/math/sequences/geometric/geometricFindReason.js +41 -2
  210. package/lib/exercises/math/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
  211. package/lib/exercises/math/sequences/geometric/geometricRecurrenceFormulaUsage.js +28 -2
  212. package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -1
  213. package/lib/exercises/math/sequences/sequenceEvaluation.js +22 -2
  214. package/lib/exercises/math/spaceGeometry/solids/recognizeSolidFromSolidPattern.js +1 -1
  215. package/lib/exercises/math/spaceGeometry/sphere/index.d.ts +2 -0
  216. package/lib/exercises/math/spaceGeometry/sphere/index.d.ts.map +1 -1
  217. package/lib/exercises/math/spaceGeometry/sphere/index.js +3 -1
  218. package/lib/exercises/math/spaceGeometry/sphere/pinPointLatLon.2d.d.ts +12 -0
  219. package/lib/exercises/math/spaceGeometry/sphere/pinPointLatLon.2d.d.ts.map +1 -0
  220. package/lib/exercises/math/spaceGeometry/sphere/pinPointLatLon.2d.js +205 -0
  221. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts +13 -0
  222. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts.map +1 -0
  223. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +215 -0
  224. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.3d.d.ts +14 -0
  225. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.3d.d.ts.map +1 -0
  226. package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.3d.js +390 -0
  227. package/lib/exercises/math/trigonometry/circle/areReelsOnTheSameTrigoCirclePoint.d.ts +9 -0
  228. package/lib/exercises/math/trigonometry/circle/areReelsOnTheSameTrigoCirclePoint.d.ts.map +1 -0
  229. package/lib/exercises/math/trigonometry/circle/areReelsOnTheSameTrigoCirclePoint.js +107 -0
  230. package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts +10 -0
  231. package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts.map +1 -0
  232. package/lib/exercises/math/trigonometry/circle/associatePoint.js +86 -0
  233. package/lib/exercises/math/trigonometry/circle/associateReelToTrigoCirclePoint.d.ts +10 -0
  234. package/lib/exercises/math/trigonometry/circle/associateReelToTrigoCirclePoint.d.ts.map +1 -0
  235. package/lib/exercises/math/trigonometry/circle/associateReelToTrigoCirclePoint.js +205 -0
  236. package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.d.ts +7 -0
  237. package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.d.ts.map +1 -0
  238. package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.js +121 -0
  239. package/lib/exercises/math/trigonometry/circle/index.d.ts +7 -0
  240. package/lib/exercises/math/trigonometry/circle/index.d.ts.map +1 -0
  241. package/lib/exercises/math/trigonometry/circle/index.js +7 -0
  242. package/lib/exercises/math/trigonometry/circle/mainAngleMeasure.d.ts +10 -0
  243. package/lib/exercises/math/trigonometry/circle/mainAngleMeasure.d.ts.map +1 -0
  244. package/lib/exercises/math/trigonometry/circle/mainAngleMeasure.js +100 -0
  245. package/lib/exercises/math/trigonometry/circle/mainRemarkableValues.d.ts +8 -0
  246. package/lib/exercises/math/trigonometry/circle/mainRemarkableValues.d.ts.map +1 -0
  247. package/lib/exercises/math/trigonometry/circle/mainRemarkableValues.js +97 -0
  248. package/lib/exercises/math/trigonometry/circle/remarkableValues.d.ts +10 -0
  249. package/lib/exercises/math/trigonometry/circle/remarkableValues.d.ts.map +1 -0
  250. package/lib/exercises/math/trigonometry/circle/remarkableValues.js +112 -0
  251. package/lib/exercises/math/trigonometry/functions/basicEquationCos.d.ts +7 -0
  252. package/lib/exercises/math/trigonometry/functions/basicEquationCos.d.ts.map +1 -0
  253. package/lib/exercises/math/trigonometry/functions/basicEquationCos.js +92 -0
  254. package/lib/exercises/math/trigonometry/functions/basicEquationSin.d.ts +7 -0
  255. package/lib/exercises/math/trigonometry/functions/basicEquationSin.d.ts.map +1 -0
  256. package/lib/exercises/math/trigonometry/functions/basicEquationSin.js +104 -0
  257. package/lib/exercises/math/trigonometry/functions/basicTrigoSystemEquation.d.ts +7 -0
  258. package/lib/exercises/math/trigonometry/functions/basicTrigoSystemEquation.d.ts.map +1 -0
  259. package/lib/exercises/math/trigonometry/functions/basicTrigoSystemEquation.js +83 -0
  260. package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.d.ts +8 -0
  261. package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.d.ts.map +1 -0
  262. package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.js +111 -0
  263. package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.d.ts +8 -0
  264. package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.d.ts.map +1 -0
  265. package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.js +101 -0
  266. package/lib/exercises/math/trigonometry/functions/index.d.ts +6 -0
  267. package/lib/exercises/math/trigonometry/functions/index.d.ts.map +1 -0
  268. package/lib/exercises/math/trigonometry/functions/index.js +6 -0
  269. package/lib/exercises/math/trigonometry/functions/trigoAssociateAngle.d.ts +9 -0
  270. package/lib/exercises/math/trigonometry/functions/trigoAssociateAngle.d.ts.map +1 -0
  271. package/lib/exercises/math/trigonometry/functions/trigoAssociateAngle.js +151 -0
  272. package/lib/exercises/math/trigonometry/index.d.ts +3 -14
  273. package/lib/exercises/math/trigonometry/index.d.ts.map +1 -1
  274. package/lib/exercises/math/trigonometry/index.js +3 -14
  275. package/lib/exercises/math/trigonometry/triangle/index.d.ts +7 -0
  276. package/lib/exercises/math/trigonometry/triangle/index.d.ts.map +1 -0
  277. package/lib/exercises/math/trigonometry/triangle/index.js +6 -0
  278. package/lib/exercises/math/trigonometry/triangle/trigonometry.d.ts +10 -0
  279. package/lib/exercises/math/trigonometry/triangle/trigonometry.d.ts.map +1 -0
  280. package/lib/exercises/math/trigonometry/triangle/trigonometry.js +207 -0
  281. package/lib/exercises/math/trigonometry/triangle/trigonometryAngleCalcul.d.ts +10 -0
  282. package/lib/exercises/math/trigonometry/triangle/trigonometryAngleCalcul.d.ts.map +1 -0
  283. package/lib/exercises/math/trigonometry/triangle/trigonometryAngleCalcul.js +174 -0
  284. package/lib/exercises/math/trigonometry/triangle/trigonometrySideCalcul.d.ts +11 -0
  285. package/lib/exercises/math/trigonometry/triangle/trigonometrySideCalcul.d.ts.map +1 -0
  286. package/lib/exercises/math/trigonometry/triangle/trigonometrySideCalcul.js +224 -0
  287. package/lib/exercises/math/trigonometry/triangle/trigonometrySideName.d.ts +13 -0
  288. package/lib/exercises/math/trigonometry/triangle/trigonometrySideName.d.ts.map +1 -0
  289. package/lib/exercises/math/trigonometry/triangle/trigonometrySideName.js +189 -0
  290. package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.d.ts +13 -0
  291. package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.d.ts.map +1 -0
  292. package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.js +290 -0
  293. package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaUse.d.ts +18 -0
  294. package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaUse.d.ts.map +1 -0
  295. package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaUse.js +386 -0
  296. package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +1 -1
  297. package/lib/exercises/pc/mathExosInPC.d.ts +2 -2
  298. package/lib/exercises/pc/mathExosInPC.d.ts.map +1 -1
  299. package/lib/exercises/pc/mathExosInPC.js +2 -2
  300. package/lib/exercises/vea/setVEA.d.ts.map +1 -1
  301. package/lib/exercises/vea/setVEA.js +4 -0
  302. package/lib/index.d.ts +87 -29
  303. package/lib/index.d.ts.map +1 -1
  304. package/lib/math/geometry/segment.d.ts +1 -1
  305. package/lib/math/geometry/vector.d.ts +2 -1
  306. package/lib/math/geometry/vector.d.ts.map +1 -1
  307. package/lib/math/geometry/vector.js +1 -1
  308. package/lib/math/numbers/reals/real.d.ts.map +1 -1
  309. package/lib/math/numbers/reals/real.js +2 -0
  310. package/lib/playground.d.ts.map +1 -1
  311. package/lib/playground.js +3 -1
  312. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  313. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  314. package/lib/tree/nodes/functions/sqrtNode.d.ts +2 -1
  315. package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
  316. package/lib/tree/nodes/functions/sqrtNode.js +17 -6
  317. package/lib/tree/nodes/operators/multiplyNode.js +1 -1
  318. package/lib/utils/arrays/dichoFilter.d.ts +2 -0
  319. package/lib/utils/arrays/dichoFilter.d.ts.map +1 -0
  320. package/lib/utils/arrays/dichoFilter.js +11 -0
  321. package/package.json +1 -1
@@ -1,14 +1,64 @@
1
- import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
2
  import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
3
  import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
4
4
  import { probaWheelGGBCommands } from "../../../../geogebra/probas/probaWheelGGBCommands.js";
5
5
  import { randint } from "../../../../math/utils/random/randint.js";
6
+ import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
7
+ import { dichoFilter } from "../../../../utils/arrays/dichoFilter.js";
8
+ import { mdTable } from "../../../../utils/markdown/mdTable.js";
9
+ const getDictEventsAndProba = (arrItem) => {
10
+ const outDict = {};
11
+ const indexesColorsUsed = [
12
+ ...new Set(arrItem.map((wheelItem) => wheelItem.indexColor)),
13
+ ];
14
+ //couleur
15
+ {
16
+ const dictColor = indexesColorsUsed.reduce((acc, i) => {
17
+ const nbIssues = arrItem.filter((itemX) => itemX.indexColor === i).length;
18
+ const nodeProba = frac(nbIssues, arrItem.length);
19
+ acc[i] = nodeProba;
20
+ return acc;
21
+ }, {});
22
+ outDict["couleur"] = dictColor;
23
+ }
24
+ const valuesUsed = [...new Set(arrItem.map((wheelItem) => wheelItem.value))];
25
+ //numéro
26
+ {
27
+ const dictValue = valuesUsed.reduce((acc, v) => {
28
+ const nbIssues = arrItem.filter((itemX) => itemX.value === v).length;
29
+ const nodeProba = frac(nbIssues, arrItem.length);
30
+ acc[v] = nodeProba;
31
+ return acc;
32
+ }, {});
33
+ outDict["numéro"] = dictValue;
34
+ }
35
+ //parité
36
+ {
37
+ const dictColor = [0, 1].reduce((acc, i) => {
38
+ const nbIssues = arrItem.filter((itemX) => itemX.value % 2 === i).length;
39
+ const nodeProba = frac(nbIssues, arrItem.length);
40
+ acc[i] = nodeProba;
41
+ return acc;
42
+ }, {});
43
+ outDict["parité"] = dictColor;
44
+ }
45
+ //geq5
46
+ {
47
+ const dictGeq5 = dichoFilter(arrItem.map((item) => item.value), (v) => v >= 5).reduce((acc, arrV, i) => {
48
+ const nodeProba = frac(arrV.length, arrItem.length);
49
+ acc[i] = nodeProba;
50
+ return acc;
51
+ }, {});
52
+ outDict["geq5"] = dictGeq5;
53
+ }
54
+ return outDict;
55
+ };
6
56
  //on note le numéro du secteur obtenu
7
57
  //on note la couleur du secteur obtenu
8
58
  //on note la parité du numéro obtenu
9
- const getPropositions = (n, { answer, items }) => {
59
+ //on note si le numéro est supérieur ou égal à 5
60
+ const getPropositions = (_arg1, { answer: _arg2, items }) => {
10
61
  const propositions = [];
11
- addValidProp(propositions, answer);
12
62
  const colors = [0, 0, 0, 0];
13
63
  const nums = [0, 0, 0, 0, 0, 0, 0, 0, 0];
14
64
  const pars = [0, 0];
@@ -32,7 +82,16 @@ const getPropositions = (n, { answer, items }) => {
32
82
  addValidProp(propositions, "On note la parité du secteur obtenu (pair ou impair)", "raw");
33
83
  else
34
84
  tryToAddWrongProp(propositions, "On note la parité du secteur obtenu (pair ou impair)", "raw");
35
- return shuffleProps(propositions, n);
85
+ if ((() => {
86
+ const [arrGeq5, arrLt5] = dichoFilter(items.map((item) => item.value), (v) => v >= 5);
87
+ return arrLt5.length === arrGeq5.length;
88
+ })()) {
89
+ addValidProp(propositions, "On note si le numéro obtenu est supérieur ou égal à $5$", "raw");
90
+ }
91
+ else {
92
+ tryToAddWrongProp(propositions, "On note si le numéro obtenu est supérieur ou égal à $5$", "raw");
93
+ }
94
+ return propositions;
36
95
  };
37
96
  const getInstruction = (identifiers) => {
38
97
  const { items } = identifiers;
@@ -45,22 +104,51 @@ const getHint = () => {
45
104
  };
46
105
  const getCorrection = (identifiers) => {
47
106
  const { items } = identifiers;
48
- const colors = [0, 0, 0, 0];
49
- const nums = [0, 0, 0, 0, 0, 0, 0, 0, 0];
50
- const pars = [0, 0];
51
- for (let i = 0; i < items.length; i++) {
52
- colors[items[i].indexColor]++;
53
- nums[items[i].value]++;
54
- if (items[i].value % 2 === 0)
55
- pars[0]++;
56
- else
57
- pars[1]++;
58
- }
107
+ const dictEventsAndProba = getDictEventsAndProba(items);
108
+ const arrAnswer = getPropositions(4, { answer: "", ...identifiers }).filter((proposition) => proposition.isRightAnswer);
59
109
  return `On détaille chaque situation :
60
110
 
61
- -
62
- -
63
- - `;
111
+ ${mdTable([
112
+ ["", ""],
113
+ ["Numéro", ""],
114
+ ["Issue", "Probabilité"],
115
+ ...Object.entries(dictEventsAndProba["numéro"]).map(([s, nodeProba]) => [
116
+ `$${s}$`,
117
+ `$${nodeProba.toTex()}$`,
118
+ ]),
119
+ ["", ""],
120
+ ["Couleur", ""],
121
+ ["Issue", "Probabilité"],
122
+ ...Object.entries(dictEventsAndProba["couleur"]).map(([s, nodeProba]) => {
123
+ const indexEvent = +s;
124
+ return [
125
+ ["rouge", "bleu", "vert", "orange"][indexEvent],
126
+ `$${nodeProba.toTex()}$`,
127
+ ];
128
+ }),
129
+ ["", ""],
130
+ ["Parité", ""],
131
+ ["Issue", "Probabilité"],
132
+ ...Object.entries(dictEventsAndProba["parité"]).map(([s, nodeProba]) => {
133
+ const indexEvent = +s;
134
+ return [["pair", "impair"][indexEvent], `$${nodeProba.toTex()}$`];
135
+ }),
136
+ ["", ""],
137
+ ["Supérieur ou égal à $5$", ""],
138
+ ["Issue", "Probabilité"],
139
+ ...Object.entries(dictEventsAndProba["geq5"]).map(([s, nodeProba]) => {
140
+ const indexEvent = +s;
141
+ return [["oui", "non"][indexEvent], `$${nodeProba.toTex()}$`];
142
+ }),
143
+ ])}
144
+
145
+ Les situations équiprobables sont celles où toutes les issues ont la même probabilité.
146
+ ${arrAnswer.length > 1 ? "Ce sont donc :" : `C'est donc :`}
147
+
148
+ ${arrAnswer.map((proposition) => `- ${proposition.statement}`).join(`
149
+ `)}
150
+
151
+ `;
64
152
  };
65
153
  const getGGBOptions = (identifiers) => {
66
154
  const { items } = identifiers;
@@ -89,13 +177,18 @@ const hasRightAnswer = (items) => {
89
177
  return (colors.filter((e) => !!e).every((i) => i === colors[0]) ||
90
178
  nums
91
179
  .filter((e) => !!e)
92
- .every((i) => i === nums[0] || pars.every((i) => i === pars[0])));
180
+ .every((i) => i === nums[0] || pars.every((i) => i === pars[0])) ||
181
+ (() => {
182
+ const [arrGeq5, arrLt5] = dichoFilter(items.map((item) => item.value), (v) => v >= 5);
183
+ return arrLt5.length === arrGeq5.length;
184
+ })());
93
185
  };
94
186
  const getPickEquiprobableSituationsQuestion = () => {
187
+ const nbWheelItems = randint(8, 11);
95
188
  let items = [];
96
189
  do {
97
190
  items = [];
98
- for (let i = 0; i < 9; i++) {
191
+ for (let i = 0; i < nbWheelItems; i++) {
99
192
  items.push({
100
193
  value: randint(1, 10),
101
194
  indexColor: randint(0, 4),
@@ -127,6 +220,7 @@ export const pickEquiprobableSituations = {
127
220
  subject: "Mathématiques",
128
221
  getHint,
129
222
  getCorrection,
223
+ hasHintAndCorrection: true,
130
224
  getInstruction,
131
225
  getGGBOptions,
132
226
  hasGeogebra: true,
@@ -122,7 +122,7 @@ const getGGBOptions = (identifiers) => {
122
122
  });
123
123
  };
124
124
  const getHint = () => {
125
- return `Compte le nombre d'issues réalisent chaque évènement et cherche lesquels sont égaux entre eux.`;
125
+ return `Compte le nombre d'issues qui réalisent chaque évènement et cherche lesquels sont égaux entre eux.`;
126
126
  };
127
127
  const getCorrection = (identifiers) => {
128
128
  const { arrItem, typeAsked } = identifiers;
@@ -280,7 +280,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
280
280
  export const pickEquiprobableTo = {
281
281
  id: "pickEquiprobableTo",
282
282
  connector: "=",
283
- label: "Déterminer les situations équiprobables à une situation donnée",
283
+ label: "Déterminer les évènements équiprobables",
284
284
  isSingleStep: true,
285
285
  generator: (nb, opts) => getDistinctQuestions(() => getPickEquiprobableToQuestion(opts), nb),
286
286
  qcmTimer: 60,
@@ -7,6 +7,9 @@ type Identifiers = {
7
7
  pA_B?: number;
8
8
  pB_A?: number;
9
9
  };
10
- export declare const conditionalProbability: Exercise<Identifiers>;
10
+ type Options = {
11
+ probaType: string[];
12
+ };
13
+ export declare const conditionalProbability: Exercise<Identifiers, Options>;
11
14
  export {};
12
15
  //# sourceMappingURL=conditionalProbability.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conditionalProbability.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/conditionalProbability.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EAeT,MAAM,mBAAmB,CAAC;AAM3B,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AA8SF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
1
+ {"version":3,"file":"conditionalProbability.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/conditionalProbability.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EAmBT,MAAM,mBAAmB,CAAC;AAO3B,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAoRF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAyDF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBjE,CAAC"}
@@ -1,12 +1,13 @@
1
1
  /* eslint-disable @typescript-eslint/naming-convention*/
2
2
  //? it makes sense here to use pA_B
3
3
  import { randint } from "../../../math/utils/random/randint.js";
4
- import { addValidProp, propWhile, tryToAddWrongProp, } from "../../exercise.js";
4
+ import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, propWhile, tryToAddWrongProp, } from "../../exercise.js";
5
5
  import { getDistinctQuestions } from "../../utils/getDistinctQuestions.js";
6
6
  import { round } from "../../../math/utils/round.js";
7
7
  import { shuffle } from "../../../utils/alea/shuffle.js";
8
8
  import { alignTex } from "../../../utils/latex/alignTex.js";
9
9
  import { numberVEA } from "../../../exercises/vea/numberVEA.js";
10
+ import { random } from "../../../utils/alea/random.js";
10
11
  const getInstruction = (identifiers) => {
11
12
  const { flip, pA, pAB, pA_B, pB, pB_A } = identifiers;
12
13
  let instruction = `On considère deux événements $A$ et $B$ tels que `;
@@ -223,9 +224,18 @@ ${alignTex([
223
224
  }
224
225
  }
225
226
  };
226
- const getConditionalProbability = () => {
227
+ const getConditionalProbability = (opts) => {
227
228
  let pA, pB, pAB, pA_B, pB_A;
228
- const flip = randint(1, 7);
229
+ const types = opts?.probaType ?? ["$P(A)$", "$P(A\\cap B)$", "$P_A(B)$"];
230
+ const flipChoices = [];
231
+ if (types.includes("$P(A)$"))
232
+ flipChoices.push(5, 6);
233
+ if (types.includes("$P(A\\cap B)$"))
234
+ flipChoices.push(3, 4);
235
+ if (types.includes("$P_A(B)$"))
236
+ flipChoices.push(1, 2);
237
+ const flip = random(flipChoices);
238
+ //1,2 = P_AB, 3,4 = PANB, 5,6 = PA
229
239
  switch (flip) {
230
240
  case 1:
231
241
  pA = randint(2, 100);
@@ -259,6 +269,27 @@ const getConditionalProbability = () => {
259
269
  const identifiers = { flip, pA, pAB, pB, pA_B, pB_A };
260
270
  return getQuestionFromIdentifiers(identifiers);
261
271
  };
272
+ const options = [
273
+ {
274
+ id: "probaType",
275
+ label: "Probabilité demandée",
276
+ target: GeneratorOptionTarget.generation,
277
+ type: GeneratorOptionType.multiselect,
278
+ values: ["$P(A)$", "$P(A\\cap B)$", "$P_A(B)$"],
279
+ defaultValue: ["$P(A)$", "$P(A\\cap B)$", "$P_A(B)$"],
280
+ },
281
+ ];
282
+ const validateOptions = (opts) => {
283
+ if (!opts?.probaType?.length)
284
+ return {
285
+ valid: false,
286
+ message: "Veuillez choisir au moins un type de probabilité demandée.",
287
+ };
288
+ return {
289
+ valid: true,
290
+ message: "",
291
+ };
292
+ };
262
293
  const getQuestionFromIdentifiers = (identifiers) => {
263
294
  const question = {
264
295
  instruction: getInstruction(identifiers),
@@ -286,9 +317,9 @@ const isAnswerValid = (ans, { answer }) => {
286
317
  export const conditionalProbability = {
287
318
  id: "conditionalProbability",
288
319
  connector: "=",
289
- label: "Calcul de probabilité conditionnelle avec la formule de Bayes",
320
+ label: "Calcul de probabilité conditionnelle avec la formule de Bayes $P(A \\cap B) = P_A(B) \\times P(A)$",
290
321
  isSingleStep: false,
291
- generator: (nb) => getDistinctQuestions(getConditionalProbability, nb),
322
+ generator: (nb, opts) => getDistinctQuestions(() => getConditionalProbability(opts), nb),
292
323
  qcmTimer: 60,
293
324
  freeTimer: 60,
294
325
  getPropositions,
@@ -296,4 +327,6 @@ export const conditionalProbability = {
296
327
  subject: "Mathématiques",
297
328
  hasHintAndCorrection: true,
298
329
  getQuestionFromIdentifiers,
330
+ options,
331
+ validateOptions,
299
332
  };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ pA: number;
4
+ pB: number;
5
+ pUnion: number;
6
+ };
7
+ export declare const independancy: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=independancy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"independancy.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/independancy/independancy.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAkHF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAc9C,CAAC"}
@@ -0,0 +1,114 @@
1
+ import { addValidProp, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { DecimalConstructor } from "../../../../math/numbers/decimals/decimal.js";
4
+ import { frenchify } from "../../../../math/utils/latex/frenchify.js";
5
+ import { randint } from "../../../../math/utils/random/randint.js";
6
+ import { round } from "../../../../math/utils/round.js";
7
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
8
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
9
+ import { shuffle } from "../../../../utils/alea/shuffle.js";
10
+ const getInstruction = (identifiers) => {
11
+ const { pA, pB, pUnion } = identifiers;
12
+ 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)}$.
13
+
14
+ Les événements $A$ et $B$ sont-ils indépendants ?`;
15
+ };
16
+ const getHint = () => {
17
+ return `Deux évènements $M$ et $N$ sont indépendants si et seulement si :
18
+
19
+ $$
20
+ P(M\\cap N) = P(M)\\times P(N)
21
+ $$
22
+
23
+ D'autre part, on rappelle la formule de l'union :
24
+
25
+ $$
26
+ P(A \\cup B) = P(A) + P(B) - P(A \\cap B)
27
+ $$`;
28
+ };
29
+ const getCorrection = (identifiers) => {
30
+ const { pA, pB, pUnion } = identifiers;
31
+ const isInde = getAnswer(identifiers) === "Oui";
32
+ return `On sait que :
33
+
34
+ $$
35
+ P(A \\cup B) = P(A) + P(B) - P(A \\cap B)
36
+ $$
37
+
38
+ On a donc :
39
+
40
+ $$
41
+ P(A \\cap B) = P(A) + P(B) - P(A \\cup B) = ${round(pA + pB - pUnion, 5).frenchify()}
42
+ $$
43
+
44
+ D'autre part,
45
+
46
+ $$
47
+ P(A)\\times P(B) = ${multiply(pA, pB).toTex()} = ${round(pA * pB, 5).frenchify()}
48
+ $$
49
+
50
+ ${isInde
51
+ ? `Puisque $P(A\\cap B) = P(A)\\times P(B)$, les évènements $A$ et $B$ sont bien indépendants.`
52
+ : `Puisque $P(A\\cap B) \\neq P(A)\\times P(B)$, les évènements $A$ et $B$ ne sont pas indépendants.`}
53
+ `;
54
+ };
55
+ const getAnswer = (identifiers) => {
56
+ const { pA, pB, pUnion } = identifiers;
57
+ return Math.abs(pA + pB - pA * pB - pUnion) < 0.0001 ? "Oui" : "Non";
58
+ };
59
+ const getIndependancyQuestion = () => {
60
+ const pA = DecimalConstructor.random(0, 1, randint(1, 3));
61
+ const pB = DecimalConstructor.random(0, 1, randint(1, 3));
62
+ const areIndependants = coinFlip();
63
+ let pUnion;
64
+ const unionValueIfIndependants = round(pA.value + pB.value - pA.value * pB.value, 5);
65
+ if (areIndependants)
66
+ pUnion = unionValueIfIndependants;
67
+ else {
68
+ let counter = 0;
69
+ do {
70
+ counter++;
71
+ if (counter > 1000)
72
+ throw new Error("Too many iterations in independancy");
73
+ pUnion = DecimalConstructor.random(0, 1, randint(1, 3)).value;
74
+ } while ((pUnion < pA.value && pUnion < pB.value) ||
75
+ pUnion === unionValueIfIndependants ||
76
+ pUnion > pA.value + pB.value);
77
+ }
78
+ const identifiers = { pA: pA.value, pB: pB.value, pUnion };
79
+ return getQuestionFromIdentifiers(identifiers);
80
+ };
81
+ const getQuestionFromIdentifiers = (identifiers) => {
82
+ const question = {
83
+ answer: getAnswer(identifiers),
84
+ instruction: getInstruction(identifiers),
85
+ keys: [],
86
+ answerFormat: "raw",
87
+ identifiers,
88
+ hint: getHint(identifiers),
89
+ correction: getCorrection(identifiers),
90
+ };
91
+ return question;
92
+ };
93
+ const getPropositions = (_n, { answer }) => {
94
+ const propositions = [];
95
+ addValidProp(propositions, answer, "raw");
96
+ tryToAddWrongProp(propositions, "Oui", "raw");
97
+ tryToAddWrongProp(propositions, "Non", "raw");
98
+ tryToAddWrongProp(propositions, "On ne peut pas savoir", "raw");
99
+ return shuffle(propositions);
100
+ };
101
+ export const independancy = {
102
+ id: "independancy",
103
+ connector: "=",
104
+ label: "Déterminer l'indépendance de deux événements en connaissant $P(A)$, $P(B)$ et $P(A\\cup B)$",
105
+ isSingleStep: true,
106
+ generator: (nb) => getDistinctQuestions(getIndependancyQuestion, nb),
107
+ qcmTimer: 60,
108
+ freeTimer: 60,
109
+ getPropositions,
110
+ answerType: "QCU",
111
+ subject: "Mathématiques",
112
+ getQuestionFromIdentifiers,
113
+ hasHintAndCorrection: true,
114
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ pAIds: NodeIdentifiers;
5
+ pBIds: NodeIdentifiers;
6
+ };
7
+ export declare const independancyFindCap: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=independancyFindCap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"independancyFindCap.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/independancy/independancyFindCap.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AAuFF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAkBrD,CAAC"}
@@ -0,0 +1,101 @@
1
+ import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { numberVEA } from "../../../../exercises/vea/numberVEA.js";
4
+ import { randfloat } from "../../../../math/utils/random/randfloat.js";
5
+ import { randint } from "../../../../math/utils/random/randint.js";
6
+ import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
7
+ import { add } from "../../../../tree/nodes/operators/addNode.js";
8
+ import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
9
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
10
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
11
+ const getPropositions = (n, { answer, ...identifiers }) => {
12
+ const propositions = [];
13
+ const { pAIds, pBIds } = identifiers;
14
+ const pA = reifyAlgebraic(pAIds);
15
+ const pB = reifyAlgebraic(pBIds);
16
+ addValidProp(propositions, answer);
17
+ tryToAddWrongProp(propositions, add(pA, pB).simplify().toTex());
18
+ propWhile(propositions, n, () => {
19
+ tryToAddWrongProp(propositions, randfloat(0, 1, randint(1, 3)).frenchify());
20
+ });
21
+ return shuffleProps(propositions, n);
22
+ };
23
+ const getAnswer = (identifiers) => {
24
+ const { pAIds, pBIds } = identifiers;
25
+ const pA = reifyAlgebraic(pAIds);
26
+ const pB = reifyAlgebraic(pBIds);
27
+ return multiply(pA, pB).simplify().toTex();
28
+ };
29
+ const getInstruction = (identifiers) => {
30
+ const { pAIds, pBIds } = identifiers;
31
+ const pA = reifyAlgebraic(pAIds);
32
+ const pB = reifyAlgebraic(pBIds);
33
+ return `On considère deux événements indépendants $A$ et $B$, tels que $P(A) = ${pA.toTex()}$ et $P(B) = ${pB.toTex()}$.
34
+
35
+ Déterminer $P(A\\cap B)$.`;
36
+ };
37
+ const getHint = () => {
38
+ return `Deux événements $A$ et $B$ sont indépendants si et seulement si $P(A)\\times P(B) = P(A\\cap B)$.`;
39
+ };
40
+ const getCorrection = (identifiers) => {
41
+ const { pAIds, pBIds } = identifiers;
42
+ const pA = reifyAlgebraic(pAIds);
43
+ const pB = reifyAlgebraic(pBIds);
44
+ return `Puisque $A$ et $B$ sont indépendants, alors on a :
45
+
46
+ ${alignTex([
47
+ ["P(A\\cap B)", "=", "P(A)\\times P(B)"],
48
+ ["", "=", multiply(pA, pB).toTex()],
49
+ ["", "=", getAnswer(identifiers)],
50
+ ])}
51
+ `;
52
+ };
53
+ const getKeys = () => {
54
+ return [];
55
+ };
56
+ const isAnswerValid = (ans, { answer }) => {
57
+ try {
58
+ return numberVEA(ans, answer);
59
+ }
60
+ catch (err) {
61
+ return handleVEAError(err);
62
+ }
63
+ };
64
+ const getIndependancyFindCapQuestion = () => {
65
+ const pA = randfloat(0, 1, randint(1, 3));
66
+ const pB = randfloat(0, 1, randint(1, 3));
67
+ const identifiers = {
68
+ pAIds: pA.toTree().toIdentifiers(),
69
+ pBIds: pB.toTree().toIdentifiers(),
70
+ };
71
+ return getQuestionFromIdentifiers(identifiers);
72
+ };
73
+ const getQuestionFromIdentifiers = (identifiers) => {
74
+ return {
75
+ answer: getAnswer(identifiers),
76
+ instruction: getInstruction(identifiers),
77
+ keys: getKeys(identifiers),
78
+ answerFormat: "tex",
79
+ identifiers,
80
+ hint: getHint(identifiers),
81
+ correction: getCorrection(identifiers),
82
+ };
83
+ };
84
+ export const independancyFindCap = {
85
+ id: "independancyFindCap",
86
+ connector: "=",
87
+ label: "Calculer l'intersection de deux événements indépendants",
88
+ isSingleStep: true,
89
+ generator: (nb, opts) => getDistinctQuestions(() => getIndependancyFindCapQuestion(opts), nb),
90
+ qcmTimer: 60,
91
+ freeTimer: 60,
92
+ getPropositions,
93
+ isAnswerValid,
94
+ subject: "Mathématiques",
95
+ getInstruction,
96
+ getHint,
97
+ getCorrection,
98
+ getAnswer,
99
+ getQuestionFromIdentifiers,
100
+ hasHintAndCorrection: true,
101
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
3
+ type Identifiers = {
4
+ pAIds: NodeIdentifiers;
5
+ pBIds: NodeIdentifiers;
6
+ };
7
+ export declare const independancyFindCup: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=independancyFindCup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"independancyFindCup.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/independancy/independancyFindCup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAO7C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;CACxB,CAAC;AAuGF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAkBrD,CAAC"}