math-exercises 2.2.9 → 2.2.11
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 +2 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.js +24 -7
- package/lib/exercises/math/calcul/decimals/index.d.ts +3 -0
- package/lib/exercises/math/calcul/decimals/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/index.js +18 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts +8 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +53 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts +9 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +63 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +33 -1
- package/lib/exercises/math/calcul/index.d.ts +2 -0
- package/lib/exercises/math/calcul/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/index.js +2 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts +8 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/expressionNature.js +180 -80
- package/lib/exercises/math/calcul/operations/index.d.ts +3 -0
- package/lib/exercises/math/calcul/operations/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/index.js +3 -0
- package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +1 -1
- package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/operationsPriorities.js +20 -5
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts +8 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts.map +1 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +111 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts +8 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts.map +1 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.js +127 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.js +18 -1
- package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/decimalOrdering.js +77 -0
- package/lib/exercises/math/calcul/ordering/framing.d.ts +10 -0
- package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/framing.js +143 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts +4 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/index.js +19 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts +8 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.js +61 -0
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.js +1 -1
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +9 -6
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +15 -4
- package/lib/exercises/math/functions/trinoms/canonicalFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVector.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +0 -4
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +2 -3
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +17 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCube.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfCube.js +7 -1
- package/lib/exercises/math/index.d.ts +0 -1
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +0 -1
- package/lib/exercises/math/limits/rationalFracForbiddenValueLimit.d.ts.map +1 -1
- package/lib/exercises/math/percent/htToTTC.d.ts +8 -0
- package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -0
- package/lib/exercises/math/percent/htToTTC.js +50 -0
- package/lib/exercises/math/percent/index.d.ts +2 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +2 -0
- package/lib/exercises/math/percent/ttcToHT.d.ts +8 -0
- package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -0
- package/lib/exercises/math/percent/ttcToHT.js +50 -0
- package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersDivision.js +35 -2
- package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.js +21 -0
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageList.d.ts +7 -0
- package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/averageList.js +52 -0
- package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts +7 -0
- package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/etendueList.js +49 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +2 -11
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.js +42 -0
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +7 -2
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.js +42 -0
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts +10 -0
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +56 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +1 -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/sequenceEvaluation.d.ts +10 -0
- package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/sequenceEvaluation.js +143 -0
- package/lib/exercises/math/sequences/sequencePlot.d.ts +9 -0
- package/lib/exercises/math/sequences/sequencePlot.d.ts.map +1 -0
- package/lib/exercises/math/sequences/sequencePlot.js +94 -0
- package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalsIntersection.js +19 -1
- package/lib/exercises/math/sets/intervals/intervalsUnion.js +1 -1
- package/lib/exercises/math/trigonometry/arcValue.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/arcValue.js +23 -0
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +1 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.js +1 -1
- package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
- package/lib/index.d.ts +54 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/point.d.ts +11 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +8 -0
- package/lib/math/numbers/decimals/decimal.d.ts +2 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +18 -0
- package/lib/math/numbers/reals/extendedRingElement.d.ts +3 -1
- package/lib/math/numbers/reals/extendedRingElement.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.d.ts +1 -1
- package/lib/math/polynomials/trinom.d.ts +1 -1
- package/lib/math/sets/intervals/intervals.d.ts +3 -1
- package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.js +9 -5
- package/lib/math/sets/mathSet.d.ts +2 -2
- package/lib/math/sets/mathSet.d.ts.map +1 -1
- package/lib/math/sets/mathSetInterface.d.ts +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +13 -2
- package/lib/server.d.ts.map +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/algebraicNode.js +0 -3
- package/lib/tree/nodes/complex/complexNode.d.ts +10 -1
- package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.js +7 -0
- package/lib/tree/nodes/equations/equalNode.d.ts +10 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +7 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +10 -1
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +6 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts +7 -1
- package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/multiEqualNode.js +6 -0
- package/lib/tree/nodes/functions/absNode.d.ts +7 -1
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +6 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts +7 -1
- package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arcSinNode.js +8 -1
- package/lib/tree/nodes/functions/arccosNode.d.ts +7 -1
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arccosNode.js +8 -1
- package/lib/tree/nodes/functions/arctanNode.d.ts +7 -1
- package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arctanNode.js +8 -1
- package/lib/tree/nodes/functions/cosNode.d.ts +7 -1
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +8 -1
- package/lib/tree/nodes/functions/expNode.d.ts +7 -1
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +6 -0
- package/lib/tree/nodes/functions/integralNode.d.ts +19 -2
- package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/integralNode.js +20 -0
- package/lib/tree/nodes/functions/log10Node.d.ts +7 -1
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
- package/lib/tree/nodes/functions/log10Node.js +6 -0
- package/lib/tree/nodes/functions/logNode.d.ts +7 -1
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +6 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts +7 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +6 -0
- package/lib/tree/nodes/functions/sinNode.d.ts +7 -1
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +8 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts +7 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +6 -0
- package/lib/tree/nodes/functions/tanNode.d.ts +7 -1
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +8 -1
- package/lib/tree/nodes/geometry/degree.d.ts +5 -1
- package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/degree.js +6 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts +5 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.js +6 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts +14 -1
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/pointNode.js +6 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts +5 -1
- package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/vectorNode.js +6 -0
- package/lib/tree/nodes/hasVariableNode.d.ts +3 -0
- package/lib/tree/nodes/hasVariableNode.d.ts.map +1 -0
- package/lib/tree/nodes/hasVariableNode.js +16 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts +8 -1
- 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 +19 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +7 -1
- package/lib/tree/nodes/node.d.ts +52 -8
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +49 -21
- package/lib/tree/nodes/nodeConstructor.d.ts +7 -0
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -0
- package/lib/tree/nodes/nodeConstructor.js +170 -0
- package/lib/tree/nodes/numbers/constantNode.d.ts +7 -1
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.js +9 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts +5 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +6 -0
- package/lib/tree/nodes/numbers/percentNode.d.ts +5 -1
- package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/percentNode.js +6 -0
- package/lib/tree/nodes/operators/addNode.d.ts +10 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +16 -6
- package/lib/tree/nodes/operators/divideNode.d.ts +11 -1
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/divideNode.js +12 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +10 -1
- 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 +11 -1
- package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/limitNode.js +8 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts +10 -1
- 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 +10 -1
- 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 +11 -1
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +12 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts +10 -1
- 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/closure.d.ts +2 -0
- package/lib/tree/nodes/sets/closure.d.ts.map +1 -1
- package/lib/tree/nodes/sets/closure.js +20 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts +10 -2
- package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.js +13 -3
- package/lib/tree/nodes/sets/intervalNode.d.ts +14 -2
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +22 -1
- package/lib/tree/nodes/sets/setNode.d.ts +1 -0
- package/lib/tree/nodes/sets/setNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +7 -1
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +7 -1
- package/lib/tree/nodes/variables/variableNode.d.ts +5 -1
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +6 -0
- package/lib/tree/utilities/operatorComposition.js +4 -2
- package/lib/types/keyProps.d.ts +13 -0
- package/lib/types/keyProps.d.ts.map +1 -0
- package/lib/types/keyProps.js +2 -0
- package/lib/utils/alignTex.js +11 -9
- package/lib/utils/diceFlip.d.ts.map +1 -1
- package/lib/utils/diceFlip.js +2 -6
- package/package.json +1 -1
|
@@ -33,12 +33,15 @@ const getRecognizeArithmeticFromFirstTermsQuestion = () => {
|
|
|
33
33
|
.map((el, index) => firstTerm + index * reason);
|
|
34
34
|
const answerIndex = (0, randint_1.randint)(0, 4);
|
|
35
35
|
sequences.splice(answerIndex, 0, rightSequence);
|
|
36
|
-
const
|
|
36
|
+
const names = ["u", "v", "w", "z"];
|
|
37
|
+
const answer = `\\text{Suite } ${names[answerIndex]} : \\quad ${rightSequence.join("\\ ; \\ ")}`;
|
|
37
38
|
const question = {
|
|
38
39
|
answer,
|
|
39
40
|
instruction: `Parmi les suites suivantes, laquelle semble être arithmétique ?`,
|
|
40
41
|
keys: [],
|
|
41
42
|
answerFormat: "tex",
|
|
43
|
+
hint: `Une suite est arithmétique lorsque, pour passer d'un terme au suivant, on additionne ou on soustrait toujours par le même nombre.`,
|
|
44
|
+
correction: `La suite $${names[answerIndex]}$ semble bien être arithmétique, puisque pour passer d'un terme au suivant, on additionne par $${reason}$.`,
|
|
42
45
|
identifiers: { sequences, answerIndex },
|
|
43
46
|
};
|
|
44
47
|
return question;
|
|
@@ -46,10 +49,11 @@ const getRecognizeArithmeticFromFirstTermsQuestion = () => {
|
|
|
46
49
|
const getPropositions = (n, { answer, sequences, answerIndex }) => {
|
|
47
50
|
const propositions = [];
|
|
48
51
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
52
|
+
const names = ["u", "v", "w", "z"];
|
|
49
53
|
sequences.forEach((sequence, index) => {
|
|
50
54
|
if (index === answerIndex)
|
|
51
55
|
return;
|
|
52
|
-
(0, exercise_1.addWrongProp)(propositions, `\\text{Suite ${index
|
|
56
|
+
(0, exercise_1.addWrongProp)(propositions, `\\text{Suite } ${names[index]} : \\quad ${sequence.join("\\ ; \\ ")}`);
|
|
53
57
|
});
|
|
54
58
|
return (0, shuffle_1.shuffle)(propositions);
|
|
55
59
|
};
|
|
@@ -69,4 +73,5 @@ exports.recognizeArithmeticFromFirstTerms = {
|
|
|
69
73
|
isAnswerValid,
|
|
70
74
|
answerType: "QCU",
|
|
71
75
|
subject: "Mathématiques",
|
|
76
|
+
hasHintAndCorrection: true,
|
|
72
77
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricFindTerm.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFindTerm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"geometricFindTerm.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFindTerm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAUlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAyFF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAgBnD,CAAC"}
|
|
@@ -4,6 +4,11 @@ exports.geometricFindTerm = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const randint_1 = require("../../../../math/utils/random/randint");
|
|
7
|
+
const multiplyNode_1 = require("../../../../tree/nodes/operators/multiplyNode");
|
|
8
|
+
const powerNode_1 = require("../../../../tree/nodes/operators/powerNode");
|
|
9
|
+
const substractNode_1 = require("../../../../tree/nodes/operators/substractNode");
|
|
10
|
+
const variableNode_1 = require("../../../../tree/nodes/variables/variableNode");
|
|
11
|
+
const alignTex_1 = require("../../../../utils/alignTex");
|
|
7
12
|
const random_1 = require("../../../../utils/random");
|
|
8
13
|
const getGeometricFindTermQuestion = () => {
|
|
9
14
|
const firstRank = (0, random_1.random)([0, 1]);
|
|
@@ -16,6 +21,42 @@ const getGeometricFindTermQuestion = () => {
|
|
|
16
21
|
instruction: `Soit $u$ la suite géométrique de premier terme $u_${firstRank} = ${firstTerm}$ et de raison $q = ${reason}$. Calculer $u_{${askedRank}}$.`,
|
|
17
22
|
keys: [],
|
|
18
23
|
answerFormat: "tex",
|
|
24
|
+
hint: `Le terme général d'une suite geométrique est :
|
|
25
|
+
|
|
26
|
+
${!firstRank
|
|
27
|
+
? `$u_n = u_0 \\times q^n$, où $u_0$`
|
|
28
|
+
: `$u_n = u_1 \\times q^{n-1}$, où $u_1$`} est le premier terme et $q$ la raison.`,
|
|
29
|
+
correction: `Le terme général de la suite $u$ est :
|
|
30
|
+
|
|
31
|
+
${!firstRank
|
|
32
|
+
? (0, alignTex_1.alignTex)([
|
|
33
|
+
[`u_n`, "=", `u_0 \\times q^n`],
|
|
34
|
+
[
|
|
35
|
+
"",
|
|
36
|
+
"=",
|
|
37
|
+
new multiplyNode_1.MultiplyNode(firstTerm.toTree(), new powerNode_1.PowerNode(reason.toTree(), new variableNode_1.VariableNode("n"))).toTex(),
|
|
38
|
+
],
|
|
39
|
+
])
|
|
40
|
+
: (0, alignTex_1.alignTex)([
|
|
41
|
+
[`u_n`, "=", `u_1 \\times q^{n-1}`],
|
|
42
|
+
[
|
|
43
|
+
"",
|
|
44
|
+
"=",
|
|
45
|
+
new multiplyNode_1.MultiplyNode(firstTerm.toTree(), new powerNode_1.PowerNode(reason.toTree(), new substractNode_1.SubstractNode(new variableNode_1.VariableNode("n"), (1).toTree()))).toTex(),
|
|
46
|
+
],
|
|
47
|
+
])}
|
|
48
|
+
|
|
49
|
+
Il suffit alors de remplacer $n$ par $${askedRank}$ dans la formule :
|
|
50
|
+
|
|
51
|
+
${(0, alignTex_1.alignTex)([
|
|
52
|
+
[
|
|
53
|
+
`u_{${askedRank}}`,
|
|
54
|
+
"=",
|
|
55
|
+
`${new multiplyNode_1.MultiplyNode(firstTerm.toTree(), new powerNode_1.PowerNode(reason.toTree(), (askedRank - firstRank).toTree())).toTex()}`,
|
|
56
|
+
],
|
|
57
|
+
["", "=", `${answer}`],
|
|
58
|
+
])}
|
|
59
|
+
`,
|
|
19
60
|
identifiers: { firstRank, askedRank, firstTerm, reason },
|
|
20
61
|
};
|
|
21
62
|
return question;
|
|
@@ -45,4 +86,5 @@ exports.geometricFindTerm = {
|
|
|
45
86
|
getPropositions,
|
|
46
87
|
isAnswerValid,
|
|
47
88
|
subject: "Mathématiques",
|
|
89
|
+
hasHintAndCorrection: true,
|
|
48
90
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
firstRank: number;
|
|
4
|
+
firstValue: number;
|
|
5
|
+
reason: number;
|
|
6
|
+
nbTerms: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const geometricFirstTermsGeneralSum: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=geometricFirstTermsGeneralSum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geometricFirstTermsGeneralSum.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AA+CF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAc/D,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.geometricFirstTermsGeneralSum = void 0;
|
|
4
|
+
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randint_1 = require("../../../../math/utils/random/randint");
|
|
7
|
+
const random_1 = require("../../../../utils/random");
|
|
8
|
+
const getGeometricFirstTermsGeneralSumQuestion = () => {
|
|
9
|
+
const firstRank = (0, random_1.random)([0, 1]);
|
|
10
|
+
const firstValue = (0, randint_1.randint)(-9, 10, [0]);
|
|
11
|
+
const reason = (0, randint_1.randint)(-5, 5, [0, 1]);
|
|
12
|
+
const nbTerms = (0, randint_1.randint)(4, 9);
|
|
13
|
+
const answer = (firstValue * (1 - Math.pow(reason, nbTerms))) / (1 - reason);
|
|
14
|
+
const question = {
|
|
15
|
+
answer: answer + "",
|
|
16
|
+
instruction: `Soit $u$ une suite géométrique de premier terme $u_${firstRank} = ${firstValue}$ et de raison $${reason}$. Calculer la somme des $${nbTerms}$ premiers termes de $u$.`,
|
|
17
|
+
keys: [],
|
|
18
|
+
answerFormat: "tex",
|
|
19
|
+
identifiers: {
|
|
20
|
+
firstRank,
|
|
21
|
+
firstValue,
|
|
22
|
+
reason,
|
|
23
|
+
nbTerms,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
return question;
|
|
27
|
+
};
|
|
28
|
+
const getPropositions = (n, { answer, firstRank, firstValue, reason, nbTerms }) => {
|
|
29
|
+
const propositions = [];
|
|
30
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
31
|
+
while (propositions.length < n) {
|
|
32
|
+
const fake = (firstValue *
|
|
33
|
+
(1 -
|
|
34
|
+
Math.pow(reason === -1 ? (0, randint_1.randint)(2, 5) : reason, (0, randint_1.randint)(3, 10)))) /
|
|
35
|
+
(1 - reason);
|
|
36
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, fake.frenchify());
|
|
37
|
+
}
|
|
38
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
39
|
+
};
|
|
40
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
41
|
+
return ans === answer;
|
|
42
|
+
};
|
|
43
|
+
exports.geometricFirstTermsGeneralSum = {
|
|
44
|
+
id: "geometricFirstTermsGeneralSum",
|
|
45
|
+
connector: "=",
|
|
46
|
+
label: "Somme des termes d'une suite géométrique (cas général)",
|
|
47
|
+
levels: [],
|
|
48
|
+
isSingleStep: true,
|
|
49
|
+
sections: [],
|
|
50
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getGeometricFirstTermsGeneralSumQuestion, nb),
|
|
51
|
+
qcmTimer: 60,
|
|
52
|
+
freeTimer: 60,
|
|
53
|
+
getPropositions,
|
|
54
|
+
isAnswerValid,
|
|
55
|
+
subject: "Mathématiques",
|
|
56
|
+
};
|
|
@@ -7,4 +7,5 @@ export * from "./geometricRecurrenceFormulaUsage";
|
|
|
7
7
|
export * from "./geometricFindExplicitFormulaFirstTermRandom";
|
|
8
8
|
export * from "./geometricFindTerm";
|
|
9
9
|
export * from "./geometricRecognizeReasonFromFirstTerms";
|
|
10
|
+
export * from "./geometricFirstTermsGeneralSum";
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qBAAqB,CAAC;AACpC,cAAc,0CAA0C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/geometric/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,qBAAqB,CAAC;AACpC,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC"}
|
|
@@ -23,3 +23,4 @@ __exportStar(require("./geometricRecurrenceFormulaUsage"), exports);
|
|
|
23
23
|
__exportStar(require("./geometricFindExplicitFormulaFirstTermRandom"), exports);
|
|
24
24
|
__exportStar(require("./geometricFindTerm"), exports);
|
|
25
25
|
__exportStar(require("./geometricRecognizeReasonFromFirstTerms"), exports);
|
|
26
|
+
__exportStar(require("./geometricFirstTermsGeneralSum"), exports);
|
|
@@ -3,4 +3,6 @@ export * from "./geometric";
|
|
|
3
3
|
export * from "./explicitFormulaUsage";
|
|
4
4
|
export * from "./genericSequenceVariations";
|
|
5
5
|
export * from "./recurrenceFormulaUsage";
|
|
6
|
+
export * from "./sequenceEvaluation";
|
|
7
|
+
export * from "./sequencePlot";
|
|
6
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
|
|
@@ -19,3 +19,5 @@ __exportStar(require("./geometric"), exports);
|
|
|
19
19
|
__exportStar(require("./explicitFormulaUsage"), exports);
|
|
20
20
|
__exportStar(require("./genericSequenceVariations"), exports);
|
|
21
21
|
__exportStar(require("./recurrenceFormulaUsage"), exports);
|
|
22
|
+
__exportStar(require("./sequenceEvaluation"), exports);
|
|
23
|
+
__exportStar(require("./sequencePlot"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
termeid: number;
|
|
4
|
+
affine: number[];
|
|
5
|
+
termeAdd: number;
|
|
6
|
+
termeMult: number;
|
|
7
|
+
};
|
|
8
|
+
export declare const sequenceEvaluation: Exercise<Identifiers>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=sequenceEvaluation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequenceEvaluation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/sequenceEvaluation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAYlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoLF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAapD,CAAC"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sequenceEvaluation = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const affine_1 = require("../../../math/polynomials/affine");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
9
|
+
const addNode_1 = require("../../../tree/nodes/operators/addNode");
|
|
10
|
+
const multiplyNode_1 = require("../../../tree/nodes/operators/multiplyNode");
|
|
11
|
+
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
12
|
+
const getSequenceEvaluationQuestion = () => {
|
|
13
|
+
const termeid = (0, randint_1.randint)(1, 3);
|
|
14
|
+
const a = (0, randint_1.randint)(-10, 10, [0]);
|
|
15
|
+
const b = (0, randint_1.randint)(-10, 10);
|
|
16
|
+
const affine = new affine_1.Affine(a, b, "n");
|
|
17
|
+
let terme;
|
|
18
|
+
let termeAdd = 0;
|
|
19
|
+
let termeMult = 1;
|
|
20
|
+
if (termeid === 1) {
|
|
21
|
+
termeAdd = (0, randint_1.randint)(1, 4);
|
|
22
|
+
terme = new addNode_1.AddNode(new variableNode_1.VariableNode("n"), new numberNode_1.NumberNode(termeAdd));
|
|
23
|
+
}
|
|
24
|
+
else if (termeid === 2) {
|
|
25
|
+
termeMult = (0, randint_1.randint)(2, 4);
|
|
26
|
+
terme = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(termeMult), new variableNode_1.VariableNode("n"));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
termeAdd = (0, randint_1.randint)(1, 4);
|
|
30
|
+
termeMult = (0, randint_1.randint)(1, 4);
|
|
31
|
+
terme = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(termeMult), new variableNode_1.VariableNode("n")), new numberNode_1.NumberNode(termeAdd));
|
|
32
|
+
}
|
|
33
|
+
let answer;
|
|
34
|
+
if (termeid === 1) {
|
|
35
|
+
const innerTerm = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new variableNode_1.VariableNode("n")), new numberNode_1.NumberNode(a * termeAdd));
|
|
36
|
+
answer = new addNode_1.AddNode(innerTerm, new numberNode_1.NumberNode(b)).simplify({
|
|
37
|
+
forbidFactorize: true,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
else if (termeid === 2) {
|
|
41
|
+
const innerTerm = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a * termeMult), new variableNode_1.VariableNode("n"));
|
|
42
|
+
answer = new addNode_1.AddNode(innerTerm, new numberNode_1.NumberNode(b)).simplify({
|
|
43
|
+
forbidFactorize: true,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
const innerTerm = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a * termeMult), new variableNode_1.VariableNode("n")), new numberNode_1.NumberNode(a * termeAdd));
|
|
48
|
+
answer = new addNode_1.AddNode(innerTerm, new numberNode_1.NumberNode(b)).simplify({
|
|
49
|
+
forbidFactorize: true,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const question = {
|
|
53
|
+
answer: answer.toTex(),
|
|
54
|
+
instruction: `Soit $(u_n)$ une suite telle que $u_n = ${affine.toTex()}$. Exprimer $u_{${terme.toTex()}}$.`,
|
|
55
|
+
keys: ["n"],
|
|
56
|
+
answerFormat: "tex",
|
|
57
|
+
identifiers: {
|
|
58
|
+
termeid,
|
|
59
|
+
affine: [a, b],
|
|
60
|
+
termeAdd,
|
|
61
|
+
termeMult,
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
return question;
|
|
65
|
+
};
|
|
66
|
+
const getPropositions = (n, { answer, termeid, affine, termeAdd, termeMult }) => {
|
|
67
|
+
const propositions = [];
|
|
68
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
69
|
+
const a = affine[0];
|
|
70
|
+
const b = affine[1];
|
|
71
|
+
let wrongAnswer;
|
|
72
|
+
if (termeid === 1) {
|
|
73
|
+
const wrongInnerTerm = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new variableNode_1.VariableNode("n")), new numberNode_1.NumberNode(a * (termeAdd + (0, randint_1.randint)(-2, 2))));
|
|
74
|
+
wrongAnswer = new addNode_1.AddNode(wrongInnerTerm, new numberNode_1.NumberNode(b + (0, randint_1.randint)(-5, 5))).simplify({
|
|
75
|
+
forbidFactorize: true,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
else if (termeid === 2) {
|
|
79
|
+
const wrongInnerTerm = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a * (termeMult + (0, randint_1.randint)(-1, 1))), new variableNode_1.VariableNode("n"));
|
|
80
|
+
wrongAnswer = new addNode_1.AddNode(wrongInnerTerm, new numberNode_1.NumberNode(b + (0, randint_1.randint)(-5, 5))).simplify({
|
|
81
|
+
forbidFactorize: true,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
const wrongInnerTerm = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a * (termeMult + (0, randint_1.randint)(-1, 1))), new variableNode_1.VariableNode("n")), new numberNode_1.NumberNode(a * (termeAdd + (0, randint_1.randint)(-2, 2))));
|
|
86
|
+
wrongAnswer = new addNode_1.AddNode(wrongInnerTerm, new numberNode_1.NumberNode(b + (0, randint_1.randint)(-5, 5))).simplify({
|
|
87
|
+
forbidFactorize: true,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer.toTex());
|
|
91
|
+
while (propositions.length < n) {
|
|
92
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, new affine_1.Affine((0, randint_1.randint)(-10, 10, [0]), (0, randint_1.randint)(-10, 10), "n").toTree().toTex());
|
|
93
|
+
}
|
|
94
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
95
|
+
};
|
|
96
|
+
const isAnswerValid = (ans, { affine, termeid, termeAdd, termeMult }) => {
|
|
97
|
+
const a = affine[0];
|
|
98
|
+
const b = affine[1];
|
|
99
|
+
let terme;
|
|
100
|
+
if (termeid === 1) {
|
|
101
|
+
terme = new addNode_1.AddNode(new variableNode_1.VariableNode("n"), new numberNode_1.NumberNode(termeAdd));
|
|
102
|
+
}
|
|
103
|
+
else if (termeid === 2) {
|
|
104
|
+
terme = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(termeMult), new variableNode_1.VariableNode("n"));
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
terme = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(termeMult), new variableNode_1.VariableNode("n")), new numberNode_1.NumberNode(termeAdd));
|
|
108
|
+
}
|
|
109
|
+
let validanswer;
|
|
110
|
+
if (termeid === 1) {
|
|
111
|
+
const innerTerm = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new variableNode_1.VariableNode("n")), new numberNode_1.NumberNode(a * termeAdd));
|
|
112
|
+
validanswer = new addNode_1.AddNode(innerTerm, new numberNode_1.NumberNode(b)).simplify({
|
|
113
|
+
forbidFactorize: true,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
else if (termeid === 2) {
|
|
117
|
+
const innerTerm = new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a * termeMult), new variableNode_1.VariableNode("n"));
|
|
118
|
+
validanswer = new addNode_1.AddNode(innerTerm, new numberNode_1.NumberNode(b)).simplify({
|
|
119
|
+
forbidFactorize: true,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
const innerTerm = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a * termeMult), new variableNode_1.VariableNode("n")), new numberNode_1.NumberNode(a * termeAdd));
|
|
124
|
+
validanswer = new addNode_1.AddNode(innerTerm, new numberNode_1.NumberNode(b)).simplify({
|
|
125
|
+
forbidFactorize: true,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
const latexs = validanswer.toAllValidTexs();
|
|
129
|
+
return latexs.includes(ans);
|
|
130
|
+
};
|
|
131
|
+
exports.sequenceEvaluation = {
|
|
132
|
+
id: "sequenceEvaluation",
|
|
133
|
+
label: "Exprimer $u_{f(n)}$ en connaissant $u_n$",
|
|
134
|
+
levels: ["1reSpé"],
|
|
135
|
+
isSingleStep: true,
|
|
136
|
+
sections: ["Suites"],
|
|
137
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSequenceEvaluationQuestion, nb),
|
|
138
|
+
qcmTimer: 60,
|
|
139
|
+
freeTimer: 60,
|
|
140
|
+
getPropositions,
|
|
141
|
+
isAnswerValid,
|
|
142
|
+
subject: "Mathématiques",
|
|
143
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
nValue: number;
|
|
4
|
+
points: number[][];
|
|
5
|
+
isArithmetic: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const sequencePlot: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=sequencePlot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequencePlot.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sequences/sequencePlot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,YAAY,EAAE,OAAO,CAAC;CACvB,CAAC;AA2FF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,WAAW,CAe9C,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sequencePlot = void 0;
|
|
4
|
+
const exercise_1 = require("../../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const randfloat_1 = require("../../../math/utils/random/randfloat");
|
|
7
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
8
|
+
const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
|
|
9
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
10
|
+
const getSequencePlotQuestion = () => {
|
|
11
|
+
const isArithmetic = (0, coinFlip_1.coinFlip)();
|
|
12
|
+
const a = isArithmetic ? (0, randfloat_1.randfloat)(0.1, 0.5, 1) : (0, randfloat_1.randfloat)(1.01, 1.1, 2);
|
|
13
|
+
const b = (0, randint_1.randint)(2, 10);
|
|
14
|
+
const nMax = 10;
|
|
15
|
+
const points = [];
|
|
16
|
+
for (let n = 0; n <= nMax; n++) {
|
|
17
|
+
let u_n;
|
|
18
|
+
if (isArithmetic) {
|
|
19
|
+
const noise = (0, randfloat_1.randfloat)(-2, 2, 1);
|
|
20
|
+
u_n = a * n + b + noise;
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const noise = (0, randfloat_1.randfloat)(-2, 2, 1);
|
|
24
|
+
u_n = b * Math.pow(a, n) + noise;
|
|
25
|
+
}
|
|
26
|
+
points.push([n, Math.round(u_n)]);
|
|
27
|
+
}
|
|
28
|
+
const nValue = (0, randint_1.randint)(0, nMax);
|
|
29
|
+
const u_nValue = points[nValue][1];
|
|
30
|
+
const commands = points.map((point, index) => {
|
|
31
|
+
return `A${index}=(${point[0]},${point[1]})`;
|
|
32
|
+
});
|
|
33
|
+
commands.push(...points.map((_, index) => {
|
|
34
|
+
return `SetFixed(A${index},true)`;
|
|
35
|
+
}), ...points.map((_, index) => {
|
|
36
|
+
return `SetLabelMode(A${index},1)`;
|
|
37
|
+
}));
|
|
38
|
+
const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
|
|
39
|
+
hideAxes: false,
|
|
40
|
+
hideGrid: false,
|
|
41
|
+
isXAxesNatural: true,
|
|
42
|
+
isGridSimple: true,
|
|
43
|
+
});
|
|
44
|
+
const answer = u_nValue.toString();
|
|
45
|
+
const question = {
|
|
46
|
+
answer,
|
|
47
|
+
instruction: `Ci-dessous est tracé un nuage de points représentant les valeurs d'une suite $(u_n)$. Quelle est la valeur de $u_{${nValue}}$ ?`,
|
|
48
|
+
commands: ggb.commands,
|
|
49
|
+
options: ggb.getOptions(),
|
|
50
|
+
coords: ggb.getAdaptedCoords({
|
|
51
|
+
xMin: 0,
|
|
52
|
+
xMax: nMax,
|
|
53
|
+
yMin: Math.min(...points.map((p) => p[1])) - 2,
|
|
54
|
+
yMax: Math.max(...points.map((p) => p[1])) + 2,
|
|
55
|
+
}),
|
|
56
|
+
keys: [],
|
|
57
|
+
answerFormat: "raw",
|
|
58
|
+
identifiers: { nValue, points, isArithmetic },
|
|
59
|
+
hint: `$u_{${nValue}}$ est l'ordonnée du point d'absicsse $${nValue}$ dans le nuage de points.`,
|
|
60
|
+
correction: `$u_{${nValue}}$ est l'ordonnée du point d'absicsse $${nValue}$ dans le nuage de points.
|
|
61
|
+
|
|
62
|
+
On lit donc : $u_{${nValue}}=${answer}$.
|
|
63
|
+
`,
|
|
64
|
+
};
|
|
65
|
+
return question;
|
|
66
|
+
};
|
|
67
|
+
const getPropositions = (n, { answer, nValue, points }) => {
|
|
68
|
+
const propositions = [];
|
|
69
|
+
(0, exercise_1.addValidProp)(propositions, answer);
|
|
70
|
+
const correctValue = parseInt(answer);
|
|
71
|
+
while (propositions.length < n) {
|
|
72
|
+
const wrongAnswer = (correctValue + (0, randint_1.randint)(-2, 2)).toString();
|
|
73
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer);
|
|
74
|
+
}
|
|
75
|
+
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
76
|
+
};
|
|
77
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
78
|
+
return ans === answer;
|
|
79
|
+
};
|
|
80
|
+
exports.sequencePlot = {
|
|
81
|
+
id: "sequencePlot",
|
|
82
|
+
label: "Lire graphiquement un terme d'une suite à partir d'un nuage de points",
|
|
83
|
+
levels: ["1reSpé"],
|
|
84
|
+
isSingleStep: true,
|
|
85
|
+
hasGeogebra: true,
|
|
86
|
+
sections: ["Suites"],
|
|
87
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSequencePlotQuestion, nb),
|
|
88
|
+
qcmTimer: 60,
|
|
89
|
+
freeTimer: 60,
|
|
90
|
+
getPropositions,
|
|
91
|
+
isAnswerValid,
|
|
92
|
+
subject: "Mathématiques",
|
|
93
|
+
hasHintAndCorrection: true,
|
|
94
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAQT,MAAM,0BAA0B,CAAC;AAOlC,OAAO,EAAW,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAQrE,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AA6EF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAevD,CAAC"}
|
|
@@ -4,11 +4,13 @@ exports.intervalsIntersection = void 0;
|
|
|
4
4
|
const exercise_1 = require("../../../../exercises/exercise");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const intervals_1 = require("../../../../math/sets/intervals/intervals");
|
|
7
|
+
const discreteSetNode_1 = require("../../../../tree/nodes/sets/discreteSetNode");
|
|
8
|
+
const intervalNode_1 = require("../../../../tree/nodes/sets/intervalNode");
|
|
7
9
|
const shuffle_1 = require("../../../../utils/shuffle");
|
|
8
10
|
const getIntervalsIntersectionQuestion = () => {
|
|
9
11
|
const [int1, int2] = intervals_1.IntervalConstructor.differentRandoms(2);
|
|
10
12
|
const inter = int1.intersection(int2);
|
|
11
|
-
const answer = inter.
|
|
13
|
+
const answer = inter.toTex();
|
|
12
14
|
const question = {
|
|
13
15
|
answer,
|
|
14
16
|
instruction: `Soit $I = ${int1.toTex()}$ et $J = ${int2.toTex()}$. Déterminer $I\\cap J$.`,
|
|
@@ -20,6 +22,8 @@ const getIntervalsIntersectionQuestion = () => {
|
|
|
20
22
|
"semicolon",
|
|
21
23
|
"cup",
|
|
22
24
|
"cap",
|
|
25
|
+
"lbrace",
|
|
26
|
+
"rbrace",
|
|
23
27
|
],
|
|
24
28
|
answerFormat: "tex",
|
|
25
29
|
identifiers: {
|
|
@@ -30,6 +34,19 @@ const getIntervalsIntersectionQuestion = () => {
|
|
|
30
34
|
int2Max: int2.max,
|
|
31
35
|
int2Min: int2.min,
|
|
32
36
|
},
|
|
37
|
+
hint: `Détermine l'ensemble des nombres qui appartiennent à la fois à $I$ et à $J$.`,
|
|
38
|
+
correction: `$I$ contient les nombres ${int1.toTree().toText(true, false)}.
|
|
39
|
+
|
|
40
|
+
$J$ contient les nombres ${int2.toTree().toText(false, false)}.
|
|
41
|
+
|
|
42
|
+
${(0, discreteSetNode_1.isDiscreteSetNode)(inter) && inter.elements.length === 0
|
|
43
|
+
? `Il n'y a donc aucun nombre commun aux intervalles $I$ et $J$.`
|
|
44
|
+
: (0, discreteSetNode_1.isDiscreteSetNode)(inter) && inter.elements.length === 1
|
|
45
|
+
? `Il n'y a donc qu'un nombre commun aux intervalles $I$ et $J$ : $${inter.elements[0].toTex()}$.`
|
|
46
|
+
: (0, intervalNode_1.isIntervalNode)(inter) &&
|
|
47
|
+
`Les nombres communs à $I$ et $J$ sont donc les nombres ${inter.toText(true, false)}.`}
|
|
48
|
+
|
|
49
|
+
Ainsi, $I\\cap J = ${answer}$`,
|
|
33
50
|
};
|
|
34
51
|
return question;
|
|
35
52
|
};
|
|
@@ -61,4 +78,5 @@ exports.intervalsIntersection = {
|
|
|
61
78
|
getPropositions,
|
|
62
79
|
isAnswerValid,
|
|
63
80
|
subject: "Mathématiques",
|
|
81
|
+
hasHintAndCorrection: true,
|
|
64
82
|
};
|
|
@@ -30,7 +30,7 @@ const getPropositions = (n, { answer, int1Closure, int1Max, int1Min, int2Closure
|
|
|
30
30
|
(0, exercise_1.addValidProp)(propositions, answer);
|
|
31
31
|
const int1 = new intervals_1.Interval(int1Min.toTree(), int1Max.toTree(), int1Closure);
|
|
32
32
|
const int2 = new intervals_1.Interval(int2Min.toTree(), int2Max.toTree(), int2Closure);
|
|
33
|
-
(0, exercise_1.tryToAddWrongProp)(propositions, int1.intersection(int2).
|
|
33
|
+
(0, exercise_1.tryToAddWrongProp)(propositions, int1.intersection(int2).toTex());
|
|
34
34
|
while (propositions.length < n) {
|
|
35
35
|
const wrongAnswer = intervals_1.IntervalConstructor.random().tex;
|
|
36
36
|
(0, exercise_1.tryToAddWrongProp)(propositions, wrongAnswer);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arcValue.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/arcValue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"arcValue.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/trigonometry/arcValue.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,0BAA0B,CAAC;AAclC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA6FF,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,WAAW,CAa1C,CAAC"}
|
|
@@ -5,10 +5,15 @@ const exercise_1 = require("../../../exercises/exercise");
|
|
|
5
5
|
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
6
6
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
7
7
|
const round_1 = require("../../../math/utils/round");
|
|
8
|
+
const numberNode_1 = require("../../../tree/nodes/numbers/numberNode");
|
|
8
9
|
const sinNode_1 = require("../../../tree/nodes/functions/sinNode");
|
|
9
10
|
const cosNode_1 = require("../../../tree/nodes/functions/cosNode");
|
|
10
11
|
const tanNode_1 = require("../../../tree/nodes/functions/tanNode");
|
|
11
12
|
const variableNode_1 = require("../../../tree/nodes/variables/variableNode");
|
|
13
|
+
const arcSinNode_1 = require("../../../tree/nodes/functions/arcSinNode");
|
|
14
|
+
const arccosNode_1 = require("../../../tree/nodes/functions/arccosNode");
|
|
15
|
+
const alignTex_1 = require("../../../utils/alignTex");
|
|
16
|
+
const arctanNode_1 = require("../../../tree/nodes/functions/arctanNode");
|
|
12
17
|
const getArcValueQuestion = () => {
|
|
13
18
|
const trigFunctions = ["sin", "cos", "tan"];
|
|
14
19
|
const selectedFunction = trigFunctions[(0, randint_1.randint)(0, trigFunctions.length)];
|
|
@@ -41,6 +46,11 @@ const getArcValueQuestion = () => {
|
|
|
41
46
|
: selectedFunction === "cos"
|
|
42
47
|
? new cosNode_1.CosNode(new variableNode_1.VariableNode("\\theta"))
|
|
43
48
|
: new tanNode_1.TanNode(new variableNode_1.VariableNode("\\theta"));
|
|
49
|
+
const reciprocalFunction = selectedFunction === "sin"
|
|
50
|
+
? { name: "arcsin", otherName: "\\sin^{-1}", node: arcSinNode_1.ArcsinNode }
|
|
51
|
+
: selectedFunction === "cos"
|
|
52
|
+
? { name: "arccos", otherName: "\\cos^{-1}", node: arccosNode_1.ArccosNode }
|
|
53
|
+
: { name: "arctan", otherName: "\\tan^{-1}", node: arctanNode_1.ArctanNode };
|
|
44
54
|
const instruction = `Quelle est la valeur en degrés de l'angle $\\theta$ sachant que $${trigNode.toTex()} = ${trigValue.frenchify()}$ ? Arrondir à l'unité.`;
|
|
45
55
|
const answer = (0, round_1.round)(angleInDegrees, 0).toTree().toTex();
|
|
46
56
|
const question = {
|
|
@@ -48,6 +58,18 @@ const getArcValueQuestion = () => {
|
|
|
48
58
|
instruction: instruction,
|
|
49
59
|
keys: [],
|
|
50
60
|
answerFormat: "tex",
|
|
61
|
+
hint: `La valeur de $\\theta$ s'obtient en calculant l'${reciprocalFunction.name} (ou $${reciprocalFunction.otherName}$) de la valeur $${trigValue.frenchify()}$, avec la calculatrice.`,
|
|
62
|
+
correction: `On calcule l'${reciprocalFunction.name} (ou $${reciprocalFunction.otherName}$) de $${trigValue.frenchify()}$ avec la calculatrice :
|
|
63
|
+
|
|
64
|
+
${(0, alignTex_1.alignTex)([
|
|
65
|
+
[
|
|
66
|
+
`${new reciprocalFunction.node(new numberNode_1.NumberNode(trigValue)).toTex()}`,
|
|
67
|
+
"\\approx",
|
|
68
|
+
(0, round_1.round)(angleInDegrees, 3).toTree().toTex(),
|
|
69
|
+
],
|
|
70
|
+
])}
|
|
71
|
+
|
|
72
|
+
En arrondissant à l'unité, on a donc $\\theta \\approx ${answer}°$.`,
|
|
51
73
|
identifiers: { trigFunction: selectedFunction, trigValue, angleInDegrees },
|
|
52
74
|
};
|
|
53
75
|
return question;
|
|
@@ -75,4 +97,5 @@ exports.arcValue = {
|
|
|
75
97
|
getPropositions,
|
|
76
98
|
isAnswerValid,
|
|
77
99
|
subject: "Mathématiques",
|
|
100
|
+
hasHintAndCorrection: true,
|
|
78
101
|
};
|