math-exercises 3.0.171 → 3.0.173
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/math/derivation/variations/signVarTable3dDegree.js +38 -10
- package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.js +7 -4
- package/lib/exercises/math/derivation/variations/signVarTableFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableFromGraph.js +2 -3
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +12 -0
- package/lib/exercises/math/functions/trinoms/parabole/index.d.ts +2 -0
- package/lib/exercises/math/functions/trinoms/parabole/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/parabole/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.d.ts +8 -0
- package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/parabole/parabolaVarTable.js +106 -0
- package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.d.ts +14 -0
- package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.js +186 -0
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts +6 -2
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/summitAndCanonical/extremumTypeFromAlgebricForm.js +98 -13
- package/lib/exercises/math/functions/variations/partialVarTableFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/partialVarTableFromGraph.js +2 -1
- package/lib/exercises/math/functions/variations/varTableFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/varTableFromGraph.js +2 -1
- package/lib/exercises/math/functions/variations/varTableFromSentences.d.ts.map +1 -1
- package/lib/exercises/math/functions/variations/varTableFromSentences.js +2 -1
- package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/circles/circleCenterAndRadiusFromEquation.js +0 -2
- package/lib/exercises/math/geometry/lines/index.d.ts +1 -0
- package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/lines/index.js +1 -0
- package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.d.ts +13 -0
- package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.d.ts.map +1 -0
- package/lib/exercises/math/geometry/lines/readLineNormalVectorOnGraph.js +195 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiAngle.js +64 -60
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts +1 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +173 -47
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiSideLength.js +112 -46
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductInOrthonormalBasisIJ.js +6 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alg/scalarProductLamdbaULambdaV.js +60 -82
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/angleFromScalarProduct.js +92 -6
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts +6 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/index.js +6 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsBasisIJ.js +6 -0
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsOrthogonalVecsUsingCoords.js +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnCircle.js +15 -5
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsPointOnPerpendicularBisector.js +18 -14
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/orth/scalarProductIsRightTriangleUsingPointCoords.js +15 -5
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +38 -4
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOfVectsOnGrid1.js +77 -26
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductParallelogramDiagonalPlus.js +6 -7
- package/lib/exercises/math/probaStat/basicProbas/calculateProbaFromProbaLaw.js +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +3 -16
- package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts +14 -0
- package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.js +167 -0
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +29 -56
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/index.js +9 -0
- package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/isTableProbabilityLaw.js +6 -6
- package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/missingValueInRandomVariableProbabilityLaw.js +119 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableAverage.js +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableFindMissingProbabilityInLaw.js +116 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts +11 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.js +112 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.js +176 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.js +94 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts +9 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +162 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.js +133 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.js +211 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts +8 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.js +113 -0
- package/lib/exercises/math/probaStat/randomVariable/randomVariableStandardDeviation.js +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableVariance.js +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.d.ts +31 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/buildVAOfGivenAverage.js +192 -0
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts +40 -11
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +172 -30
- package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithList.js +16 -2
- package/lib/exercises/math/python/sequences/index.d.ts +8 -0
- package/lib/exercises/math/python/sequences/index.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/index.js +7 -0
- package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.d.ts +11 -0
- package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceFactorialInstructionFalseOneOut.js +274 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.d.ts +12 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsListInstructionCompletion.js +368 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.d.ts +13 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceFirstTermsSumInstructionCompletion.js +254 -0
- package/lib/exercises/math/python/sequences/pySequenceProgramReading.d.ts +14 -0
- package/lib/exercises/math/python/sequences/pySequenceProgramReading.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceProgramReading.js +365 -0
- package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.d.ts +11 -0
- package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceTermForLoopInstructionCompletion.js +298 -0
- package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.d.ts +12 -0
- package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceTermFromFunctionCallInstructionCompletion.js +408 -0
- package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts +17 -0
- package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.d.ts.map +1 -0
- package/lib/exercises/math/python/sequences/pySequenceThresholdInstructionCompletion.js +498 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts +12 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.js +191 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindExplicitFormulaFromSituation.js +153 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +184 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.js +210 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindTermFromSituation.js +161 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts +17 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.js +188 -0
- package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts +6 -0
- package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/situations/index.js +5 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts +15 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticComputeSumWithDots.js +233 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.d.ts +13 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSum.js +111 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.d.ts +13 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/arithmeticFirstTermsSumThreshold.js +216 -0
- package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.d.ts +7 -0
- package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/firstIntegersSum.js +94 -0
- package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts +5 -0
- package/lib/exercises/math/sequences/arithmetic/sum/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/sum/index.js +4 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.js +301 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +260 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.js +186 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRankFromSituation.js +142 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindRecurrenceFormulaFromSituation.js +205 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindTermFromSituation.js +208 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.d.ts +17 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/geometricFindThresholdFromSituation.js +152 -0
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts +4 -0
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/situations/index.js +5 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.d.ts +15 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricComputeSumWithDots.js +248 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsGeneralSum.js +126 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.d.ts +8 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/geometricFirstTermsSum.js +91 -0
- package/lib/exercises/math/sequences/geometric/sum/index.d.ts +4 -0
- package/lib/exercises/math/sequences/geometric/sum/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/sum/index.js +3 -0
- package/lib/exercises/math/sequences/seqArithmGeom/index.d.ts +2 -0
- package/lib/exercises/math/sequences/seqArithmGeom/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/seqArithmGeom/index.js +1 -0
- package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts +14 -0
- package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.d.ts.map +1 -0
- package/lib/exercises/math/sequences/seqArithmGeom/seqArithmGeomRecurrenceFormulaUsage.js +202 -0
- package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/placeAssociateAngleOnCircle.js +0 -2
- package/lib/exercises/options/optionFirstTermRankOne.d.ts +16 -0
- package/lib/exercises/options/optionFirstTermRankOne.d.ts.map +1 -0
- package/lib/exercises/options/optionFirstTermRankOne.js +17 -0
- package/lib/exercises/options/optionIsUsePythonDef.d.ts +16 -0
- package/lib/exercises/options/optionIsUsePythonDef.d.ts.map +1 -0
- package/lib/exercises/options/optionIsUsePythonDef.js +17 -0
- package/lib/exercises/options/optionIsWithSuperfluousData.d.ts +16 -0
- package/lib/exercises/options/optionIsWithSuperfluousData.d.ts.map +1 -0
- package/lib/exercises/options/optionIsWithSuperfluousData.js +17 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts +1 -0
- package/lib/exercises/utils/geogebra/toGGBCommandsProps.d.ts.map +1 -1
- package/lib/exercises/vea/colinearVectorVEA.d.ts +2 -0
- package/lib/exercises/vea/colinearVectorVEA.d.ts.map +1 -0
- package/lib/exercises/vea/colinearVectorVEA.js +11 -0
- package/lib/exercises/vea/rationalVEA.d.ts.map +1 -1
- package/lib/exercises/vea/rationalVEA.js +7 -3
- package/lib/exercises/vea/varLineVEA.d.ts.map +1 -1
- package/lib/exercises/vea/varLineVEA.js +7 -3
- package/lib/exercises/vea/varSignTableVEA.d.ts +8 -0
- package/lib/exercises/vea/varSignTableVEA.d.ts.map +1 -1
- package/lib/exercises/vea/varSignTableVEA.js +8 -0
- package/lib/exercises/vea/xTableLineVEA.d.ts +1 -0
- package/lib/exercises/vea/xTableLineVEA.d.ts.map +1 -1
- package/lib/exercises/vea/xTableLineVEA.js +1 -0
- package/lib/index.d.ts +104 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +3 -1
- package/lib/math/geometry/angle.d.ts +2 -0
- package/lib/math/geometry/angle.d.ts.map +1 -1
- package/lib/math/geometry/angle.js +17 -0
- package/lib/math/geometry/line.d.ts +1 -1
- package/lib/math/geometry/line.d.ts.map +1 -1
- package/lib/math/geometry/line.js +3 -3
- package/lib/math/geometry/point.d.ts +1 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +4 -1
- package/lib/math/geometry/segment.js +1 -1
- package/lib/math/numbers/reals/real.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.js +4 -0
- package/lib/math/probability/randomVariable.d.ts +2 -1
- package/lib/math/probability/randomVariable.d.ts.map +1 -1
- package/lib/math/probability/randomVariable.js +7 -1
- package/lib/math/utils/arithmetic/primeFactors.d.ts +1 -1
- package/lib/math/utils/arithmetic/primeFactors.d.ts.map +1 -1
- package/lib/math/utils/arithmetic/primeFactors.js +23 -9
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts +53 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +1928 -0
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts +15 -0
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +136 -0
- package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts +42 -0
- package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqGeometricSituations.js +932 -0
- package/lib/math/utils/sequences/situations/seqGeometricUtils.d.ts +12 -0
- package/lib/math/utils/sequences/situations/seqGeometricUtils.d.ts.map +1 -0
- package/lib/math/utils/sequences/situations/seqGeometricUtils.js +90 -0
- package/lib/tests/pdfs/mdTableToLatexTabular.js +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts +1 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.d.ts +1 -0
- package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.js +3 -0
- package/lib/tree/nodes/equations/equalNode.d.ts +1 -0
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +3 -0
- 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/equations/multiEqualNode.d.ts +1 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/multiEqualNode.js +3 -0
- package/lib/tree/nodes/equations/notEqualNode.d.ts +1 -0
- package/lib/tree/nodes/equations/notEqualNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/notEqualNode.js +3 -0
- package/lib/tree/nodes/functions/absNode.d.ts +1 -0
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +7 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arcSinNode.js +7 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arccosNode.js +7 -0
- package/lib/tree/nodes/functions/arctanNode.d.ts +1 -0
- package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arctanNode.js +7 -0
- package/lib/tree/nodes/functions/cosNode.d.ts +1 -0
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +7 -0
- package/lib/tree/nodes/functions/expNode.d.ts +1 -0
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +7 -0
- package/lib/tree/nodes/functions/factorialNode.d.ts +30 -0
- package/lib/tree/nodes/functions/factorialNode.d.ts.map +1 -0
- package/lib/tree/nodes/functions/factorialNode.js +79 -0
- package/lib/tree/nodes/functions/functionNode.d.ts +2 -1
- package/lib/tree/nodes/functions/functionNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/functionNode.js +1 -0
- package/lib/tree/nodes/functions/integralNode.d.ts +1 -0
- package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/integralNode.js +7 -0
- package/lib/tree/nodes/functions/log10Node.d.ts +1 -0
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
- package/lib/tree/nodes/functions/log10Node.js +7 -0
- package/lib/tree/nodes/functions/logNode.d.ts +1 -0
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +9 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts +1 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +7 -0
- package/lib/tree/nodes/functions/sinNode.d.ts +1 -0
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +7 -0
- package/lib/tree/nodes/functions/sqrtNode.d.ts +1 -0
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +7 -0
- package/lib/tree/nodes/functions/tanNode.d.ts +1 -0
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +7 -0
- package/lib/tree/nodes/geometry/degree.d.ts +1 -0
- package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/degree.js +7 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.js +7 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/pointNode.js +7 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts +1 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/vectorNode.js +7 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts +1 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +7 -0
- 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 +7 -0
- package/lib/tree/nodes/node.d.ts +2 -1
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +2 -0
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -1
- package/lib/tree/nodes/nodeConstructor.js +4 -0
- package/lib/tree/nodes/numbers/percentNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/percentNode.js +7 -0
- package/lib/tree/nodes/operators/addNode.d.ts +1 -0
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +7 -0
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts +4 -3
- package/lib/tree/nodes/operators/binomialCoefficientNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/binomialCoefficientNode.js +24 -5
- package/lib/tree/nodes/operators/divideNode.d.ts +1 -0
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/divideNode.js +7 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +1 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +7 -0
- package/lib/tree/nodes/operators/limitNode.d.ts +1 -0
- package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/limitNode.js +7 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts +1 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +7 -0
- package/lib/tree/nodes/operators/powerNode.d.ts +1 -0
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +7 -0
- package/lib/tree/nodes/operators/substractNode.d.ts +1 -0
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +7 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts +1 -0
- package/lib/tree/nodes/polynomials/monomNode.d.ts.map +1 -1
- package/lib/tree/nodes/polynomials/monomNode.js +7 -0
- package/lib/tree/nodes/polynomials/trinomNode.d.ts +1 -0
- package/lib/tree/nodes/polynomials/trinomNode.d.ts.map +1 -1
- package/lib/tree/nodes/polynomials/trinomNode.js +7 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts +1 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/belongsNode.js +7 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts +1 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.js +7 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +1 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +7 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +1 -0
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +7 -0
- package/lib/tree/nodes/variables/variableNode.d.ts +1 -0
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +7 -0
- package/lib/tree/parsers/vectorParser.d.ts.map +1 -1
- package/lib/tree/parsers/vectorParser.js +8 -0
- package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -1
- package/lib/tree/utilities/nodeShuffler.js +3 -0
- package/lib/tree/utilities/nodeSimplifier.d.ts.map +1 -1
- package/lib/tree/utilities/nodeSimplifier.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,498 @@
|
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getOptionFirstTermRankOneStuff, } from "../../../../exercises/options/optionFirstTermRankOne.js";
|
|
3
|
+
import { getOptionIsUsePythonDefStuff, } from "../../../../exercises/options/optionIsUsePythonDef.js";
|
|
4
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
5
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
6
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
7
|
+
import { NodeConstructor, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
8
|
+
import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
9
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
10
|
+
const codify = (strPython) => {
|
|
11
|
+
return `\`\`\`python
|
|
12
|
+
${strPython}
|
|
13
|
+
\`\`\``;
|
|
14
|
+
};
|
|
15
|
+
const codifyChunk = (strPython) => {
|
|
16
|
+
return `\`${strPython}\``;
|
|
17
|
+
};
|
|
18
|
+
const createStrPythonForNode = (node) => {
|
|
19
|
+
return node.toMathString().replaceAll("^", "**");
|
|
20
|
+
};
|
|
21
|
+
const _getStrPythonProgram = (identifiers, opts) => {
|
|
22
|
+
const { isUsePythonDef, isUsePythonList, typeSequence } = opts;
|
|
23
|
+
const firstRank = opts.firstTermRankOne ? 1 : 0;
|
|
24
|
+
const { valueThreshold, valueLimit, nodeIdsDistanceMax } = identifiers;
|
|
25
|
+
const nodeDistanceMax = NodeConstructor.fromIdentifiers(nodeIdsDistanceMax);
|
|
26
|
+
const strDistanceMax = createStrPythonForNode(nodeDistanceMax);
|
|
27
|
+
const strUI = isUsePythonList
|
|
28
|
+
? `u[i]`
|
|
29
|
+
: `terme_u(${firstRank === 1 ? "1 +" : ""}i)`;
|
|
30
|
+
const strDef = typeSequence === "convergente" ? `def seuil(u, l, d):` : `def seuil(u, v):`;
|
|
31
|
+
const strPrint = typeSequence === "convergente"
|
|
32
|
+
? `print(seuil(u, ${valueLimit}, ${strDistanceMax}))`
|
|
33
|
+
: `print(seuil(u, ${valueThreshold}))`;
|
|
34
|
+
if (isUsePythonDef) {
|
|
35
|
+
const strWhile = typeSequence === "convergente"
|
|
36
|
+
? `while abs(${strUI} - ${valueLimit}) < ${strDistanceMax}:`
|
|
37
|
+
: `while ${strUI} < v:`;
|
|
38
|
+
return `${strDef}
|
|
39
|
+
i = 0
|
|
40
|
+
${strWhile}
|
|
41
|
+
i = i + 1
|
|
42
|
+
return i
|
|
43
|
+
|
|
44
|
+
${strPrint}
|
|
45
|
+
`;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const strWhile = typeSequence === "convergente"
|
|
49
|
+
? `while abs(${strUI} - ${valueLimit}) < ${strDistanceMax}:`
|
|
50
|
+
: `while ${strUI} < ${valueThreshold}:`;
|
|
51
|
+
return `i = 0
|
|
52
|
+
${strWhile}
|
|
53
|
+
i = i + 1
|
|
54
|
+
print(i)
|
|
55
|
+
`;
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const getStrPythonProgramComplete = (identifiers, opts) => {
|
|
59
|
+
const identifiersTweaked = {
|
|
60
|
+
...identifiers,
|
|
61
|
+
keyIncomplete: "",
|
|
62
|
+
};
|
|
63
|
+
return getStrPythonProgramIncomplete(identifiersTweaked, opts);
|
|
64
|
+
};
|
|
65
|
+
const getStrPythonProgramIncomplete = (identifiers, opts) => {
|
|
66
|
+
const { isUsePythonDef, typeSequence } = opts;
|
|
67
|
+
const { keyIncomplete } = identifiers;
|
|
68
|
+
const { strInitialization, strWhile, strLoopBody, strPrint } = Object.fromEntries(Object.entries(getDictStrCompletion(identifiers, opts)).map(([key, str]) => (key === keyIncomplete ? [key, "..."] : [key, str])));
|
|
69
|
+
if (isUsePythonDef) {
|
|
70
|
+
const strDef = typeSequence === "convergente" ? `def seuil(l, d):` : `def seuil(v):`;
|
|
71
|
+
return `${strDef}
|
|
72
|
+
${strInitialization}
|
|
73
|
+
${strWhile}
|
|
74
|
+
${strLoopBody}
|
|
75
|
+
return i
|
|
76
|
+
|
|
77
|
+
${strPrint}
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
return `${strInitialization}
|
|
82
|
+
${strWhile}
|
|
83
|
+
${strLoopBody}
|
|
84
|
+
${strPrint}
|
|
85
|
+
`;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const getDictStrCompletion = (identifiers, opts) => {
|
|
89
|
+
const { isUsePythonDef, isUsePythonList, typeSequence } = opts;
|
|
90
|
+
const firstRank = opts.firstTermRankOne ? 1 : 0;
|
|
91
|
+
const { valueThreshold, valueLimit, nodeIdsDistanceMax } = identifiers;
|
|
92
|
+
const nodeDistanceMax = NodeConstructor.fromIdentifiers(nodeIdsDistanceMax);
|
|
93
|
+
const strDistanceMax = createStrPythonForNode(nodeDistanceMax);
|
|
94
|
+
const strUI = isUsePythonList
|
|
95
|
+
? `u[i]`
|
|
96
|
+
: `terme_u(${firstRank === 1 ? "1+" : ""}i)`;
|
|
97
|
+
if (isUsePythonDef) {
|
|
98
|
+
return {
|
|
99
|
+
strInitialization: `i = 0`,
|
|
100
|
+
strWhile: typeSequence === "convergente"
|
|
101
|
+
? `while abs(${strUI} - l) > d:`
|
|
102
|
+
: `while ${strUI} < v:`,
|
|
103
|
+
strLoopBody: `i = i + 1`,
|
|
104
|
+
strPrint: typeSequence === "convergente"
|
|
105
|
+
? `print(seuil(${valueLimit}, ${strDistanceMax}))`
|
|
106
|
+
: `print(seuil(${valueThreshold}))`,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
return {
|
|
111
|
+
strInitialization: `i = 0`,
|
|
112
|
+
strWhile: typeSequence === "convergente"
|
|
113
|
+
? `while abs(${strUI} - ${valueLimit}) > ${createStrPythonForNode(nodeDistanceMax)}:`
|
|
114
|
+
: `while ${strUI} < ${valueThreshold}:`,
|
|
115
|
+
strLoopBody: `i = i + 1`,
|
|
116
|
+
strPrint: `print(i)`,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
const getInstruction = (identifiers, optsIn) => {
|
|
121
|
+
const opts = optsIn ?? optsDefault;
|
|
122
|
+
const firstRank = opts.firstTermRankOne ? 1 : 0;
|
|
123
|
+
const { isUsePythonList, typeSequence } = opts;
|
|
124
|
+
const { valueLimit } = identifiers;
|
|
125
|
+
return `On considère une suite $(u_{n})$ positive, strictement croissante et ${typeSequence}.
|
|
126
|
+
${typeSequence === "convergente"
|
|
127
|
+
? `Sa limite vaut $${valueLimit.frenchify()}$.`
|
|
128
|
+
: ``}
|
|
129
|
+
|
|
130
|
+
Dans le programme suivant, on suppose que l'on dispose ${(() => {
|
|
131
|
+
if (isUsePythonList) {
|
|
132
|
+
return `d'une liste ${codifyChunk("u")} qui contient les éléments $u_${firstRank}$, $u_${firstRank + 1}$, etc.`;
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
return `d'une fonction ${codifyChunk("terme_u")} telle que ${codifyChunk("terme_u(n)")} retourne $u_{n}$.`;
|
|
136
|
+
}
|
|
137
|
+
})()}
|
|
138
|
+
|
|
139
|
+
Par quoi faut-il remplacer les pointillés dans le programme suivant pour afficher le rang $N$ ${(() => {
|
|
140
|
+
switch (typeSequence) {
|
|
141
|
+
case "divergente": {
|
|
142
|
+
const { valueThreshold } = identifiers;
|
|
143
|
+
return `à partir duquel la suite dépasse $${valueThreshold.frenchify()}$`;
|
|
144
|
+
}
|
|
145
|
+
case "convergente": {
|
|
146
|
+
const { nodeIdsDistanceMax } = identifiers;
|
|
147
|
+
const nodeDistanceMax = NodeConstructor.fromIdentifiers(nodeIdsDistanceMax);
|
|
148
|
+
return `à partir duquel l'écart entre la suite et sa limite est strictement inférieur à $${nodeDistanceMax.toTex()}$`;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
})()} ?
|
|
152
|
+
|
|
153
|
+
${codify(getStrPythonProgramIncomplete(identifiers, opts))}
|
|
154
|
+
|
|
155
|
+
`;
|
|
156
|
+
};
|
|
157
|
+
const getAnswer = (identifiers, optsIn) => {
|
|
158
|
+
const opts = optsIn ?? optsDefault;
|
|
159
|
+
const { keyIncomplete } = identifiers;
|
|
160
|
+
const dictStrCompletion = getDictStrCompletion(identifiers, opts);
|
|
161
|
+
return codifyChunk(dictStrCompletion[keyIncomplete]);
|
|
162
|
+
};
|
|
163
|
+
const getHint = (identifiers) => {
|
|
164
|
+
const { keyIncomplete } = identifiers;
|
|
165
|
+
switch (keyIncomplete) {
|
|
166
|
+
case "strInitialization":
|
|
167
|
+
return `Quelle variable faut-il initialiser et avec quelle valeur ?`;
|
|
168
|
+
case "strWhile":
|
|
169
|
+
return `Comment écrire une boucle "tant que ..." en Python ?`;
|
|
170
|
+
case "strLoopBody":
|
|
171
|
+
return `Qu'est-ce que l'on veut faire croître jusqu'à une certaine valeur dans ce programme ?`;
|
|
172
|
+
case "strPrint":
|
|
173
|
+
return `Quel est le résultat que l'on souhaite afficher et comment l'afficher en Python ?`;
|
|
174
|
+
default:
|
|
175
|
+
throw new Error("Unsupported keyIncomplete: " + keyIncomplete);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
const getCorrection = (identifiers, optsIn) => {
|
|
179
|
+
const opts = optsIn ?? optsDefault;
|
|
180
|
+
return `Voici le programme complet :
|
|
181
|
+
|
|
182
|
+
${codify(getStrPythonProgramComplete(identifiers, opts))}
|
|
183
|
+
|
|
184
|
+
`;
|
|
185
|
+
};
|
|
186
|
+
const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
|
|
187
|
+
const opts = optsIn ?? optsDefault;
|
|
188
|
+
const firstRank = opts.firstTermRankOne ? 1 : 0;
|
|
189
|
+
const firstRankWrong = opts.firstTermRankOne ? 0 : 1;
|
|
190
|
+
const { isUsePythonDef, isUsePythonList, typeSequence } = opts;
|
|
191
|
+
const propositions = [];
|
|
192
|
+
addValidProp(propositions, answer, "raw");
|
|
193
|
+
const { keyIncomplete, valueThreshold, valueLimit, nodeIdsDistanceMax } = identifiers;
|
|
194
|
+
const nodeDistanceMax = NodeConstructor.fromIdentifiers(nodeIdsDistanceMax);
|
|
195
|
+
const strFirstValue = isUsePythonList ? `u[0]` : `terme_u(${firstRank})`;
|
|
196
|
+
const strUI = isUsePythonList
|
|
197
|
+
? `u[i]`
|
|
198
|
+
: `terme_u(${firstRank === 1 ? "1+" : ""}i)`;
|
|
199
|
+
const strDistanceMax = createStrPythonForNode(nodeDistanceMax);
|
|
200
|
+
switch (keyIncomplete) {
|
|
201
|
+
case "strInitialization":
|
|
202
|
+
{
|
|
203
|
+
//student: i = firstRankWrong
|
|
204
|
+
{
|
|
205
|
+
const strWrong = `i = ${firstRankWrong}`;
|
|
206
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
207
|
+
}
|
|
208
|
+
//student: i = firstValue
|
|
209
|
+
{
|
|
210
|
+
const strWrong = `i = ${strFirstValue}`;
|
|
211
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
212
|
+
}
|
|
213
|
+
switch (typeSequence) {
|
|
214
|
+
case "divergente":
|
|
215
|
+
{
|
|
216
|
+
//student: i = valueThreshold
|
|
217
|
+
{
|
|
218
|
+
const strWrong = `i = ${valueThreshold}`;
|
|
219
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
break;
|
|
223
|
+
case "convergente":
|
|
224
|
+
{
|
|
225
|
+
//student: i = valueLimit
|
|
226
|
+
{
|
|
227
|
+
const strWrong = `i = ${valueLimit}`;
|
|
228
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
//student: u = 0
|
|
234
|
+
{
|
|
235
|
+
const strWrong = `u = 0`;
|
|
236
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
237
|
+
}
|
|
238
|
+
//student: u = firstValue
|
|
239
|
+
{
|
|
240
|
+
const strWrong = `u = ${strFirstValue}`;
|
|
241
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
break;
|
|
245
|
+
case "strWhile":
|
|
246
|
+
{
|
|
247
|
+
switch (typeSequence) {
|
|
248
|
+
case "divergente":
|
|
249
|
+
{
|
|
250
|
+
if (isUsePythonDef) {
|
|
251
|
+
//student: wrong ineq symbol
|
|
252
|
+
{
|
|
253
|
+
{
|
|
254
|
+
const strWrong = `while ${strUI} >= v:`;
|
|
255
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
256
|
+
}
|
|
257
|
+
{
|
|
258
|
+
const strWrong = `while ${strUI} > v:`;
|
|
259
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
260
|
+
}
|
|
261
|
+
{
|
|
262
|
+
const strWrong = `while v <= ${strUI}:`;
|
|
263
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
264
|
+
}
|
|
265
|
+
{
|
|
266
|
+
const strWrong = `while v < ${strUI} :`;
|
|
267
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
//student: wrong ineq symbol
|
|
273
|
+
{
|
|
274
|
+
{
|
|
275
|
+
const strWrong = `while ${strUI} >= ${valueThreshold}:`;
|
|
276
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
277
|
+
}
|
|
278
|
+
{
|
|
279
|
+
const strWrong = `while ${strUI} > ${valueThreshold}:`;
|
|
280
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
281
|
+
}
|
|
282
|
+
{
|
|
283
|
+
const strWrong = `while ${valueThreshold} <= ${strUI}:`;
|
|
284
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
285
|
+
}
|
|
286
|
+
{
|
|
287
|
+
const strWrong = `while ${valueThreshold} < ${strUI}:`;
|
|
288
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
break;
|
|
294
|
+
case "convergente":
|
|
295
|
+
{
|
|
296
|
+
//student: swaps limit and distance
|
|
297
|
+
{
|
|
298
|
+
{
|
|
299
|
+
const strWrong = `while abs(${strUI} - d) > l:`;
|
|
300
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
301
|
+
}
|
|
302
|
+
{
|
|
303
|
+
const strWrong = `while l < abs(${strUI} - d):`;
|
|
304
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
//student: wrong inequality symbol
|
|
308
|
+
{
|
|
309
|
+
{
|
|
310
|
+
const strWrong = `while abs(${strUI} - ${valueLimit}) < ${createStrPythonForNode(nodeDistanceMax)}:`;
|
|
311
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
312
|
+
}
|
|
313
|
+
{
|
|
314
|
+
const strWrong = `while ${createStrPythonForNode(nodeDistanceMax)} < abs(${strUI} - ${valueLimit}):`;
|
|
315
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
break;
|
|
320
|
+
default:
|
|
321
|
+
throw new Error("Unsupported typeSequence: " + typeSequence);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
break;
|
|
325
|
+
case "strLoopBody":
|
|
326
|
+
{
|
|
327
|
+
//student: focuses on value, not on rank
|
|
328
|
+
{
|
|
329
|
+
{
|
|
330
|
+
const strWrong = `u = ${strUI}`;
|
|
331
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
332
|
+
}
|
|
333
|
+
{
|
|
334
|
+
const strWrong = `u = u + ${strUI}`;
|
|
335
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
336
|
+
}
|
|
337
|
+
{
|
|
338
|
+
const strWrong = `i = ${strUI}`;
|
|
339
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
//student: forgets to assign
|
|
343
|
+
{
|
|
344
|
+
const strWrong = `i+1`;
|
|
345
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
break;
|
|
349
|
+
case "strPrint":
|
|
350
|
+
{
|
|
351
|
+
if (isUsePythonDef) {
|
|
352
|
+
//student: no-args call
|
|
353
|
+
{
|
|
354
|
+
const strWrong = `print(seuil())`;
|
|
355
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
356
|
+
}
|
|
357
|
+
//student: no function call
|
|
358
|
+
{
|
|
359
|
+
const strWrong = `print(${valueThreshold})`;
|
|
360
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
361
|
+
}
|
|
362
|
+
//student: i
|
|
363
|
+
{
|
|
364
|
+
const strWrong = `print(i)`;
|
|
365
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
366
|
+
}
|
|
367
|
+
switch (typeSequence) {
|
|
368
|
+
case "divergente":
|
|
369
|
+
break;
|
|
370
|
+
case "convergente":
|
|
371
|
+
{
|
|
372
|
+
//student: swaps args
|
|
373
|
+
{
|
|
374
|
+
const strWrong = `print(seuil(${strDistanceMax}, ${valueLimit}))`;
|
|
375
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
376
|
+
}
|
|
377
|
+
//student: missing arg
|
|
378
|
+
{
|
|
379
|
+
const strWrong = `print(seuil(${valueLimit}))`;
|
|
380
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
break;
|
|
384
|
+
default:
|
|
385
|
+
throw new Error("Unsupported typeSequence: " + typeSequence);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
//student: value instead of rank
|
|
390
|
+
{
|
|
391
|
+
const strWrong = `print(${strUI})`;
|
|
392
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
393
|
+
}
|
|
394
|
+
//student: value instead of rank
|
|
395
|
+
{
|
|
396
|
+
const strWrong = `print(u)`;
|
|
397
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
398
|
+
}
|
|
399
|
+
//student: offset
|
|
400
|
+
{
|
|
401
|
+
const strWrong = `print(i-1)`;
|
|
402
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
403
|
+
}
|
|
404
|
+
//student: forgets to call print
|
|
405
|
+
{
|
|
406
|
+
{
|
|
407
|
+
const strWrong = `i`;
|
|
408
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
409
|
+
}
|
|
410
|
+
{
|
|
411
|
+
const strWrong = `${strUI}`;
|
|
412
|
+
tryToAddWrongProp(propositions, codifyChunk(strWrong), "raw");
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
break;
|
|
418
|
+
default:
|
|
419
|
+
throw new Error("Unsupported keyIncomplete: " + keyIncomplete);
|
|
420
|
+
}
|
|
421
|
+
return shuffleProps(propositions, n);
|
|
422
|
+
};
|
|
423
|
+
const createRandomIdentifiers = (_opts) => {
|
|
424
|
+
const valueThreshold = randfloat(100, 200, 1);
|
|
425
|
+
const valueLimit = randfloat(0, 200, 1, [0]);
|
|
426
|
+
const nodeDistanceMax = power(10, randint(-8, -1));
|
|
427
|
+
const keyIncomplete = random([
|
|
428
|
+
"strInitialization",
|
|
429
|
+
"strWhile",
|
|
430
|
+
"strLoopBody",
|
|
431
|
+
"strPrint",
|
|
432
|
+
]);
|
|
433
|
+
const identifiers = {
|
|
434
|
+
valueThreshold,
|
|
435
|
+
valueLimit,
|
|
436
|
+
nodeIdsDistanceMax: nodeDistanceMax.toIdentifiers(),
|
|
437
|
+
keyIncomplete,
|
|
438
|
+
};
|
|
439
|
+
return identifiers;
|
|
440
|
+
};
|
|
441
|
+
const getPySequenceThresholdInstructionCompletionQuestion = (optsIn) => {
|
|
442
|
+
const opts = optsIn ?? optsDefault;
|
|
443
|
+
const identifiers = createRandomIdentifiers(opts);
|
|
444
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
445
|
+
};
|
|
446
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
447
|
+
const question = {
|
|
448
|
+
answer: getAnswer(identifiers, opts),
|
|
449
|
+
instruction: getInstruction(identifiers, opts),
|
|
450
|
+
keys: [],
|
|
451
|
+
answerFormat: "tex",
|
|
452
|
+
identifiers,
|
|
453
|
+
hint: getHint(identifiers, opts),
|
|
454
|
+
correction: getCorrection(identifiers, opts),
|
|
455
|
+
options: opts,
|
|
456
|
+
};
|
|
457
|
+
return question;
|
|
458
|
+
};
|
|
459
|
+
const { optsDefaultFirstTermRankOne, generatorOptionFirstTermRankOne } = getOptionFirstTermRankOneStuff(false);
|
|
460
|
+
const { optsDefaultIsUsePythonDef, generatorOptionIsUsePythonDef } = getOptionIsUsePythonDefStuff(false);
|
|
461
|
+
const optsDefault = Object.assign({}, optsDefaultFirstTermRankOne, optsDefaultIsUsePythonDef, {
|
|
462
|
+
isUsePythonList: false,
|
|
463
|
+
}, {
|
|
464
|
+
typeSequence: "divergente",
|
|
465
|
+
});
|
|
466
|
+
const options = [
|
|
467
|
+
generatorOptionFirstTermRankOne,
|
|
468
|
+
generatorOptionIsUsePythonDef,
|
|
469
|
+
{
|
|
470
|
+
id: "isUsePythonList",
|
|
471
|
+
label: "Utiliser une liste python",
|
|
472
|
+
target: GeneratorOptionTarget.generation,
|
|
473
|
+
type: GeneratorOptionType.checkbox,
|
|
474
|
+
defaultValue: optsDefault.isUsePythonList,
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
id: "typeSequence",
|
|
478
|
+
label: "Type de suite",
|
|
479
|
+
target: GeneratorOptionTarget.generation,
|
|
480
|
+
type: GeneratorOptionType.select,
|
|
481
|
+
values: ["divergente", "convergente"],
|
|
482
|
+
defaultValue: optsDefault.typeSequence,
|
|
483
|
+
},
|
|
484
|
+
];
|
|
485
|
+
export const pySequenceThresholdInstructionCompletion = {
|
|
486
|
+
id: "pySequenceThresholdInstructionCompletion",
|
|
487
|
+
label: "Compléter un algorithme de calcul de seuil",
|
|
488
|
+
isSingleStep: true,
|
|
489
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPySequenceThresholdInstructionCompletionQuestion(opts), nb),
|
|
490
|
+
options,
|
|
491
|
+
qcmTimer: 60,
|
|
492
|
+
freeTimer: 60,
|
|
493
|
+
getPropositions,
|
|
494
|
+
subject: "Mathématiques",
|
|
495
|
+
getQuestionFromIdentifiers,
|
|
496
|
+
hasHintAndCorrection: true,
|
|
497
|
+
answerType: "QCU",
|
|
498
|
+
};
|
package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { OptionFirstTermRankOne } from "../../../../exercises/options/optionFirstTermRankOne.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
rank1: number;
|
|
5
|
+
value1: number;
|
|
6
|
+
rank2: number;
|
|
7
|
+
value2: number;
|
|
8
|
+
};
|
|
9
|
+
type Options = OptionFirstTermRankOne;
|
|
10
|
+
export declare const arithmeticFindExplicitFormulaFromTwoTerms: Exercise<Identifiers, Options>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map
|
package/lib/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arithmeticFindExplicitFormulaFromTwoTerms.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticFindExplicitFormulaFromTwoTerms.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAiB3D,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwOF,KAAK,OAAO,GAAG,sBAAsB,CAAC;AAMtC,eAAO,MAAM,yCAAyC,EAAE,QAAQ,CAC9D,WAAW,EACX,OAAO,CAoBR,CAAC"}
|