math-exercises 3.0.186 → 3.0.188
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/derivative/exp/expDerivativeProductFExp.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.js +22 -6
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.js +16 -8
- package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberAndImageReading.d.ts +9 -0
- package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberAndImageReading.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/derivativeNumberAndImageReading.js +155 -0
- package/lib/exercises/math/derivation/derivativeNumber/index.d.ts +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/index.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivativeNumber/index.js +1 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts.map +1 -1
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.js +80 -29
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -1
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +30 -2
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -1
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +59 -16
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts.map +1 -1
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.js +0 -4
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +23 -9
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +5 -29
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +2 -7
- package/lib/exercises/math/functions/basics/inverseImageFunction.js +1 -1
- package/lib/exercises/math/functions/sign/affineSignTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/sign/affineSignTable.js +1 -1
- package/lib/exercises/math/functions/sign/equationFromSignTable.d.ts +1 -0
- package/lib/exercises/math/functions/sign/equationFromSignTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/sign/equationFromSignTable.js +60 -33
- package/lib/exercises/math/functions/sign/partialSignTableFromGraph.d.ts +6 -4
- package/lib/exercises/math/functions/sign/partialSignTableFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/sign/partialSignTableFromGraph.js +160 -63
- package/lib/exercises/math/functions/sign/readSignTable.d.ts +4 -1
- package/lib/exercises/math/functions/sign/readSignTable.d.ts.map +1 -1
- package/lib/exercises/math/functions/sign/readSignTable.js +32 -9
- package/lib/exercises/math/functions/sign/signTableFromGraph.d.ts +6 -4
- package/lib/exercises/math/functions/sign/signTableFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/sign/signTableFromGraph.js +160 -57
- package/lib/exercises/math/percent/evolutions/averageEvolutionRateFromStartAndEndValue.d.ts +9 -0
- package/lib/exercises/math/percent/evolutions/averageEvolutionRateFromStartAndEndValue.d.ts.map +1 -0
- package/lib/exercises/math/percent/evolutions/averageEvolutionRateFromStartAndEndValue.js +135 -0
- package/lib/exercises/math/percent/evolutions/index.d.ts +1 -0
- package/lib/exercises/math/percent/evolutions/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/evolutions/index.js +1 -0
- package/lib/exercises/math/powers/equationOnePlusTPowerN.d.ts +9 -0
- package/lib/exercises/math/powers/equationOnePlusTPowerN.d.ts.map +1 -0
- package/lib/exercises/math/powers/equationOnePlusTPowerN.js +118 -0
- package/lib/exercises/math/powers/estimateNthRoot.d.ts +13 -0
- package/lib/exercises/math/powers/estimateNthRoot.d.ts.map +1 -0
- package/lib/exercises/math/powers/estimateNthRoot.js +126 -0
- package/lib/exercises/math/powers/index.d.ts +3 -0
- package/lib/exercises/math/powers/index.d.ts.map +1 -1
- package/lib/exercises/math/powers/index.js +3 -0
- package/lib/exercises/math/powers/solveNthRootEquation.d.ts +9 -0
- package/lib/exercises/math/powers/solveNthRootEquation.d.ts.map +1 -0
- package/lib/exercises/math/powers/solveNthRootEquation.js +111 -0
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.js +2 -2
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.js +1 -1
- package/lib/exercises/vea/percentVEA.d.ts +6 -1
- package/lib/exercises/vea/percentVEA.d.ts.map +1 -1
- package/lib/exercises/vea/percentVEA.js +15 -1
- package/lib/index.d.ts +34 -9
- package/lib/index.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +5 -8
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +1 -3
- package/lib/math/utils/sequences/situations/seqGeometricSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqGeometricSituations.js +8 -10
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +8 -0
- package/lib/tree/nodes/sets/closure.d.ts +1 -0
- package/lib/tree/nodes/sets/closure.d.ts.map +1 -1
- package/lib/tree/nodes/sets/closure.js +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, GeneratorOptionType, GeneratorOptionTarget, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { randfloat } from "../../../math/utils/random/randfloat.js";
|
|
5
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
|
+
import { round } from "../../../math/utils/round.js";
|
|
7
|
+
import { reifyAlgebraic, } from "../../../tree/nodes/nodeConstructor.js";
|
|
8
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
9
|
+
import { power } from "../../../tree/nodes/operators/powerNode.js";
|
|
10
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
11
|
+
const getPropositions = (n, { answer }) => {
|
|
12
|
+
const propositions = [];
|
|
13
|
+
addValidProp(propositions, answer);
|
|
14
|
+
propWhile(propositions, n, () => {
|
|
15
|
+
tryToAddWrongProp(propositions, randfloat(0.1, 3, 2).frenchify());
|
|
16
|
+
});
|
|
17
|
+
return shuffleProps(propositions, n);
|
|
18
|
+
};
|
|
19
|
+
const getAnswer = (identifiers) => {
|
|
20
|
+
const { aIds, nIds } = identifiers;
|
|
21
|
+
const a = reifyAlgebraic(aIds);
|
|
22
|
+
const n = reifyAlgebraic(nIds);
|
|
23
|
+
const value = Math.pow(a.evaluate(), 1 / n.evaluate());
|
|
24
|
+
return round(value, 2).frenchify();
|
|
25
|
+
};
|
|
26
|
+
const getStatement = (identifiers) => {
|
|
27
|
+
const { writeAsRoot, aIds, nIds } = identifiers;
|
|
28
|
+
const a = reifyAlgebraic(aIds);
|
|
29
|
+
const n = reifyAlgebraic(nIds);
|
|
30
|
+
return writeAsRoot
|
|
31
|
+
? `\\sqrt[${n.evaluate()}]{${a.toTex()}}`
|
|
32
|
+
: `${power(a, frac(1, n)).toTex()}`;
|
|
33
|
+
};
|
|
34
|
+
const getInstruction = (identifiers) => {
|
|
35
|
+
const { aIds, nIds } = identifiers;
|
|
36
|
+
const a = reifyAlgebraic(aIds);
|
|
37
|
+
const n = reifyAlgebraic(nIds);
|
|
38
|
+
const value = Math.pow(a.evaluate(), 1 / n.evaluate());
|
|
39
|
+
const isExact = round(value, 2) === value;
|
|
40
|
+
return `Calculer :
|
|
41
|
+
|
|
42
|
+
$$
|
|
43
|
+
${getStatement(identifiers)}
|
|
44
|
+
$$
|
|
45
|
+
|
|
46
|
+
${isExact
|
|
47
|
+
? `Donner la valeur exacte.`
|
|
48
|
+
: `Donner une valeur arrondie au centième.`}
|
|
49
|
+
`;
|
|
50
|
+
};
|
|
51
|
+
const getHint = () => {
|
|
52
|
+
return `Sers-toi de la calculatrice.`;
|
|
53
|
+
};
|
|
54
|
+
const getCorrection = (identifiers) => {
|
|
55
|
+
const { aIds, nIds } = identifiers;
|
|
56
|
+
const a = reifyAlgebraic(aIds);
|
|
57
|
+
const n = reifyAlgebraic(nIds);
|
|
58
|
+
const value = Math.pow(a.evaluate(), 1 / n.evaluate());
|
|
59
|
+
const isExact = round(value, 2) === value;
|
|
60
|
+
return `On utilise la calculatrice :
|
|
61
|
+
|
|
62
|
+
$$
|
|
63
|
+
${getStatement(identifiers)} ${isExact ? "=" : "\\approx"} ${getAnswer(identifiers)}
|
|
64
|
+
$$`;
|
|
65
|
+
};
|
|
66
|
+
const getKeys = () => {
|
|
67
|
+
return [];
|
|
68
|
+
};
|
|
69
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
70
|
+
try {
|
|
71
|
+
return numberVEA(ans, answer);
|
|
72
|
+
}
|
|
73
|
+
catch (err) {
|
|
74
|
+
return handleVEAError(err);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
const getEstimateNthRootQuestion = (ops) => {
|
|
78
|
+
const writeAsRoot = !!ops?.writeAsRoot;
|
|
79
|
+
const a = randint(2, 20).toTree();
|
|
80
|
+
const n = randint(3, 20).toTree();
|
|
81
|
+
const identifiers = {
|
|
82
|
+
aIds: a.toIdentifiers(),
|
|
83
|
+
nIds: n.toIdentifiers(),
|
|
84
|
+
writeAsRoot,
|
|
85
|
+
};
|
|
86
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
87
|
+
};
|
|
88
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
89
|
+
return {
|
|
90
|
+
answer: getAnswer(identifiers),
|
|
91
|
+
instruction: getInstruction(identifiers),
|
|
92
|
+
keys: getKeys(identifiers),
|
|
93
|
+
answerFormat: "tex",
|
|
94
|
+
identifiers,
|
|
95
|
+
hint: getHint(identifiers),
|
|
96
|
+
correction: getCorrection(identifiers),
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
const options = [
|
|
100
|
+
{
|
|
101
|
+
id: "writeAsRoot",
|
|
102
|
+
label: "Écrire comme racine $n$-ème $\\sqrt[n]{a}$",
|
|
103
|
+
type: GeneratorOptionType.checkbox,
|
|
104
|
+
target: GeneratorOptionTarget.instruction,
|
|
105
|
+
defaultValue: false,
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
export const estimateNthRoot = {
|
|
109
|
+
id: "estimateNthRoot",
|
|
110
|
+
connector: "=",
|
|
111
|
+
label: "Calculer une puissance du type $a^{\\frac{1}{n}}$ (racine $n$-ième) avec la calculatrice",
|
|
112
|
+
isSingleStep: true,
|
|
113
|
+
generator: (nb, opts) => getDistinctQuestions(() => getEstimateNthRootQuestion(opts), nb),
|
|
114
|
+
qcmTimer: 60,
|
|
115
|
+
freeTimer: 60,
|
|
116
|
+
getPropositions,
|
|
117
|
+
isAnswerValid,
|
|
118
|
+
subject: "Mathématiques",
|
|
119
|
+
getInstruction,
|
|
120
|
+
getHint,
|
|
121
|
+
getCorrection,
|
|
122
|
+
getAnswer,
|
|
123
|
+
getQuestionFromIdentifiers,
|
|
124
|
+
hasHintAndCorrection: true,
|
|
125
|
+
options,
|
|
126
|
+
};
|
|
@@ -10,4 +10,7 @@ export * from "./scientificToDecimal.js";
|
|
|
10
10
|
export * from "./powersMixOperations.js";
|
|
11
11
|
export * from "./powersOfTenMixOperations.js";
|
|
12
12
|
export * from "./powerNotation.js";
|
|
13
|
+
export * from "./estimateNthRoot.js";
|
|
14
|
+
export * from "./solveNthRootEquation.js";
|
|
15
|
+
export * from "./equationOnePlusTPowerN.js";
|
|
13
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC"}
|
|
@@ -10,3 +10,6 @@ export * from "./scientificToDecimal.js";
|
|
|
10
10
|
export * from "./powersMixOperations.js";
|
|
11
11
|
export * from "./powersOfTenMixOperations.js";
|
|
12
12
|
export * from "./powerNotation.js";
|
|
13
|
+
export * from "./estimateNthRoot.js";
|
|
14
|
+
export * from "./solveNthRootEquation.js";
|
|
15
|
+
export * from "./equationOnePlusTPowerN.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
nIds: NodeIdentifiers;
|
|
5
|
+
kIds: NodeIdentifiers;
|
|
6
|
+
};
|
|
7
|
+
export declare const solveNthRootEquation: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=solveNthRootEquation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solveNthRootEquation.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/solveNthRootEquation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IAEjB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AA4FF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,CAkBtD,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { randfloat } from "../../../math/utils/random/randfloat.js";
|
|
5
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
|
+
import { round } from "../../../math/utils/round.js";
|
|
7
|
+
import { reifyAlgebraic, } from "../../../tree/nodes/nodeConstructor.js";
|
|
8
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
9
|
+
import { power } from "../../../tree/nodes/operators/powerNode.js";
|
|
10
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
11
|
+
import { alignTex } from "../../../utils/latex/alignTex.js";
|
|
12
|
+
const getPropositions = (n, { answer }) => {
|
|
13
|
+
const propositions = [];
|
|
14
|
+
addValidProp(propositions, answer);
|
|
15
|
+
propWhile(propositions, n, () => {
|
|
16
|
+
tryToAddWrongProp(propositions, randfloat(1, 3, 2).frenchify());
|
|
17
|
+
});
|
|
18
|
+
return shuffleProps(propositions, n);
|
|
19
|
+
};
|
|
20
|
+
const getAnswer = (identifiers) => {
|
|
21
|
+
const { nIds, kIds } = identifiers;
|
|
22
|
+
const n = reifyAlgebraic(nIds);
|
|
23
|
+
const k = reifyAlgebraic(kIds);
|
|
24
|
+
return round(Math.pow(k.evaluate(), 1 / n.evaluate()), 2).frenchify();
|
|
25
|
+
};
|
|
26
|
+
const getInstruction = (identifiers) => {
|
|
27
|
+
const { nIds, kIds } = identifiers;
|
|
28
|
+
const n = reifyAlgebraic(nIds);
|
|
29
|
+
const k = reifyAlgebraic(kIds);
|
|
30
|
+
return `Résoudre l'équation suivante :
|
|
31
|
+
|
|
32
|
+
$$
|
|
33
|
+
a^${n.toTex()} = ${k.toTex()}
|
|
34
|
+
$$
|
|
35
|
+
|
|
36
|
+
Donner la solution arrondie au centième.`;
|
|
37
|
+
};
|
|
38
|
+
const getHint = () => {
|
|
39
|
+
return `Utilise la propriété suivante :
|
|
40
|
+
|
|
41
|
+
$$
|
|
42
|
+
a^n = k \\iff a = k^{\\frac{1}{n}}
|
|
43
|
+
$$`;
|
|
44
|
+
};
|
|
45
|
+
const getCorrection = (identifiers) => {
|
|
46
|
+
const { nIds, kIds } = identifiers;
|
|
47
|
+
const n = reifyAlgebraic(nIds);
|
|
48
|
+
const k = reifyAlgebraic(kIds);
|
|
49
|
+
return `On sait que :
|
|
50
|
+
|
|
51
|
+
$$
|
|
52
|
+
a^n = k \\iff a = k^{\\frac{1}{n}}
|
|
53
|
+
$$
|
|
54
|
+
|
|
55
|
+
Ici, on a donc :
|
|
56
|
+
|
|
57
|
+
${alignTex([
|
|
58
|
+
["a", "=", power(k, frac(1, n)).toTex()],
|
|
59
|
+
["", "\\approx", getAnswer(identifiers)],
|
|
60
|
+
])}
|
|
61
|
+
`;
|
|
62
|
+
};
|
|
63
|
+
const getKeys = () => {
|
|
64
|
+
return [];
|
|
65
|
+
};
|
|
66
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
67
|
+
try {
|
|
68
|
+
return numberVEA(ans, answer);
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
return handleVEAError(err);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const getSolveNthRootEquationQuestion = () => {
|
|
75
|
+
const n = randint(3, 10);
|
|
76
|
+
const k = randint(2, 10);
|
|
77
|
+
const identifiers = {
|
|
78
|
+
nIds: n.toTree().toIdentifiers(),
|
|
79
|
+
kIds: k.toTree().toIdentifiers(),
|
|
80
|
+
};
|
|
81
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
82
|
+
};
|
|
83
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
84
|
+
return {
|
|
85
|
+
answer: getAnswer(identifiers),
|
|
86
|
+
instruction: getInstruction(identifiers),
|
|
87
|
+
keys: getKeys(identifiers),
|
|
88
|
+
answerFormat: "tex",
|
|
89
|
+
identifiers,
|
|
90
|
+
hint: getHint(identifiers),
|
|
91
|
+
correction: getCorrection(identifiers),
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
export const solveNthRootEquation = {
|
|
95
|
+
id: "solveNthRootEquation",
|
|
96
|
+
connector: "=",
|
|
97
|
+
label: "Résoudre une équation du type $a^n = k$, d'inconnue $a$",
|
|
98
|
+
isSingleStep: true,
|
|
99
|
+
generator: (nb, opts) => getDistinctQuestions(() => getSolveNthRootEquationQuestion(opts), nb),
|
|
100
|
+
qcmTimer: 60,
|
|
101
|
+
freeTimer: 60,
|
|
102
|
+
getPropositions,
|
|
103
|
+
isAnswerValid,
|
|
104
|
+
subject: "Mathématiques",
|
|
105
|
+
getInstruction,
|
|
106
|
+
getHint,
|
|
107
|
+
getCorrection,
|
|
108
|
+
getAnswer,
|
|
109
|
+
getQuestionFromIdentifiers,
|
|
110
|
+
hasHintAndCorrection: true,
|
|
111
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticFindRecurrenceFormulaFromSituation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wDAAwD,CAAC;AAGhE,OAAO,EAEL,kCAAkC,EAEnC,MAAM,kEAAkE,CAAC;AAW1E,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,kCAAkC,CAAC;CACtD,CAAC;
|
|
1
|
+
{"version":3,"file":"arithmeticFindRecurrenceFormulaFromSituation.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/arithmetic/situations/arithmeticFindRecurrenceFormulaFromSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEL,sBAAsB,EACvB,MAAM,mDAAmD,CAAC;AAC3D,OAAO,EAEL,2BAA2B,EAC5B,MAAM,wDAAwD,CAAC;AAGhE,OAAO,EAEL,kCAAkC,EAEnC,MAAM,kEAAkE,CAAC;AAW1E,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,kCAAkC,CAAC;CACtD,CAAC;AAmRF,KAAK,OAAO,GAAG,sBAAsB,GAAG,2BAA2B,CAAC;AAcpE,eAAO,MAAM,4CAA4C,EAAE,QAAQ,CACjE,WAAW,EACX,OAAO,CAoBR,CAAC"}
|
|
@@ -24,7 +24,7 @@ const getAnswerNode = (identifiers, opts) => {
|
|
|
24
24
|
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
25
25
|
const { situationIndex, initial, reason } = identifiers;
|
|
26
26
|
const situation = situations[situationIndex];
|
|
27
|
-
return situation.variationFindRecurrenceFormula.getAnswerNode(initial, reason, firstRank);
|
|
27
|
+
return situation.variationFindRecurrenceFormula.getAnswerNode(initial, reason, firstRank, situation.digitsValue);
|
|
28
28
|
};
|
|
29
29
|
const getAnswer = (identifiers, optsIn) => {
|
|
30
30
|
const opts = optsIn ?? optsDefault;
|
|
@@ -42,7 +42,7 @@ const getCorrection = (identifiers, optsIn) => {
|
|
|
42
42
|
const firstRank = opts?.firstTermRankOne ? 1 : 0;
|
|
43
43
|
const { situationIndex, initial, reason } = identifiers;
|
|
44
44
|
const situation = situations[situationIndex];
|
|
45
|
-
return situation.variationFindRecurrenceFormula.getCorrectionStuff(initial, reason, firstRank).str;
|
|
45
|
+
return situation.variationFindRecurrenceFormula.getCorrectionStuff(initial, reason, firstRank, situation.digitsValue).str;
|
|
46
46
|
};
|
|
47
47
|
const getPropositions = (n, { answer, ...identifiers }, optsIn) => {
|
|
48
48
|
const opts = optsIn ?? optsDefault;
|
|
@@ -220,7 +220,7 @@ const createRandomIdentifiersRaw = (opts) => {
|
|
|
220
220
|
}
|
|
221
221
|
})();
|
|
222
222
|
const rank1 = randint(firstRank + 1, 5);
|
|
223
|
-
const rank2 = rank1 +
|
|
223
|
+
const rank2 = rank1 + 1;
|
|
224
224
|
function valueForRank(initial, reason, rank) {
|
|
225
225
|
return initial * Math.pow(reason, rank);
|
|
226
226
|
}
|
package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoConsecutiveTerms.js
CHANGED
|
@@ -235,7 +235,7 @@ const options = [generatorOptionFirstTermRankOne];
|
|
|
235
235
|
export const geometricFindRandomTermFromTwoConsecutiveTerms = {
|
|
236
236
|
id: "geometricFindRandomTermFromTwoConsecutiveTerms",
|
|
237
237
|
connector: "=",
|
|
238
|
-
label: "Connaissant deux termes consécutifs d'une suite géométrique,
|
|
238
|
+
label: "Connaissant deux termes consécutifs d'une suite géométrique, calculer un autre terme",
|
|
239
239
|
isSingleStep: true,
|
|
240
240
|
generator: (nb, opts) => getDistinctQuestions(() => getGeometricFindRandomTermFromTwoConsecutiveTermsQuestion(opts), nb),
|
|
241
241
|
options,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percentVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/percentVEA.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"percentVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/percentVEA.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,EAAE,QAAQ,MAAM,YAUrD,CAAC"}
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { frac } from "../../tree/nodes/operators/fractionNode.js";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param ans élève, % accepté ou non
|
|
5
|
+
* @param answer doit être sous forme x%
|
|
6
|
+
*/
|
|
7
|
+
export const percentVEA = (ans, answer) => {
|
|
8
|
+
const rightAnswerPercent = frac(answer.replace("\\%", "").unfrenchify(), 100).evaluate();
|
|
9
|
+
const studentAns = ans.includes("\\%")
|
|
10
|
+
? frac(ans.replace("\\%", "").unfrenchify(), 100).evaluate()
|
|
11
|
+
: ans.unfrenchify();
|
|
12
|
+
if (isNaN(studentAns))
|
|
13
|
+
return false;
|
|
14
|
+
return Math.abs(rightAnswerPercent - studentAns) < 0.00001;
|
|
15
|
+
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1065,6 +1065,10 @@ declare const mathExercises: (Exercise<{
|
|
|
1065
1065
|
arrNodeIdsX: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
|
|
1066
1066
|
nodeIdsF: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1067
1067
|
initTable: string[][];
|
|
1068
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1069
|
+
A: number[];
|
|
1070
|
+
B: number[];
|
|
1071
|
+
coeffs: number[];
|
|
1068
1072
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1069
1073
|
abscisse: number;
|
|
1070
1074
|
trinome: number[];
|
|
@@ -1928,27 +1932,32 @@ declare const mathExercises: (Exercise<{
|
|
|
1928
1932
|
signs: string[];
|
|
1929
1933
|
xs: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
|
|
1930
1934
|
x: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1931
|
-
},
|
|
1932
|
-
|
|
1935
|
+
}, {
|
|
1936
|
+
functionType: string;
|
|
1937
|
+
}> | Exercise<{
|
|
1933
1938
|
a: number;
|
|
1934
1939
|
x1: number;
|
|
1935
|
-
x2
|
|
1936
|
-
x3
|
|
1937
|
-
},
|
|
1940
|
+
x2?: number;
|
|
1941
|
+
x3?: number;
|
|
1942
|
+
}, {
|
|
1943
|
+
functionType: string;
|
|
1944
|
+
}> | Exercise<{
|
|
1938
1945
|
signs: string[];
|
|
1939
1946
|
xs: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers[];
|
|
1940
1947
|
type: number;
|
|
1941
1948
|
ineqSymbol?: string;
|
|
1942
1949
|
}, {
|
|
1943
1950
|
questionType: string;
|
|
1951
|
+
functionType: string;
|
|
1944
1952
|
}> | Exercise<{
|
|
1945
|
-
initTable: string[][];
|
|
1946
1953
|
a: number;
|
|
1947
1954
|
x1: number;
|
|
1948
|
-
x2
|
|
1949
|
-
x3
|
|
1955
|
+
x2?: number;
|
|
1956
|
+
x3?: number;
|
|
1950
1957
|
lineAsked: number;
|
|
1951
|
-
},
|
|
1958
|
+
}, {
|
|
1959
|
+
functionType: string;
|
|
1960
|
+
}> | Exercise<{
|
|
1952
1961
|
affine1Coeffs: number[];
|
|
1953
1962
|
affine2Coeffs: number[];
|
|
1954
1963
|
initTable: string[][];
|
|
@@ -2944,6 +2953,10 @@ declare const mathExercises: (Exercise<{
|
|
|
2944
2953
|
askingFinalPrice: boolean;
|
|
2945
2954
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
2946
2955
|
evolutions: number[];
|
|
2956
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
2957
|
+
vi: number;
|
|
2958
|
+
vf: number;
|
|
2959
|
+
nbEvolutions: number;
|
|
2947
2960
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
2948
2961
|
initialCapital: number;
|
|
2949
2962
|
rate: number;
|
|
@@ -3019,6 +3032,18 @@ declare const mathExercises: (Exercise<{
|
|
|
3019
3032
|
a: number;
|
|
3020
3033
|
n: number;
|
|
3021
3034
|
isSimplified: boolean;
|
|
3035
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3036
|
+
writeAsRoot: boolean;
|
|
3037
|
+
aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
3038
|
+
nIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
3039
|
+
}, {
|
|
3040
|
+
writeAsRoot: boolean;
|
|
3041
|
+
}> | Exercise<{
|
|
3042
|
+
nIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
3043
|
+
kIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
3044
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3045
|
+
nIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
3046
|
+
kIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
3022
3047
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3023
3048
|
c: number;
|
|
3024
3049
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,aAAa,MAAM,2BAA2B,CAAC;AAE3D,OAAO,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kDAA6B,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seqArithmeticSituations.d.ts","sourceRoot":"","sources":["../../../../../src/math/utils/sequences/situations/seqArithmeticSituations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAiBlE,MAAM,MAAM,4BAA4B,GAAG;IACzC,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,MAAM,CAAC;IAEZ,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,aAAa,CAAC;IAEnB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,KAAK,MAAM,CAAC;IAChE,kBAAkB,EAAE,CAClB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACzE,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,aAAa,CAAC;CACpE,CAAC;AAEF,MAA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kC,KACjD,MAAM,CAAC;IAEZ,4BAA4B,EAAE,4BAA4B,CAAC;IAC3D,8BAA8B,EAAE,4BAA4B,CAAC;IAE7D,uBAAuB,EAAE,4BAA4B,CAAC;IAEtD,iBAAiB,EAAE,4CAA4C,CAAC;IAChE,sBAAsB,EAAE,4CAA4C,CAAC;CACtE,CAAC;
|
|
1
|
+
{"version":3,"file":"seqArithmeticSituations.d.ts","sourceRoot":"","sources":["../../../../../src/math/utils/sequences/situations/seqArithmeticSituations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAiBlE,MAAM,MAAM,4BAA4B,GAAG;IACzC,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,MAAM,CAAC;IAEZ,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,aAAa,CAAC;IAEnB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,KAAK,MAAM,CAAC;IAChE,kBAAkB,EAAE,CAClB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,EAAE,CAAC,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IACzE,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,aAAa,CAAC;CACpE,CAAC;AAEF,MAAM,MAAM,4CAA4C,GAAG;IAC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Z,4BAA4B,EAAE,4BAA4B,CAAC;IAC3D,8BAA8B,EAAE,4BAA4B,CAAC;IAE7D,uBAAuB,EAAE,4BAA4B,CAAC;IAEtD,iBAAiB,EAAE,4CAA4C,CAAC;IAChE,sBAAsB,EAAE,4CAA4C,CAAC;CACtE,CAAC;AAulHF,eAAO,MAAM,oBAAoB;;sCApkHd,MAAM,UACP,MAAM,aACH,MAAM,gBACH,OAAO,EAAE;;;;;sCA2Bd,MAAM,UACP,MAAM,aACH,MAAM,gBACH,OAAO,EAAE;;;;;;;sCAmChB,MAAM,UACP,MAAM,aACH,MAAM,gBACH,OAAO,EAAE;;;;;sCAsCd,MAAM,UACP,MAAM,aACH,MAAM,gBACH,OAAO,EAAE;;;;;sCAwDd,MAAM,UACP,MAAM,aACH,MAAM,gBACH,OAAO,EAAE;;;;IA25G9B,CAAC"}
|
|
@@ -36,7 +36,9 @@ $$
|
|
|
36
36
|
const str = `${strRaw}
|
|
37
37
|
|
|
38
38
|
$$
|
|
39
|
-
u_{${rank2.frPretty(0)}} = u_{${rank1.frPretty(0)}}
|
|
39
|
+
u_{${rank2.frPretty(0)}} = ${add(`u_{${rank1.frPretty(0)}}`.toTree(), reason)
|
|
40
|
+
.simplify({ towardsDistribute: true })
|
|
41
|
+
.toTex()}
|
|
40
42
|
$$
|
|
41
43
|
|
|
42
44
|
La relation de récurrence est, pour $n \\geq ${firstRank.frPretty(0)}$ :
|
|
@@ -117,16 +119,11 @@ Le nombre recherché est donc $${texAnswer}$.`;
|
|
|
117
119
|
}),
|
|
118
120
|
variationFindThreshold: Object.assign({}, variationFindThreshold, {
|
|
119
121
|
getCorrectionStuff: (initial, reason, firstRank, ...otherArgs) => {
|
|
120
|
-
const [valueThreshold, inequationSymbol, digitsValue, digitsTarget] = otherArgs;
|
|
122
|
+
const [valueThreshold, inequationSymbol, _rankDecoder, digitsValue, digitsTarget,] = otherArgs;
|
|
121
123
|
const { str: strRaw } = variationFindThreshold.getCorrectionStuff(initial, reason, firstRank, ...otherArgs);
|
|
122
124
|
const { answerNode, rankNode } = variationFindThreshold.getAnswerStuff(initial, reason, firstRank, ...otherArgs);
|
|
123
125
|
const texRankSimplified = rankNode.evaluate().frPretty(0);
|
|
124
|
-
const texAnswer =
|
|
125
|
-
...new Set([
|
|
126
|
-
answerNode.toTex(),
|
|
127
|
-
answerNode.evaluate().frPretty(digitsTarget),
|
|
128
|
-
]),
|
|
129
|
-
].join(" = ");
|
|
126
|
+
const texAnswer = answerNode.evaluate().frPretty(digitsTarget);
|
|
130
127
|
const str = `${strRaw}
|
|
131
128
|
|
|
132
129
|
On note $p$ le rang recherché. On a :
|
|
@@ -6,7 +6,7 @@ export declare const seqArithmeticUtils: {
|
|
|
6
6
|
getAnswerNodeExplicitFormula: (initial: number, reason: number, firstRank: number) => EqualNode;
|
|
7
7
|
getAnswerNodeRecurrenceFormula: (_initial: number, reason: number, _firstRank: number) => EqualNode;
|
|
8
8
|
getAnswerNodeRandomTerm: (initial: number, reason: number, firstRank: number, rankAsked: number) => import("../../../../tree/nodes/operators/addNode.js").AddNode;
|
|
9
|
-
getAnswerNodeRandomRank: (initial: number, reason: number, _firstRank: number, valueAsked: number) => import("../../../../tree/nodes/
|
|
9
|
+
getAnswerNodeRandomRank: (initial: number, reason: number, _firstRank: number, valueAsked: number) => import("../../../../tree/nodes/operators/fractionNode.js").FractionNode;
|
|
10
10
|
getAnswerNodeThresholdRank: (initial: number, reason: number, firstRank: number, valueThreshold: number, inequationSymbol: InequationSymbol) => import("../../../../tree/nodes/numbers/constantNode.js").ConstantNode | import("../../../../tree/nodes/numbers/numberNode.js").NumberNode;
|
|
11
11
|
getAnswerNodeSumThresholdRank: (initial: number, reason: number, firstRank: number, valueThreshold: number, inequationSymbol: InequationSymbol) => import("../../../../tree/nodes/numbers/constantNode.js").ConstantNode | import("../../../../tree/nodes/numbers/numberNode.js").NumberNode;
|
|
12
12
|
randThreshold: (initial: number, reason: number, firstRank: number, roundTo: number) => number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seqArithmeticUtils.d.ts","sourceRoot":"","sources":["../../../../../src/math/utils/sequences/situations/seqArithmeticUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"seqArithmeticUtils.d.ts","sourceRoot":"","sources":["../../../../../src/math/utils/sequences/situations/seqArithmeticUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA+MpE,eAAO,MAAM,kBAAkB;4BAtMA,MAAM,UAAU,MAAM,QAAQ,MAAM;+BAIjC,MAAM,UAAU,MAAM,QAAQ,MAAM;4CAK3D,MAAM,UACP,MAAM,aACH,MAAM;+CAaP,MAAM,UACR,MAAM,cACF,MAAM;uCAWT,MAAM,UACP,MAAM,aACH,MAAM,aACN,MAAM;uCAUR,MAAM,UACP,MAAM,cACF,MAAM,cACN,MAAM;0CAST,MAAM,UACP,MAAM,aACH,MAAM,kBACD,MAAM,oBACJ,gBAAgB;6CAwBzB,MAAM,UACP,MAAM,aACH,MAAM,kBACD,MAAM,oBACJ,gBAAgB;6BAmEzB,MAAM,UACP,MAAM,aACH,MAAM,WACR,MAAM;gCAgBN,MAAM,UACP,MAAM,aACH,MAAM,WACR,MAAM;CA0BhB,CAAC"}
|
|
@@ -7,7 +7,6 @@ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
|
7
7
|
import { probaFlip } from "../../../../utils/alea/probaFlip.js";
|
|
8
8
|
import { random, randomMany } from "../../../../utils/alea/random.js";
|
|
9
9
|
import { randfloat } from "../../random/randfloat.js";
|
|
10
|
-
import { round } from "../../round.js";
|
|
11
10
|
const valueForRank = (initial, reason, rank) => {
|
|
12
11
|
return initial + reason * rank;
|
|
13
12
|
};
|
|
@@ -35,8 +34,7 @@ const getAnswerNodeRandomRank = (initial, reason, _firstRank, valueAsked) => {
|
|
|
35
34
|
//u_n = u_0 + r * n
|
|
36
35
|
//n = (u_n - u_0) / r
|
|
37
36
|
const nodeRaw = frac(substract(valueAsked, initial), reason);
|
|
38
|
-
|
|
39
|
-
return valueRounded.toTree();
|
|
37
|
+
return nodeRaw;
|
|
40
38
|
};
|
|
41
39
|
const getAnswerNodeThresholdRank = (initial, reason, firstRank, valueThreshold, inequationSymbol) => {
|
|
42
40
|
//u_n = u_0 + r * n >= t
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seqGeometricSituations.d.ts","sourceRoot":"","sources":["../../../../../src/math/utils/sequences/situations/seqGeometricSituations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"seqGeometricSituations.d.ts","sourceRoot":"","sources":["../../../../../src/math/utils/sequences/situations/seqGeometricSituations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAalE,MAAM,MAAM,2BAA2B,GAAG;IACxC,cAAc,CAAC,EAAE,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,MAAM,CAAC;IAEZ,aAAa,EAAE,CACb,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,EAAE,OAAO,EAAE,KACpB,aAAa,CAAC;IACnB,OAAO,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,OAAO,EAAE,KAAK,MAAM,CAAC;IAChE,kBAAkB,EAAE,CAClB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,GAAG,SAAS,E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xC9B,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
|
3
3
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
4
4
|
import { randfloat } from "../../random/randfloat.js";
|
|
5
5
|
import { randint } from "../../random/randint.js";
|
|
6
|
+
import { round } from "../../round.js";
|
|
6
7
|
import { seqGeometricUtils } from "./seqGeometricUtils.js";
|
|
7
8
|
const getStrFactor = (firstRank) => {
|
|
8
9
|
return firstRank === 0 ? "n" : "(n-1)";
|
|
@@ -67,10 +68,7 @@ $$
|
|
|
67
68
|
|
|
68
69
|
En particulier :
|
|
69
70
|
|
|
70
|
-
${alignTex([
|
|
71
|
-
[`u_{${rankAsked}}`, "=", answerNode.toTex()],
|
|
72
|
-
["", "=", answerNode.simplify().toTex()],
|
|
73
|
-
])}
|
|
71
|
+
${alignTex([[`u_{${rankAsked}}`, "=", answerNode.toTex()]])}
|
|
74
72
|
|
|
75
73
|
`;
|
|
76
74
|
return { str };
|
|
@@ -84,7 +82,7 @@ const templatesSituationsGeometric = [
|
|
|
84
82
|
{
|
|
85
83
|
type: "evoPercentage",
|
|
86
84
|
randInitial: () => randint(20, 51) * 100,
|
|
87
|
-
randReason: () => 1 + randfloat(0, 4, 2, [0]) / 100, //expl: 1,0331
|
|
85
|
+
randReason: () => round(1 + randfloat(0, 4, 2, [0]) / 100, 4), //expl: 1,0331
|
|
88
86
|
randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
|
|
89
87
|
randSuperfluousData: () => {
|
|
90
88
|
const rand = randint(0, 2);
|
|
@@ -211,7 +209,7 @@ Le capital en $\\textrm{€}$, au premier janvier de l'année $${add(2026, subst
|
|
|
211
209
|
{
|
|
212
210
|
type: "evoPercentage",
|
|
213
211
|
randInitial: () => randint(13, 30) * 1000,
|
|
214
|
-
randReason: () => 1 - (randint(10, 26, [0]) * 1.0) / 100, //expl: 0,80
|
|
212
|
+
randReason: () => round(1 - (randint(10, 26, [0]) * 1.0) / 100, 2), //expl: 0,80
|
|
215
213
|
randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
|
|
216
214
|
randSuperfluousData: () => {
|
|
217
215
|
const rand = randint(0, 2);
|
|
@@ -341,7 +339,7 @@ La valeur de la voiture de Killian en $\\textrm{€}$, au premier juillet de l'a
|
|
|
341
339
|
{
|
|
342
340
|
type: "factorPercentage",
|
|
343
341
|
randInitial: () => randfloat(1, 2, 2),
|
|
344
|
-
randReason: () => 1 - (randint(10, 26, [0]) * 1.0) / 100, //expl: 0,80
|
|
342
|
+
randReason: () => round(1 - (randint(10, 26, [0]) * 1.0) / 100, 2), //expl: 0,80
|
|
345
343
|
randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
|
|
346
344
|
randSuperfluousData: () => {
|
|
347
345
|
const rand = randint(0, 2);
|
|
@@ -468,7 +466,7 @@ La hauteur de la balle est donc une suite géométrique de premier terme $${init
|
|
|
468
466
|
{
|
|
469
467
|
type: "evoPercentage",
|
|
470
468
|
randInitial: () => randint(50, 101) * 100,
|
|
471
|
-
randReason: () => 1 + (randint(10, 40) * 1.0) / 100, //expl: 1,25
|
|
469
|
+
randReason: () => round(1 + (randint(10, 40) * 1.0) / 100, 2), //expl: 1,25
|
|
472
470
|
randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
|
|
473
471
|
randSuperfluousData: () => {
|
|
474
472
|
const rand = randint(0, 2);
|
|
@@ -710,7 +708,7 @@ Le nombre de personnes informées est donc une suite géométrique de premier te
|
|
|
710
708
|
{
|
|
711
709
|
type: "evoPercentage",
|
|
712
710
|
randInitial: () => randint(28, 44) * 1000,
|
|
713
|
-
randReason: () => 1 + randint(2, 7) / 100, //expl: 1,05
|
|
711
|
+
randReason: () => round(1 + randint(2, 7) / 100, 2), //expl: 1,05
|
|
714
712
|
randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
|
|
715
713
|
randSuperfluousData: () => {
|
|
716
714
|
const rand = randint(0, 2);
|
|
@@ -845,7 +843,7 @@ Le salaire en $\\textrm{€}$ pour l'année $${add(2025, substract("n".toTree(),
|
|
|
845
843
|
{
|
|
846
844
|
type: "evoPercentage",
|
|
847
845
|
randInitial: () => randint(28, 44) * 1000,
|
|
848
|
-
randReason: () => 1 + randint(2, 7) / 100, //expl: 1,05
|
|
846
|
+
randReason: () => round(1 + randint(2, 7) / 100, 2), //expl: 1,05
|
|
849
847
|
randThreshold: (initial, reason, firstRank) => seqGeometricUtils.randThreshold(initial, reason, firstRank, 2),
|
|
850
848
|
randSuperfluousData: () => {
|
|
851
849
|
const rand = randint(0, 2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"questionTest.d.ts","sourceRoot":"","sources":["../../src/tests/questionTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAKjE,eAAO,MAAM,YAAY,GACvB,KAAK,QAAQ,CAAC,MAAM,CAAC,EACrB,UAAU,QAAQ,CAAC,MAAM,CAAC;;;
|
|
1
|
+
{"version":3,"file":"questionTest.d.ts","sourceRoot":"","sources":["../../src/tests/questionTest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAKjE,eAAO,MAAM,YAAY,GACvB,KAAK,QAAQ,CAAC,MAAM,CAAC,EACrB,UAAU,QAAQ,CAAC,MAAM,CAAC;;;CAgU3B,CAAC"}
|