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
|
@@ -37,10 +37,6 @@ const getAnswer = (identifiers) => {
|
|
|
37
37
|
};
|
|
38
38
|
const getHint = () => {
|
|
39
39
|
return `Le nombre dérivé de $f$ en $x$, aussi noté $f'(x)$, est le coefficient directeur la tangente à la courbe représentative de $f$ au point d'abscisse $x$.
|
|
40
|
-
|
|
41
|
-
Résoudre l'équation $f'(x) = k$,
|
|
42
|
-
c'est trouver toutes les abscisses $x$
|
|
43
|
-
pour lesquelles le coefficient directeur la tangente à la courbe représentative de $f$ vaut $k$.
|
|
44
40
|
|
|
45
41
|
La tangente au point $C$ est la droite que l'on obtient quand $A$ et $B$ sont infiniment proches de $C$, en restant tous deux distincts.
|
|
46
42
|
`;
|
package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tangentEquationFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"tangentEquationFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAgF7C,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAqXF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAgDF,eAAO,MAAM,qCAAqC,EAAE,QAAQ,CAC1D,WAAW,EACX,OAAO,CAqBR,CAAC"}
|
|
@@ -200,10 +200,15 @@ const getPropositions = (n, { answer, ...identifiers }) => {
|
|
|
200
200
|
{
|
|
201
201
|
const nodeX = "x".toTree();
|
|
202
202
|
const nodeTWrong = add(multiply(nodeValueDerivative, nodeX), nodeValueImage);
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
203
|
+
try {
|
|
204
|
+
const texWrong = `y = ${nodeTWrong
|
|
205
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
206
|
+
.toTex()}`;
|
|
207
|
+
tryToAddWrongProp(propositionsMandatory, texWrong);
|
|
208
|
+
}
|
|
209
|
+
catch (_) {
|
|
210
|
+
(() => { })();
|
|
211
|
+
}
|
|
207
212
|
}
|
|
208
213
|
//filler
|
|
209
214
|
const propositionsFiller = [];
|
|
@@ -222,10 +227,15 @@ const getPropositions = (n, { answer, ...identifiers }) => {
|
|
|
222
227
|
].forEach(([nodeXAskedWrong, nodeValueImageWrong, nodeValueDerivativeWrong]) => {
|
|
223
228
|
const nodeX = "x".toTree();
|
|
224
229
|
const nodeTWrong = add(multiply(nodeValueDerivativeWrong, substract(nodeX, nodeXAskedWrong)), nodeValueImageWrong);
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
230
|
+
try {
|
|
231
|
+
const texWrong = `y = ${nodeTWrong
|
|
232
|
+
.simplify({ towardsDistribute: true, forbidFactorize: true })
|
|
233
|
+
.toTex()}`;
|
|
234
|
+
tryToAddWrongProp(propositionsFiller, texWrong);
|
|
235
|
+
}
|
|
236
|
+
catch (_) {
|
|
237
|
+
(() => { })();
|
|
238
|
+
}
|
|
229
239
|
});
|
|
230
240
|
}
|
|
231
241
|
propWhile(propositionsFiller, n, () => {
|
|
@@ -288,7 +298,11 @@ const isIdentifiersQCPassed = (identifiers) => {
|
|
|
288
298
|
}
|
|
289
299
|
return isExploding;
|
|
290
300
|
};
|
|
291
|
-
|
|
301
|
+
const isVEAOk = (identifiers) => {
|
|
302
|
+
const answer = getAnswer(identifiers);
|
|
303
|
+
return isAnswerValid(answer, { answer, ...identifiers });
|
|
304
|
+
};
|
|
305
|
+
return !isExploding(identifiers) && isVEAOk(identifiers);
|
|
292
306
|
};
|
|
293
307
|
const getTangentEquationFromFunctionExpressionQuestion = (optsIn) => {
|
|
294
308
|
const arrayedOptions = optsIn ?? arrayedOptsDefault;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findAbscissaOfExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA4R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"findAbscissaOfExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA4R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA2LF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoCF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAChE,WAAW,EACX,OAAO,CAqBR,CAAC"}
|
package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js
CHANGED
|
@@ -282,29 +282,10 @@ const getAnswerNode = (identifiers) => {
|
|
|
282
282
|
const getAnswer = (identifiers) => {
|
|
283
283
|
return getAnswerNode(identifiers).toTex();
|
|
284
284
|
};
|
|
285
|
-
const getHint = (
|
|
286
|
-
|
|
287
|
-
const strHintDerivative = (() => {
|
|
288
|
-
switch (typeF) {
|
|
289
|
-
case "polynôme (degré $2$)":
|
|
290
|
-
return `Soient $a$, $b$ et $c$ trois réels. La dérivée de $x \\mapsto ax^2+bx+c$ est $x \\mapsto 2ax+b$.`;
|
|
291
|
-
case "polynôme (degré $3$)":
|
|
292
|
-
return `Soient $a$, $b$, $c$ et $d$ quatre réels. La dérivée de $x \\mapsto ax^3+bx^2+cx+d$ est $x \\mapsto 3ax^2+2bx+c$.`;
|
|
293
|
-
case "$\\frac{ax^2+bx+c}{dx+m}$":
|
|
294
|
-
return `Soient $a$, $b$, $c$, $d$ et $m$ cinq réels. La dérivée de $x \\mapsto \\frac{ax^2+bx+c}{dx+m}$ est $x \\mapsto \\frac{(2ax+b)(dx+m)-(ax^2+bx+c)d}{(dx+m)^2}$.`;
|
|
295
|
-
case "$\\frac{dx+m}{ax^2+bx+c}$":
|
|
296
|
-
return `Soient $a$, $b$, $c$, $d$ et $m$ cinq réels. La dérivée de $x \\mapsto \\frac{dx+m}{ax^2+bx+c}$ est $x \\mapsto \\frac{d(ax^2+bx+c)-(dx+m)(2ax+b)}{(ax^2+bx+c)^2}$.`;
|
|
297
|
-
default:
|
|
298
|
-
throw new Error("Unsupported typeF: " + typeF);
|
|
299
|
-
}
|
|
300
|
-
})();
|
|
301
|
-
return `Si $f$ est une fonction dérivable en $a$, alors l'équation de la tangente à la courbe de $f$ au point d'abscisse $a$ est donné par:
|
|
302
|
-
|
|
303
|
-
$$
|
|
304
|
-
y = f'(a)(x-a)+f(a)
|
|
305
|
-
$$
|
|
285
|
+
const getHint = () => {
|
|
286
|
+
return `Les abscisses des extremums locaux d'une fonction dérivable sont les valeurs $x$ telles que $f'(x)=0$ et $f'$ change de signe en $x$.
|
|
306
287
|
|
|
307
|
-
$
|
|
288
|
+
Calcule donc la fonction dérivée $f'$ de $f$. Puis, résous l'équation $f'(x) = 0$.
|
|
308
289
|
`;
|
|
309
290
|
};
|
|
310
291
|
const getCorrection = (identifiers) => {
|
|
@@ -390,13 +371,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
390
371
|
};
|
|
391
372
|
};
|
|
392
373
|
const arrayedOptsDefault = {
|
|
393
|
-
typeF: [
|
|
394
|
-
|
|
395
|
-
"polynôme (degré $3$)",
|
|
396
|
-
"$\\frac{ax^2+bx+c}{dx+m}$",
|
|
397
|
-
"$\\frac{dx+m}{ax^2+bx+c}$",
|
|
398
|
-
],
|
|
399
|
-
typeRoots: ["entières", "rationnelles"],
|
|
374
|
+
typeF: ["polynôme (degré $2$)", "polynôme (degré $3$)"],
|
|
375
|
+
typeRoots: ["entières"],
|
|
400
376
|
};
|
|
401
377
|
const options = [
|
|
402
378
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA+R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAwUF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"findExtremaFromFunctionExpression.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/findExtremaFromFunctionExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AA+R7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAwUF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoCF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqB1E,CAAC"}
|
|
@@ -498,13 +498,8 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
498
498
|
};
|
|
499
499
|
};
|
|
500
500
|
const arrayedOptsDefault = {
|
|
501
|
-
typeF: [
|
|
502
|
-
|
|
503
|
-
"polynôme (degré $3$)",
|
|
504
|
-
"$\\frac{ax^2+bx+c}{dx+m}$",
|
|
505
|
-
"$\\frac{dx+m}{ax^2+bx+c}$",
|
|
506
|
-
],
|
|
507
|
-
typeRoots: ["entières", "rationnelles"],
|
|
501
|
+
typeF: ["polynôme (degré $2$)", "polynôme (degré $3$)"],
|
|
502
|
+
typeRoots: ["entières"],
|
|
508
503
|
};
|
|
509
504
|
const options = [
|
|
510
505
|
{
|
|
@@ -105,7 +105,7 @@ export const inverseImageFunction = {
|
|
|
105
105
|
id: "inverseImageFunction",
|
|
106
106
|
connector: "\\iff",
|
|
107
107
|
getPropositions,
|
|
108
|
-
label: "Calculer des antécédents",
|
|
108
|
+
label: "Calculer des antécédents (fonctions affines)",
|
|
109
109
|
isSingleStep: true,
|
|
110
110
|
generator: (nb) => getDistinctQuestions(getInverseImageFunction, nb),
|
|
111
111
|
qcmTimer: 60,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affineSignTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/affineSignTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB,CAAC;AAqGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"affineSignTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/affineSignTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB,CAAC;AAqGF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAmBjD,CAAC"}
|
|
@@ -90,7 +90,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
90
90
|
};
|
|
91
91
|
export const affineSignTable = {
|
|
92
92
|
id: "affineSignTable",
|
|
93
|
-
label: "Dresser le tableau de signes d'une fonction affine",
|
|
93
|
+
label: "Dresser le tableau de signes d'une fonction affine à partir de son expression algébrique",
|
|
94
94
|
isSingleStep: true,
|
|
95
95
|
generator: (nb, opts) => getDistinctQuestions(() => getTestSignTableQuestion(opts), nb),
|
|
96
96
|
qcmTimer: 60,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"equationFromSignTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/equationFromSignTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,EAAE,EAAE,eAAe,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;
|
|
1
|
+
{"version":3,"file":"equationFromSignTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/equationFromSignTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAkBT,MAAM,6BAA6B,CAAC;AAUrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAc7C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,EAAE,EAAE,eAAe,EAAE,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAwRF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAsBhE,CAAC"}
|
|
@@ -6,7 +6,7 @@ import { EquationSolutionNode } from "../../../../tree/nodes/equations/equationS
|
|
|
6
6
|
import { InequationSolutionNode } from "../../../../tree/nodes/inequations/inequationSolutionNode.js";
|
|
7
7
|
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
8
8
|
import { MinusInfinityNode, PlusInfinityNode, } from "../../../../tree/nodes/numbers/infiniteNode.js";
|
|
9
|
-
import {
|
|
9
|
+
import { Closure } from "../../../../tree/nodes/sets/closure.js";
|
|
10
10
|
import { DiscreteSetNode } from "../../../../tree/nodes/sets/discreteSetNode.js";
|
|
11
11
|
import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
|
|
12
12
|
import { UnionIntervalNode } from "../../../../tree/nodes/sets/unionIntervalNode.js";
|
|
@@ -38,38 +38,32 @@ const getIntervalsSolution = (identifiers) => {
|
|
|
38
38
|
const xNodes = xs.map((e) => reifyAlgebraic(e));
|
|
39
39
|
const isSup = inequation.isSup;
|
|
40
40
|
const isStrict = inequation.isStrict;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
];
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
return [
|
|
50
|
-
new IntervalNode(xNodes[1], xNodes[2], isStrict ? ClosureType.OO : ClosureType.FF),
|
|
51
|
-
];
|
|
52
|
-
}
|
|
41
|
+
const rawSigns = signs.filter((s) => s !== "0");
|
|
42
|
+
const rightSignIndexes = [];
|
|
43
|
+
for (let i = 0; i < rawSigns.length; i++) {
|
|
44
|
+
if (isSup === (rawSigns[i] === "+"))
|
|
45
|
+
rightSignIndexes.push(i);
|
|
53
46
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
return [
|
|
63
|
-
new IntervalNode(xNodes[1], xNodes[2], isStrict ? ClosureType.OO : ClosureType.FF),
|
|
64
|
-
];
|
|
65
|
-
}
|
|
47
|
+
const intervals = [];
|
|
48
|
+
for (let i = 0; i < rightSignIndexes.length; i++) {
|
|
49
|
+
const index = rightSignIndexes[i];
|
|
50
|
+
const start = xNodes[index];
|
|
51
|
+
const end = xNodes[index + 1];
|
|
52
|
+
const leftOpen = index === 0 || isStrict;
|
|
53
|
+
const rightOpen = index === rawSigns.length - 1 || isStrict;
|
|
54
|
+
intervals.push(new IntervalNode(start, end, Closure.fromBooleans(!leftOpen, !rightOpen)));
|
|
66
55
|
}
|
|
56
|
+
return intervals;
|
|
67
57
|
};
|
|
68
58
|
const getAnswerNode = (identifiers) => {
|
|
69
59
|
const { xs, type } = identifiers;
|
|
70
60
|
const xNodes = xs.map((e) => reifyAlgebraic(e));
|
|
71
61
|
if (type === 0) {
|
|
72
|
-
|
|
62
|
+
if (xs.length === 3)
|
|
63
|
+
return new EquationSolutionNode(new DiscreteSetNode([xNodes[1]]));
|
|
64
|
+
if (xs.length === 4)
|
|
65
|
+
return new EquationSolutionNode(new DiscreteSetNode([xNodes[1], xNodes[2]]));
|
|
66
|
+
return new EquationSolutionNode(new DiscreteSetNode([xNodes[1], xNodes[2], xNodes[3]]));
|
|
73
67
|
}
|
|
74
68
|
else {
|
|
75
69
|
const intervals = getIntervalsSolution(identifiers);
|
|
@@ -126,7 +120,12 @@ const getCorrection = (identifiers) => {
|
|
|
126
120
|
const { xs, type, ineqSymbol } = identifiers;
|
|
127
121
|
const xNodes = xs.map((e) => reifyAlgebraic(e));
|
|
128
122
|
if (type === 0) {
|
|
129
|
-
|
|
123
|
+
const corr = xNodes.length === 5
|
|
124
|
+
? `D'après le tableau de signes de $f$, les antécédents de $0$ par $f$ sont $${xNodes[1].toTex()}$, $${xNodes[2].toTex()}$ et $${xNodes[3].toTex()}$.`
|
|
125
|
+
: xNodes.length === 4
|
|
126
|
+
? `D'après le tableau de signes de $f$, les antécédents de $0$ par $f$ sont $${xNodes[1].toTex()}$ et $${xNodes[2].toTex()}$.`
|
|
127
|
+
: `D'après le tableau de signes de $f$, l'antécédent de $0$ par $f$ est $${xNodes[1].toTex()}$.`;
|
|
128
|
+
return `${corr}
|
|
130
129
|
|
|
131
130
|
L'ensemble des solutions de $f(x)=0$ est donc :
|
|
132
131
|
|
|
@@ -152,12 +151,28 @@ ${getAnswer(identifiers)}
|
|
|
152
151
|
$$`;
|
|
153
152
|
};
|
|
154
153
|
const getReadSignTableQuestion = (opts) => {
|
|
155
|
-
const
|
|
156
|
-
const
|
|
157
|
-
const
|
|
154
|
+
const x1 = randint(-9, 10);
|
|
155
|
+
const x2 = randint(-9, 10, [x1]);
|
|
156
|
+
const x3 = randint(-9, 10, [x1, x2]);
|
|
157
|
+
const sorted = [x1, x2, x3].sort((a, b) => a - b);
|
|
158
|
+
const functionType = opts?.functionType === "Affine"
|
|
159
|
+
? 0
|
|
160
|
+
: opts?.functionType === "Degré $3$"
|
|
161
|
+
? 2
|
|
162
|
+
: 1;
|
|
163
|
+
const roots = functionType === 0
|
|
164
|
+
? [x1]
|
|
165
|
+
: functionType === 1
|
|
166
|
+
? [sorted[0], sorted[1]]
|
|
167
|
+
: sorted;
|
|
168
|
+
const xs = [
|
|
169
|
+
MinusInfinityNode,
|
|
170
|
+
...roots.map((e) => e.toTree()),
|
|
171
|
+
PlusInfinityNode,
|
|
172
|
+
];
|
|
158
173
|
const signs = coinFlip()
|
|
159
|
-
? ["+", "0", "-", "0", "+"]
|
|
160
|
-
: ["-", "0", "+", "0", "-"];
|
|
174
|
+
? ["+", "0", "-", "0", "+", "0", "-"]
|
|
175
|
+
: ["-", "0", "+", "0", "-", "0", "+"];
|
|
161
176
|
const type = !opts?.questionType || opts.questionType === "Les deux"
|
|
162
177
|
? randint(0, 2)
|
|
163
178
|
: opts.questionType === "Inéquations"
|
|
@@ -168,7 +183,11 @@ const getReadSignTableQuestion = (opts) => {
|
|
|
168
183
|
type,
|
|
169
184
|
ineqSymbol,
|
|
170
185
|
xs: xs.map((e) => e.toIdentifiers()),
|
|
171
|
-
signs
|
|
186
|
+
signs: functionType === 0
|
|
187
|
+
? signs.slice(0, 3)
|
|
188
|
+
: functionType === 1
|
|
189
|
+
? signs.slice(0, 5)
|
|
190
|
+
: signs,
|
|
172
191
|
};
|
|
173
192
|
return getQuestionFromIdentifiers(identifiers, opts);
|
|
174
193
|
};
|
|
@@ -206,6 +225,14 @@ const options = [
|
|
|
206
225
|
defaultValue: "Les deux",
|
|
207
226
|
values: ["Équation $f(x) = 0$", "Inéquations", "Les deux"],
|
|
208
227
|
},
|
|
228
|
+
{
|
|
229
|
+
id: "functionType",
|
|
230
|
+
label: "Type de fonction",
|
|
231
|
+
target: GeneratorOptionTarget.generation,
|
|
232
|
+
type: GeneratorOptionType.select,
|
|
233
|
+
values: ["Affine", "Degré $2$", "Degré $3$"],
|
|
234
|
+
defaultValue: "Degré $2$",
|
|
235
|
+
},
|
|
209
236
|
];
|
|
210
237
|
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
211
238
|
return {
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
2
|
type Identifiers = {
|
|
3
|
-
initTable: string[][];
|
|
4
3
|
a: number;
|
|
5
4
|
x1: number;
|
|
6
|
-
x2
|
|
7
|
-
x3
|
|
5
|
+
x2?: number;
|
|
6
|
+
x3?: number;
|
|
8
7
|
lineAsked: number;
|
|
9
8
|
};
|
|
10
|
-
|
|
9
|
+
type Options = {
|
|
10
|
+
functionType: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const partialSignTableFromGraph: Exercise<Identifiers, Options>;
|
|
11
13
|
export {};
|
|
12
14
|
//# sourceMappingURL=partialSignTableFromGraph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"partialSignTableFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/partialSignTableFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"partialSignTableFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/sign/partialSignTableFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAoPF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAWF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAqBpE,CAAC"}
|