math-exercises 3.0.157 → 3.0.159
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/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 +445 -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 +371 -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.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +8 -2
- package/lib/exercises/math/calculLitteral/equation/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/index.js +1 -0
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/multiplicationEquation.js +27 -2
- package/lib/exercises/math/calculLitteral/equation/solveByFactorizingWithIdRmq3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/solveByFactorizingWithIdRmq3.js +0 -1
- package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/square/equationSquareWithSteps.js +0 -1
- 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 +444 -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/calculLitteral/inequations/firstDegreeInequationsType3.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/firstDegreeInequationsType3.js +11 -5
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts +1 -0
- package/lib/exercises/math/calculLitteral/inequations/index.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/inequations/index.js +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeFour.js +91 -21
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +64 -15
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeThree.js +71 -15
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeTwo.js +36 -17
- 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 +294 -0
- package/lib/exercises/math/derivation/derivative/exp/index.d.ts +1 -0
- package/lib/exercises/math/derivation/derivative/exp/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/index.js +1 -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/derivation/variations/index.d.ts +1 -0
- package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/index.js +1 -0
- package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.d.ts +7 -0
- package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/readExtremaAbscissFromDerivativeCurve.js +174 -0
- 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 +305 -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 +216 -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 +223 -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 +262 -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 +245 -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 +366 -0
- package/lib/exercises/math/functions/exponential/expFactorization.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expFactorization.js +54 -42
- package/lib/exercises/math/functions/exponential/index.d.ts +2 -0
- package/lib/exercises/math/functions/exponential/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/index.js +2 -0
- 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/equation/secondDegreeInequation.js +3 -0
- 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 +96 -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 +190 -0
- package/lib/exercises/math/functions/variations/index.d.ts +1 -0
- package/lib/exercises/math/functions/variations/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/index.js +1 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts +12 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.js +230 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts +10 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPointAndNormalVector.js +167 -0
- package/lib/exercises/math/geometry/cartesian/index.d.ts +3 -0
- package/lib/exercises/math/geometry/cartesian/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/index.js +3 -0
- package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts +10 -0
- package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/cartesian/normalVectorFromCartesianLineEquation.js +131 -0
- package/lib/exercises/math/geometry/circles/index.d.ts +2 -0
- package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/index.js +1 -0
- package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts +11 -0
- package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.d.ts.map +1 -0
- package/lib/exercises/math/geometry/circles/isPointOnCircleFromCartesianEquation.js +131 -0
- package/lib/exercises/math/geometry/euclidian/pinPointFromAxialOrCentralSymmetry.js +2 -2
- package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidian/pinSegmentFromRotation.js +0 -2
- package/lib/exercises/math/geometry/index.d.ts +1 -0
- package/lib/exercises/math/geometry/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/index.js +1 -0
- 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/alKashi/index.d.ts +4 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/index.js +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +247 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts +13 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +452 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +253 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts +4 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/index.js +3 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts +10 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductIdentities.js +174 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.js +231 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts +14 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.js +292 -0
- 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/orth/index.d.ts +6 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/index.js +5 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.js +202 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts +9 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.js +127 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js +167 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.js +180 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.js +235 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts +12 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +423 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts +17 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.js +347 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts +8 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts.map +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.js +301 -0
- 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/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/findValueForFairRandomVariable.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +141 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts +10 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueToMatchRandomVariableAverage.js +174 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/index.js +2 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.js +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.js +7 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceProbas.js +7 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/numberPoolTwiceProbas.js +7 -0
- package/lib/exercises/math/probaStat/twoStepExperiments/twoStepExperimentProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/twoStepExperiments/twoStepExperimentProbas.js +7 -0
- 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/generation/index.d.ts +2 -0
- package/lib/exercises/math/sequences/generation/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/generation/index.js +1 -0
- package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts +8 -0
- package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.d.ts.map +1 -0
- package/lib/exercises/math/sequences/generation/recognizeRecurrenceOrExplicit.js +63 -0
- 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/graph/index.d.ts +2 -0
- package/lib/exercises/math/sequences/graph/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/graph/index.js +1 -0
- package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts +11 -0
- package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.d.ts.map +1 -0
- package/lib/exercises/math/sequences/graph/placeFirstSequencePoints.js +113 -0
- package/lib/exercises/math/sequences/index.d.ts +2 -0
- package/lib/exercises/math/sequences/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/index.js +2 -0
- package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts +12 -0
- package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.d.ts.map +1 -0
- package/lib/exercises/math/sequences/notation/identifyRankInSequenceTermsList.js +114 -0
- package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts +12 -0
- package/lib/exercises/math/sequences/notation/identifySequenceTermInList.d.ts.map +1 -0
- package/lib/exercises/math/sequences/notation/identifySequenceTermInList.js +111 -0
- package/lib/exercises/math/sequences/notation/index.d.ts +3 -0
- package/lib/exercises/math/sequences/notation/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/notation/index.js +2 -0
- 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/basis/findSpacePointOnRectangularPrism.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/basis/findSpacePointOnRectangularPrism.js +0 -1
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.d.ts.map +1 -1
- package/lib/exercises/math/spaceGeometry/sphere/sphereLatLonReading.2d.js +0 -2
- 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/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/cartesianLineVEA.d.ts +2 -0
- package/lib/exercises/vea/cartesianLineVEA.d.ts.map +1 -0
- package/lib/exercises/vea/cartesianLineVEA.js +1 -0
- package/lib/index.d.ts +186 -27
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/line.d.ts +2 -0
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +7 -0
- package/lib/math/geometry/point.d.ts +1 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +5 -0
- package/lib/math/geometry/polygons/relationPP.d.ts +8 -0
- package/lib/math/geometry/polygons/relationPP.d.ts.map +1 -0
- package/lib/math/geometry/polygons/relationPP.js +41 -0
- 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/math/polynomials/trinom.d.ts +1 -1
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +15 -6
- package/lib/math/utils/arithmetic/primeFactors.js +1 -1
- package/lib/math/utils/geometry/randomVecs2.d.ts +6 -0
- package/lib/math/utils/geometry/randomVecs2.d.ts.map +1 -0
- package/lib/math/utils/geometry/randomVecs2.js +34 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +3 -1
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +2 -2
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +1 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +3 -0
- package/lib/tree/nodes/functions/expNode.d.ts +1 -1
- package/lib/tree/nodes/functions/expNode.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/inequations/inequationSolutionNode.d.ts +1 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +3 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +6 -4
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/tree/nodes/sets/intervalNode.d.ts +6 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/namedIntervalNode.d.ts +31 -0
- package/lib/tree/nodes/sets/namedIntervalNode.d.ts.map +1 -0
- package/lib/tree/nodes/sets/namedIntervalNode.js +77 -0
- package/package.json +1 -1
|
@@ -3,13 +3,47 @@ import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinct
|
|
|
3
3
|
import { mainTrigoValues, remarkableTrigoValues, } from "../../../../../math/trigonometry/remarkableValues.js";
|
|
4
4
|
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
5
5
|
import { NumberNode } from "../../../../../tree/nodes/numbers/numberNode.js";
|
|
6
|
-
import { MultiplyNode } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
6
|
+
import { multiply, MultiplyNode, } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
7
|
import { randomLetter } from "../../../../../utils/strings/randomLetter.js";
|
|
8
8
|
import { shuffle } from "../../../../../utils/alea/shuffle.js";
|
|
9
9
|
import { random } from "../../../../../utils/alea/random.js";
|
|
10
10
|
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
11
11
|
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
12
|
+
import { alignTex } from "../../../../../utils/latex/alignTex.js";
|
|
13
|
+
import { cos } from "../../../../../tree/nodes/functions/cosNode.js";
|
|
12
14
|
//|u| |v| cos(u,v)
|
|
15
|
+
const getHint = () => {
|
|
16
|
+
return `Utilise la formule du produit scalaire suivante :
|
|
17
|
+
|
|
18
|
+
$$
|
|
19
|
+
\\overrightarrow{u}\\cdot \\overrightarrow{v} = ||\\overrightarrow{u}|| \\times ||\\overrightarrow{v}||\\times \\cos(\\widehat{\\overrightarrow{u}, \\overrightarrow{v}})
|
|
20
|
+
$$`;
|
|
21
|
+
};
|
|
22
|
+
const getCorrection = (identifiers) => {
|
|
23
|
+
const { AB, AC, trigoPoint, letters } = identifiers;
|
|
24
|
+
const trigo = mainTrigoValues.find((v) => v.point === trigoPoint);
|
|
25
|
+
const [letterA, letterB, letterC] = letters;
|
|
26
|
+
const u = letterA + letterB;
|
|
27
|
+
const v = letterA + letterC;
|
|
28
|
+
return `Utilise la formule du produit scalaire suivante :
|
|
29
|
+
|
|
30
|
+
$$
|
|
31
|
+
\\overrightarrow{u}\\cdot \\overrightarrow{v} = ||\\overrightarrow{u}|| \\times ||\\overrightarrow{v}||\\times \\cos(\\widehat{\\overrightarrow{u}, \\overrightarrow{v}})
|
|
32
|
+
$$
|
|
33
|
+
|
|
34
|
+
Ici, on a donc :
|
|
35
|
+
|
|
36
|
+
${alignTex([
|
|
37
|
+
[
|
|
38
|
+
`\\overrightarrow{${u}}\\cdot \\overrightarrow{${v}}`,
|
|
39
|
+
"=",
|
|
40
|
+
`${u}\\times ${v}\\times \\cos\\left(${letterB}${letterA}${letterC}\\right)`,
|
|
41
|
+
],
|
|
42
|
+
["", "=", multiply(multiply(AB, AC), cos(trigo.angle)).toTex()],
|
|
43
|
+
["", "=", multiply(multiply(AB, AC), trigo.cos).toTex()],
|
|
44
|
+
["", "=", getAnswer(identifiers)],
|
|
45
|
+
])}`;
|
|
46
|
+
};
|
|
13
47
|
const getInstruction = (identifiers) => {
|
|
14
48
|
const { AB, AC, trigoPoint, letters } = identifiers;
|
|
15
49
|
const [letterA, letterB, letterC] = letters;
|
|
@@ -45,6 +79,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
45
79
|
keys: ["pi"],
|
|
46
80
|
answerFormat: "tex",
|
|
47
81
|
identifiers,
|
|
82
|
+
hint: getHint(identifiers),
|
|
83
|
+
correction: getCorrection(identifiers),
|
|
48
84
|
};
|
|
49
85
|
return question;
|
|
50
86
|
};
|
|
@@ -83,4 +119,5 @@ export const scalarProductViaCos = {
|
|
|
83
119
|
getInstruction,
|
|
84
120
|
getAnswer,
|
|
85
121
|
getQuestionFromIdentifiers,
|
|
122
|
+
hasHintAndCorrection: true,
|
|
86
123
|
};
|
|
@@ -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"}
|
|
@@ -0,0 +1,118 @@
|
|
|
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 { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
10
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
11
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
12
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
13
|
+
const propositions = [];
|
|
14
|
+
const { pAIds, pBIds } = identifiers;
|
|
15
|
+
const pA = reifyAlgebraic(pAIds);
|
|
16
|
+
const pB = reifyAlgebraic(pBIds);
|
|
17
|
+
addValidProp(propositions, answer);
|
|
18
|
+
tryToAddWrongProp(propositions, multiply(pA, pB).simplify().toTex());
|
|
19
|
+
propWhile(propositions, n, () => {
|
|
20
|
+
tryToAddWrongProp(propositions, randfloat(0, 1, randint(1, 3)).frenchify());
|
|
21
|
+
});
|
|
22
|
+
return shuffleProps(propositions, n);
|
|
23
|
+
};
|
|
24
|
+
const getAnswer = (identifiers) => {
|
|
25
|
+
const { pAIds, pBIds } = identifiers;
|
|
26
|
+
const pA = reifyAlgebraic(pAIds);
|
|
27
|
+
const pB = reifyAlgebraic(pBIds);
|
|
28
|
+
return substract(add(pA, pB), multiply(pA, pB)).simplify().toTex();
|
|
29
|
+
};
|
|
30
|
+
const getInstruction = (identifiers) => {
|
|
31
|
+
const { pAIds, pBIds } = identifiers;
|
|
32
|
+
const pA = reifyAlgebraic(pAIds);
|
|
33
|
+
const pB = reifyAlgebraic(pBIds);
|
|
34
|
+
return `On considère deux événements indépendants $A$ et $B$, tels que $P(A) = ${pA.toTex()}$ et $P(B) = ${pB.toTex()}$.
|
|
35
|
+
|
|
36
|
+
Déterminer $P(A\\cup B)$.`;
|
|
37
|
+
};
|
|
38
|
+
const getHint = () => {
|
|
39
|
+
return `Deux événements $A$ et $B$ sont indépendants si et seulement si $P(A)\\times P(B) = P(A\\cap B)$.
|
|
40
|
+
|
|
41
|
+
D'autre part, on rappelle la formule de l'union :
|
|
42
|
+
|
|
43
|
+
$$
|
|
44
|
+
P(A \\cup B) = P(A) + P(B) - P(A \\cap B)
|
|
45
|
+
$$`;
|
|
46
|
+
};
|
|
47
|
+
const getCorrection = (identifiers) => {
|
|
48
|
+
const { pAIds, pBIds } = identifiers;
|
|
49
|
+
const pA = reifyAlgebraic(pAIds);
|
|
50
|
+
const pB = reifyAlgebraic(pBIds);
|
|
51
|
+
const pAB = multiply(pA, pB);
|
|
52
|
+
const pABSimp = pAB.simplify();
|
|
53
|
+
return `Puisque $A$ et $B$ sont indépendants, alors on a :
|
|
54
|
+
|
|
55
|
+
${alignTex([
|
|
56
|
+
["P(A\\cap B)", "=", "P(A)\\times P(B)"],
|
|
57
|
+
["", "=", pAB.toTex()],
|
|
58
|
+
["", "=", pABSimp.toTex()],
|
|
59
|
+
])}
|
|
60
|
+
|
|
61
|
+
On utilise ensuite la formule de l'union :
|
|
62
|
+
|
|
63
|
+
${alignTex([
|
|
64
|
+
["P(A \\cup B)", "=", "P(A) + P(B) - P(A \\cap B)"],
|
|
65
|
+
["", "=", substract(add(pA, pB), pABSimp).toTex()],
|
|
66
|
+
["", "=", substract(add(pA, pB), pABSimp).simplify().toTex()],
|
|
67
|
+
])}
|
|
68
|
+
`;
|
|
69
|
+
};
|
|
70
|
+
const getKeys = () => {
|
|
71
|
+
return [];
|
|
72
|
+
};
|
|
73
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
74
|
+
try {
|
|
75
|
+
return numberVEA(ans, answer);
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
return handleVEAError(err);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const getIndependancyFindCupQuestion = () => {
|
|
82
|
+
const pA = randfloat(0, 1, randint(1, 3));
|
|
83
|
+
const pB = randfloat(0, 1, randint(1, 3));
|
|
84
|
+
const identifiers = {
|
|
85
|
+
pAIds: pA.toTree().toIdentifiers(),
|
|
86
|
+
pBIds: pB.toTree().toIdentifiers(),
|
|
87
|
+
};
|
|
88
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
89
|
+
};
|
|
90
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
91
|
+
return {
|
|
92
|
+
answer: getAnswer(identifiers),
|
|
93
|
+
instruction: getInstruction(identifiers),
|
|
94
|
+
keys: getKeys(identifiers),
|
|
95
|
+
answerFormat: "tex",
|
|
96
|
+
identifiers,
|
|
97
|
+
hint: getHint(identifiers),
|
|
98
|
+
correction: getCorrection(identifiers),
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
export const independancyFindCup = {
|
|
102
|
+
id: "independancyFindCup",
|
|
103
|
+
connector: "=",
|
|
104
|
+
label: "Calculer l'union de deux événements indépendants",
|
|
105
|
+
isSingleStep: true,
|
|
106
|
+
generator: (nb, opts) => getDistinctQuestions(() => getIndependancyFindCupQuestion(opts), nb),
|
|
107
|
+
qcmTimer: 60,
|
|
108
|
+
freeTimer: 60,
|
|
109
|
+
getPropositions,
|
|
110
|
+
isAnswerValid,
|
|
111
|
+
subject: "Mathématiques",
|
|
112
|
+
getInstruction,
|
|
113
|
+
getHint,
|
|
114
|
+
getCorrection,
|
|
115
|
+
getAnswer,
|
|
116
|
+
getQuestionFromIdentifiers,
|
|
117
|
+
hasHintAndCorrection: true,
|
|
118
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/independancy/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
pABIds: NodeIdentifiers;
|
|
7
|
+
};
|
|
8
|
+
export declare const isIndependantFromDefinition: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=isIndependantFromDefinition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isIndependantFromDefinition.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/independancy/isIndependantFromDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,eAAe,CAAC;IACvB,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AA8FF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,CAqB7D,CAAC"}
|