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.
- package/lib/exercises/exercise.d.ts +7 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/proportionality/proportionalityTableCoefficient.js +1 -1
- package/lib/exercises/math/calculLitteral/equation/exp/expOfAffineEquals1Equation.d.ts +14 -0
- package/lib/exercises/math/calculLitteral/equation/exp/expOfAffineEquals1Equation.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/exp/expOfAffineEquals1Equation.js +145 -0
- package/lib/exercises/math/calculLitteral/equation/exp/expOfFEqualsExpOfGEquation.d.ts +16 -0
- package/lib/exercises/math/calculLitteral/equation/exp/expOfFEqualsExpOfGEquation.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/exp/expOfFEqualsExpOfGEquation.js +444 -0
- package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.d.ts +15 -0
- package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/exp/expOfTrinomEquals1Equation.js +292 -0
- package/lib/exercises/math/calculLitteral/equation/exp/index.d.ts +4 -0
- package/lib/exercises/math/calculLitteral/equation/exp/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/equation/exp/index.js +3 -0
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts +4 -1
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +148 -31
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts +4 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +124 -44
- package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.d.ts +18 -0
- package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/inequations/exp/expOfFEqualsExpOfGInequation.js +437 -0
- package/lib/exercises/math/calculLitteral/inequations/exp/index.d.ts +2 -0
- package/lib/exercises/math/calculLitteral/inequations/exp/index.d.ts.map +1 -0
- package/lib/exercises/math/calculLitteral/inequations/exp/index.js +1 -0
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/halfPieChartCommenting.js +4 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +29 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +35 -2
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +19 -0
- package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.d.ts +10 -0
- package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expOverExpDerivative.js +282 -0
- package/lib/exercises/math/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/inverseFunctionDerivative.js +30 -2
- package/lib/exercises/math/derivation/derivative/productDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/productDerivative.js +68 -1
- package/lib/exercises/math/derivation/derivative/quotientDerivative.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/quotientDerivative.js +40 -4
- package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/sqrt/sqrtCompositionDerivation.js +30 -3
- package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeAlgebraicExpression.d.ts +12 -0
- package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeAlgebraicExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeAlgebraicExpression.js +127 -0
- package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromAlgebraic.d.ts +13 -0
- package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromAlgebraic.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromAlgebraic.js +161 -0
- package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromImages.d.ts +11 -0
- package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromImages.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/averageRateOfChangeFromImages.js +116 -0
- package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberCalcul.d.ts +8 -0
- package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberCalcul.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberCalcul.js +142 -0
- package/lib/exercises/math/derivation/derivativeNumber/index.d.ts +4 -0
- package/lib/exercises/math/derivation/derivativeNumber/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/index.js +4 -0
- package/lib/exercises/math/derivation/index.d.ts +1 -1
- package/lib/exercises/math/derivation/index.js +1 -1
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/drawAffineFromPointAndLeadingCoeff.js +5 -4
- package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.d.ts +13 -0
- package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.js +278 -0
- package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.d.ts +11 -0
- package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/algebraic/approxExpKa.js +211 -0
- package/lib/exercises/math/functions/exponential/algebraic/approxExpN.d.ts +9 -0
- package/lib/exercises/math/functions/exponential/algebraic/approxExpN.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/algebraic/approxExpN.js +142 -0
- package/lib/exercises/math/functions/exponential/algebraic/index.d.ts +5 -0
- package/lib/exercises/math/functions/exponential/algebraic/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/algebraic/index.js +4 -0
- package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.d.ts +14 -0
- package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.js +337 -0
- package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.d.ts +11 -0
- package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/definition/approxExpAPlusH.js +234 -0
- package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.d.ts +9 -0
- package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/definition/expAntecedentFromGraph.js +190 -0
- package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.d.ts +9 -0
- package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/definition/expImageFromGraph.js +190 -0
- package/lib/exercises/math/functions/exponential/definition/index.d.ts +5 -0
- package/lib/exercises/math/functions/exponential/definition/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/definition/index.js +4 -0
- package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.d.ts +13 -0
- package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/definition/isPlausibleExpFromGraph.js +375 -0
- package/lib/exercises/math/functions/linear/linearFromExercise.d.ts.map +1 -1
- package/lib/exercises/math/functions/linear/linearFromExercise.js +4 -3
- package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/devForm/coefficientsIdentification.js +30 -3
- package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/deltaTrinom.js +35 -1
- package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/parabole/paraboleExpressionReading.js +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaInCanonicalForm.js +23 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumFromCanonicalForm.js +29 -0
- package/lib/exercises/math/functions/variations/exp/index.d.ts +3 -0
- package/lib/exercises/math/functions/variations/exp/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/variations/exp/index.js +2 -0
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.d.ts +9 -0
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.d.ts.map +1 -0
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusB.js +101 -0
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.d.ts +11 -0
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.d.ts.map +1 -0
- package/lib/exercises/math/functions/variations/exp/varOfAEXPlusBOverCEXPlusD.js +192 -0
- package/lib/exercises/math/geometry/euclidian/pinPointFromAxialOrCentralSymmetry.js +2 -2
- package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.js +1 -1
- package/lib/exercises/math/geometry/euclidian/recognizeHomothetyCenter.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/recognizeHomothetyCenter.js +4 -5
- package/lib/exercises/math/geometry/euclidianConstructions/placeHomothetyCenter.js +4 -4
- package/lib/exercises/math/geometry/perimeters/circleCircumference.d.ts.map +1 -1
- package/lib/exercises/math/geometry/perimeters/circleCircumference.js +5 -3
- package/lib/exercises/math/geometry/thales/thales.js +1 -1
- package/lib/exercises/math/geometry/thales/thalesCalcul.js +1 -1
- package/lib/exercises/math/geometry/vectors/colinearity/determinant.js +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/findCoordinatesToOrthogonalize.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/findCoordinatesToOrthogonalize.js +33 -7
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCoords.js +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductViaCos.js +38 -1
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/parallelepipedVolume.js +18 -5
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithSquareOrRectBase.js +45 -21
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleBase.js +33 -12
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfPyramidWithTriangleRectBase.js +38 -15
- package/lib/exercises/math/percent/findTVA.d.ts.map +1 -1
- package/lib/exercises/math/percent/findTVA.js +17 -11
- package/lib/exercises/math/percent/populationEffectifFromSubPopulation.js +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/basicProbas/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/index.js +1 -1
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableSituations.js +114 -20
- package/lib/exercises/math/probaStat/basicProbas/pickEquiprobableTo.js +2 -2
- package/lib/exercises/math/probaStat/conditionalProbability.d.ts +4 -1
- package/lib/exercises/math/probaStat/conditionalProbability.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/conditionalProbability.js +38 -5
- package/lib/exercises/math/probaStat/independancy/independancy.d.ts +9 -0
- package/lib/exercises/math/probaStat/independancy/independancy.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/independancy/independancy.js +114 -0
- package/lib/exercises/math/probaStat/independancy/independancyFindCap.d.ts +9 -0
- package/lib/exercises/math/probaStat/independancy/independancyFindCap.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/independancy/independancyFindCap.js +101 -0
- package/lib/exercises/math/probaStat/independancy/independancyFindCup.d.ts +9 -0
- package/lib/exercises/math/probaStat/independancy/independancyFindCup.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/independancy/independancyFindCup.js +118 -0
- package/lib/exercises/math/probaStat/independancy/index.d.ts +5 -0
- package/lib/exercises/math/probaStat/independancy/index.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/independancy/index.js +4 -0
- package/lib/exercises/math/probaStat/independancy/isIndependantFromDefinition.d.ts +10 -0
- package/lib/exercises/math/probaStat/independancy/isIndependantFromDefinition.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/independancy/isIndependantFromDefinition.js +106 -0
- package/lib/exercises/math/probaStat/index.d.ts +1 -1
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.js +1 -1
- package/lib/exercises/math/probaStat/stats1var/etendueTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/etendueTable.js +5 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithList.js +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithTable.js +19 -5
- package/lib/exercises/math/probaStat/stats1var/plausibilityOfAverage.js +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.js +41 -29
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.js +10 -3
- package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.js +9 -2
- package/lib/exercises/math/probaStat/twoStepExperiments/twoStepExperimentProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/twoStepExperimentProbas.js +25 -10
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFirstTermRandom.d.ts +9 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFirstTermRandom.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFirstTermRandom.js +118 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindRandomTermFromTwoTerms.js +55 -6
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindReasonRandomRange.js +42 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFirstTermsSum.d.ts +4 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFirstTermsSum.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFirstTermsSum.js +57 -7
- package/lib/exercises/math/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +24 -2
- package/lib/exercises/math/sequences/arithmetic/arithmeticThresholdFind.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticThresholdFind.js +31 -8
- package/lib/exercises/math/sequences/arithmetic/index.d.ts +1 -1
- package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/index.js +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromGraph.js +11 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.js +5 -5
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.js +3 -1
- package/lib/exercises/math/sequences/geometric/geometricFindReason.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindReason.js +41 -2
- package/lib/exercises/math/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricRecurrenceFormulaUsage.js +28 -2
- package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/sequenceEvaluation.js +22 -2
- package/lib/exercises/math/spaceGeometry/solids/recognizeSolidFromSolidPattern.js +1 -1
- package/lib/exercises/math/spaceGeometry/sphere/index.d.ts +2 -0
- package/lib/exercises/math/spaceGeometry/sphere/index.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/sphere/index.js +3 -1
- package/lib/exercises/math/spaceGeometry/sphere/pinPointLatLon.2d.d.ts +12 -0
- package/lib/exercises/math/spaceGeometry/sphere/pinPointLatLon.2d.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sphere/pinPointLatLon.2d.js +205 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts +13 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +215 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.3d.d.ts +14 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.3d.d.ts.map +1 -0
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.3d.js +390 -0
- package/lib/exercises/math/trigonometry/circle/areReelsOnTheSameTrigoCirclePoint.d.ts +9 -0
- package/lib/exercises/math/trigonometry/circle/areReelsOnTheSameTrigoCirclePoint.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/areReelsOnTheSameTrigoCirclePoint.js +107 -0
- package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts +10 -0
- package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/associatePoint.js +86 -0
- package/lib/exercises/math/trigonometry/circle/associateReelToTrigoCirclePoint.d.ts +10 -0
- package/lib/exercises/math/trigonometry/circle/associateReelToTrigoCirclePoint.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/associateReelToTrigoCirclePoint.js +205 -0
- package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.d.ts +7 -0
- package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/findAngleFromCosAndSin.js +121 -0
- package/lib/exercises/math/trigonometry/circle/index.d.ts +7 -0
- package/lib/exercises/math/trigonometry/circle/index.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/index.js +7 -0
- package/lib/exercises/math/trigonometry/circle/mainAngleMeasure.d.ts +10 -0
- package/lib/exercises/math/trigonometry/circle/mainAngleMeasure.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/mainAngleMeasure.js +100 -0
- package/lib/exercises/math/trigonometry/circle/mainRemarkableValues.d.ts +8 -0
- package/lib/exercises/math/trigonometry/circle/mainRemarkableValues.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/mainRemarkableValues.js +97 -0
- package/lib/exercises/math/trigonometry/circle/remarkableValues.d.ts +10 -0
- package/lib/exercises/math/trigonometry/circle/remarkableValues.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/remarkableValues.js +112 -0
- package/lib/exercises/math/trigonometry/functions/basicEquationCos.d.ts +7 -0
- package/lib/exercises/math/trigonometry/functions/basicEquationCos.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/functions/basicEquationCos.js +92 -0
- package/lib/exercises/math/trigonometry/functions/basicEquationSin.d.ts +7 -0
- package/lib/exercises/math/trigonometry/functions/basicEquationSin.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/functions/basicEquationSin.js +104 -0
- package/lib/exercises/math/trigonometry/functions/basicTrigoSystemEquation.d.ts +7 -0
- package/lib/exercises/math/trigonometry/functions/basicTrigoSystemEquation.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/functions/basicTrigoSystemEquation.js +83 -0
- package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.d.ts +8 -0
- package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/functions/equationCosOnRandomInterval.js +111 -0
- package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.d.ts +8 -0
- package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.js +101 -0
- package/lib/exercises/math/trigonometry/functions/index.d.ts +6 -0
- package/lib/exercises/math/trigonometry/functions/index.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/functions/index.js +6 -0
- package/lib/exercises/math/trigonometry/functions/trigoAssociateAngle.d.ts +9 -0
- package/lib/exercises/math/trigonometry/functions/trigoAssociateAngle.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/functions/trigoAssociateAngle.js +151 -0
- package/lib/exercises/math/trigonometry/index.d.ts +3 -14
- package/lib/exercises/math/trigonometry/index.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/index.js +3 -14
- package/lib/exercises/math/trigonometry/triangle/index.d.ts +7 -0
- package/lib/exercises/math/trigonometry/triangle/index.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/triangle/index.js +6 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometry.d.ts +10 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometry.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometry.js +207 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometryAngleCalcul.d.ts +10 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometryAngleCalcul.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometryAngleCalcul.js +174 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySideCalcul.d.ts +11 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySideCalcul.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySideCalcul.js +224 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySideName.d.ts +13 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySideName.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySideName.js +189 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.d.ts +13 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.js +290 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaUse.d.ts +18 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaUse.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaUse.js +386 -0
- package/lib/exercises/math/trigonometry/trigonometrySideCalcul.js +1 -1
- package/lib/exercises/pc/mathExosInPC.d.ts +2 -2
- package/lib/exercises/pc/mathExosInPC.d.ts.map +1 -1
- package/lib/exercises/pc/mathExosInPC.js +2 -2
- package/lib/exercises/vea/setVEA.d.ts.map +1 -1
- package/lib/exercises/vea/setVEA.js +4 -0
- package/lib/index.d.ts +87 -29
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/segment.d.ts +1 -1
- package/lib/math/geometry/vector.d.ts +2 -1
- package/lib/math/geometry/vector.d.ts.map +1 -1
- package/lib/math/geometry/vector.js +1 -1
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.js +2 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +3 -1
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts +2 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +17 -6
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/utils/arrays/dichoFilter.d.ts +2 -0
- package/lib/utils/arrays/dichoFilter.d.ts.map +1 -0
- package/lib/utils/arrays/dichoFilter.js +11 -0
- package/package.json +1 -1
|
@@ -1,14 +1,64 @@
|
|
|
1
|
-
import { addValidProp,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
49
|
-
const
|
|
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 <
|
|
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
|
|
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
|
-
|
|
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,
|
|
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
|
|
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 @@
|
|
|
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"}
|