math-exercises 3.0.187 → 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/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 +2 -7
- 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/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,118 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { numberVEA } from "../../../exercises/vea/numberVEA.js";
|
|
4
|
+
import { randfloat } from "../../../math/utils/random/randfloat.js";
|
|
5
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
6
|
+
import { round } from "../../../math/utils/round.js";
|
|
7
|
+
import { reifyAlgebraic, } from "../../../tree/nodes/nodeConstructor.js";
|
|
8
|
+
import { add } from "../../../tree/nodes/operators/addNode.js";
|
|
9
|
+
import { frac } from "../../../tree/nodes/operators/fractionNode.js";
|
|
10
|
+
import { power } from "../../../tree/nodes/operators/powerNode.js";
|
|
11
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
12
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
13
|
+
import { alignTex } from "../../../utils/latex/alignTex.js";
|
|
14
|
+
const getPropositions = (n, { answer }) => {
|
|
15
|
+
const propositions = [];
|
|
16
|
+
addValidProp(propositions, answer);
|
|
17
|
+
propWhile(propositions, n, () => {
|
|
18
|
+
tryToAddWrongProp(propositions, randfloat(0.1, 1.1, 2).frenchify());
|
|
19
|
+
});
|
|
20
|
+
return shuffleProps(propositions, n);
|
|
21
|
+
};
|
|
22
|
+
const getAnswer = (identifiers) => {
|
|
23
|
+
const { nIds, kIds } = identifiers;
|
|
24
|
+
const n = reifyAlgebraic(nIds);
|
|
25
|
+
const k = reifyAlgebraic(kIds);
|
|
26
|
+
return round(substract(power(k, frac(1, n)), 1).evaluate(), 2).frenchify();
|
|
27
|
+
};
|
|
28
|
+
const getInstruction = (identifiers) => {
|
|
29
|
+
const { nIds, kIds } = identifiers;
|
|
30
|
+
const n = reifyAlgebraic(nIds);
|
|
31
|
+
const k = reifyAlgebraic(kIds);
|
|
32
|
+
return `Résoudre l'équation suivante :
|
|
33
|
+
|
|
34
|
+
$$
|
|
35
|
+
${power(add(1, "t"), n).toTex()}= ${k.toTex()}
|
|
36
|
+
$$
|
|
37
|
+
|
|
38
|
+
Donner la solution arrondie au centième.`;
|
|
39
|
+
};
|
|
40
|
+
const getHint = () => {
|
|
41
|
+
return `Utilise la propriété suivante :
|
|
42
|
+
|
|
43
|
+
$$
|
|
44
|
+
a^n = k \\iff a = k^{\\frac{1}{n}}
|
|
45
|
+
$$`;
|
|
46
|
+
};
|
|
47
|
+
const getCorrection = (identifiers) => {
|
|
48
|
+
const { nIds, kIds } = identifiers;
|
|
49
|
+
const n = reifyAlgebraic(nIds);
|
|
50
|
+
const k = reifyAlgebraic(kIds);
|
|
51
|
+
return `On sait que :
|
|
52
|
+
|
|
53
|
+
$$
|
|
54
|
+
a^n = k \\iff a = k^{\\frac{1}{n}}
|
|
55
|
+
$$
|
|
56
|
+
|
|
57
|
+
Ici, on a donc :
|
|
58
|
+
|
|
59
|
+
${alignTex([
|
|
60
|
+
["1+t", "=", power(k, frac(1, n)).toTex()],
|
|
61
|
+
["", "\\approx", round(power(k, frac(1, n)).evaluate(), 2).frenchify()],
|
|
62
|
+
])}
|
|
63
|
+
|
|
64
|
+
On en déduit donc :
|
|
65
|
+
|
|
66
|
+
$$
|
|
67
|
+
t \\approx ${getAnswer(identifiers)}
|
|
68
|
+
$$`;
|
|
69
|
+
};
|
|
70
|
+
const getKeys = () => {
|
|
71
|
+
return [];
|
|
72
|
+
};
|
|
73
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
74
|
+
try {
|
|
75
|
+
return numberVEA(ans, answer);
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
return handleVEAError(err);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const getEquationOnePlusTPowerNQuestion = () => {
|
|
82
|
+
const n = randint(3, 10);
|
|
83
|
+
const k = randint(2, 10);
|
|
84
|
+
const identifiers = {
|
|
85
|
+
kIds: k.toTree().toIdentifiers(),
|
|
86
|
+
nIds: n.toTree().toIdentifiers(),
|
|
87
|
+
};
|
|
88
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
89
|
+
};
|
|
90
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
91
|
+
return {
|
|
92
|
+
answer: getAnswer(identifiers),
|
|
93
|
+
instruction: getInstruction(identifiers),
|
|
94
|
+
keys: getKeys(identifiers),
|
|
95
|
+
answerFormat: "tex",
|
|
96
|
+
identifiers,
|
|
97
|
+
hint: getHint(identifiers),
|
|
98
|
+
correction: getCorrection(identifiers),
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
export const equationOnePlusTPowerN = {
|
|
102
|
+
id: "equationOnePlusTPowerN",
|
|
103
|
+
connector: "=",
|
|
104
|
+
label: "Résoudre une équation du type $(1 + t)^n = k$, d'inconnue $t$",
|
|
105
|
+
isSingleStep: true,
|
|
106
|
+
generator: (nb, opts) => getDistinctQuestions(() => getEquationOnePlusTPowerNQuestion(opts), nb),
|
|
107
|
+
qcmTimer: 60,
|
|
108
|
+
freeTimer: 60,
|
|
109
|
+
getPropositions,
|
|
110
|
+
isAnswerValid,
|
|
111
|
+
subject: "Mathématiques",
|
|
112
|
+
getInstruction,
|
|
113
|
+
getHint,
|
|
114
|
+
getCorrection,
|
|
115
|
+
getAnswer,
|
|
116
|
+
getQuestionFromIdentifiers,
|
|
117
|
+
hasHintAndCorrection: true,
|
|
118
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
writeAsRoot: boolean;
|
|
5
|
+
aIds: NodeIdentifiers;
|
|
6
|
+
nIds: NodeIdentifiers;
|
|
7
|
+
};
|
|
8
|
+
type Options = {
|
|
9
|
+
writeAsRoot: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const estimateNthRoot: Exercise<Identifiers, Options>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=estimateNthRoot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateNthRoot.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/powers/estimateNthRoot.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAK7C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,CAAC;IAErB,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,eAAe,CAAC;CACvB,CAAC;AA0GF,KAAK,OAAO,GAAG;IACb,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAYF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAoB1D,CAAC"}
|
|
@@ -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,CAA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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,MAA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zB,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;IAC9D,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9E,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IAErB,eAAe,EAAE,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,kCAAkC,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,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CAAkC,CAAC;IAC9D,aAAa,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9E,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IAErB,eAAe,EAAE,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,kCAAkC,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;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 :
|