math-exercises 3.0.164 → 3.0.165
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/exercise.d.ts +1 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/inverseImageFunctionGeogebra.js +3 -1
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts +6 -2
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/devForm/variationsFromAlgebricForm.js +85 -13
- package/lib/exercises/math/functions/trinoms/equation/index.d.ts +2 -0
- package/lib/exercises/math/functions/trinoms/equation/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts +4 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationByFactorisation.js +169 -8
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationEqualsC.d.ts +10 -0
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationEqualsC.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationEqualsC.js +146 -0
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/equation/solveSecondDegreeEquationFromCano.js +73 -3
- package/lib/exercises/math/functions/trinoms/equation/trinomSelectEquationWithoutDeltaNeeded.d.ts +13 -0
- package/lib/exercises/math/functions/trinoms/equation/trinomSelectEquationWithoutDeltaNeeded.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/equation/trinomSelectEquationWithoutDeltaNeeded.js +204 -0
- package/lib/exercises/math/functions/trinoms/sign/index.d.ts +2 -0
- package/lib/exercises/math/functions/trinoms/sign/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/index.js +2 -0
- package/lib/exercises/math/functions/trinoms/sign/parabolaSignTable.d.ts +9 -0
- package/lib/exercises/math/functions/trinoms/sign/parabolaSignTable.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/sign/parabolaSignTable.js +123 -0
- package/lib/exercises/math/functions/trinoms/sign/trinomSignTableFromAlgebraicForm.d.ts +13 -0
- package/lib/exercises/math/functions/trinoms/sign/trinomSignTableFromAlgebraicForm.d.ts.map +1 -0
- package/lib/exercises/math/functions/trinoms/sign/trinomSignTableFromAlgebraicForm.js +209 -0
- package/lib/exercises/math/probaStat/index.js +1 -0
- package/lib/exercises/math/probaStat/trees/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/trees/index.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/trees/index.js +1 -0
- package/lib/exercises/math/probaStat/trees/treeInInstruction.d.ts +8 -0
- package/lib/exercises/math/probaStat/trees/treeInInstruction.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/trees/treeInInstruction.js +110 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticVariations.d.ts +13 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticVariations.d.ts.map +1 -0
- package/lib/exercises/math/sequences/arithmetic/arithmeticVariations.js +163 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts +1 -0
- package/lib/exercises/math/sequences/arithmetic/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/index.js +1 -0
- package/lib/index.d.ts +37 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.d.ts +1 -1
- package/lib/math/polynomials/trinom.d.ts.map +1 -1
- package/lib/math/polynomials/trinom.js +5 -2
- package/lib/tree/nodes/numbers/constantNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.js +7 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts +1 -0
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Trinom, TrinomConstructor } from "../../../../../math/polynomials/trinom.js";
|
|
4
|
+
import { opposite } from "../../../../../tree/nodes/functions/oppositeNode.js";
|
|
5
|
+
import { sqrt } from "../../../../../tree/nodes/functions/sqrtNode.js";
|
|
6
|
+
import { add } from "../../../../../tree/nodes/operators/addNode.js";
|
|
7
|
+
import { frac } from "../../../../../tree/nodes/operators/fractionNode.js";
|
|
8
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { square } from "../../../../../tree/nodes/operators/powerNode.js";
|
|
10
|
+
import { substract } from "../../../../../tree/nodes/operators/substractNode.js";
|
|
11
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
12
|
+
const getAnswerTable = (identifiers) => {
|
|
13
|
+
const { a, b, c } = identifiers;
|
|
14
|
+
const trinom = new Trinom(a, b, c);
|
|
15
|
+
const roots = trinom.getRootsNode();
|
|
16
|
+
const sign = a > 0 ? "+" : "-";
|
|
17
|
+
if (!roots.length) {
|
|
18
|
+
return [
|
|
19
|
+
["$x$", "-\\infty", "\\ ", "+\\infty"],
|
|
20
|
+
["$f(x)$", "\\ ", sign, "\\ "],
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
if (roots.length === 1) {
|
|
24
|
+
const sign = a > 0 ? "+" : "-";
|
|
25
|
+
return [
|
|
26
|
+
["$x$", "-\\infty", "\\ ", roots[0].toTex(), "\\ ", "+\\infty"],
|
|
27
|
+
["$f(x)$", "\\ ", sign, "0", sign, "\\ "],
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
const opp = a > 0 ? "-" : "+";
|
|
31
|
+
return [
|
|
32
|
+
[
|
|
33
|
+
"$x$",
|
|
34
|
+
"-\\infty",
|
|
35
|
+
"\\ ",
|
|
36
|
+
roots[0].toTex(),
|
|
37
|
+
"\\ ",
|
|
38
|
+
roots[1].toTex(),
|
|
39
|
+
"\\ ",
|
|
40
|
+
"+\\infty",
|
|
41
|
+
],
|
|
42
|
+
["$f(x)$", "\\ ", sign, "0", opp, "0", sign, "\\ "],
|
|
43
|
+
];
|
|
44
|
+
};
|
|
45
|
+
const getInstruction = (identifiers) => {
|
|
46
|
+
const { a, b, c, form } = identifiers;
|
|
47
|
+
const trinom = new Trinom(a, b, c);
|
|
48
|
+
const eq = form === "dev"
|
|
49
|
+
? trinom.toTree()
|
|
50
|
+
: form === "cano"
|
|
51
|
+
? trinom.getCanonicalForm()
|
|
52
|
+
: trinom.toFactorized();
|
|
53
|
+
return `Soit $f$ la fonction polynôme du second degré définie sur $\\mathbb{R}$ par :
|
|
54
|
+
|
|
55
|
+
$$
|
|
56
|
+
f(x)=${eq.toTex()}
|
|
57
|
+
$$
|
|
58
|
+
|
|
59
|
+
Dresser le tableau de signes de $f$.
|
|
60
|
+
`;
|
|
61
|
+
};
|
|
62
|
+
const getHint = () => {
|
|
63
|
+
return `Un trinôme est du signe de son coefficient $a$, sauf entre ses éventuelles racines.
|
|
64
|
+
|
|
65
|
+
Il faut donc commencer par déterminer les solutions de l'équation $f(x) = 0$.`;
|
|
66
|
+
};
|
|
67
|
+
const getCorrection = (identifiers) => {
|
|
68
|
+
const { a, b, c, form } = identifiers;
|
|
69
|
+
const aSign = a > 0 ? "positive" : "négative";
|
|
70
|
+
const aInvSign = a > 0 ? "négative" : "positive";
|
|
71
|
+
const trinom = new Trinom(a, b, c);
|
|
72
|
+
const roots = trinom.getRootsNode();
|
|
73
|
+
let rootsTex = ``;
|
|
74
|
+
if (form === "dev") {
|
|
75
|
+
const delta = trinom.getDeltaNode();
|
|
76
|
+
rootsTex = `On calcule le discriminant :
|
|
77
|
+
|
|
78
|
+
$$
|
|
79
|
+
\\Delta = b^2 - 4ac= ${delta.toTex()}
|
|
80
|
+
$$
|
|
81
|
+
|
|
82
|
+
Puisque $\\Delta>0$, $f$ possède deux racines :
|
|
83
|
+
|
|
84
|
+
$$
|
|
85
|
+
x_1 = \\frac{-b-\\sqrt{\\Delta}}{2a} = ${frac(substract(opposite(b), sqrt(delta)), multiply(2, a))
|
|
86
|
+
.simplify()
|
|
87
|
+
.toTex()}
|
|
88
|
+
$$
|
|
89
|
+
|
|
90
|
+
$$
|
|
91
|
+
x_2 = \\frac{-b+\\sqrt{\\Delta}}{2a} = ${frac(add(opposite(b), sqrt(delta)), multiply(2, a))
|
|
92
|
+
.simplify()
|
|
93
|
+
.toTex()}
|
|
94
|
+
$$`;
|
|
95
|
+
}
|
|
96
|
+
else if (form === "cano") {
|
|
97
|
+
const alpha = trinom.getAlphaNode();
|
|
98
|
+
const beta = trinom.getBetaNode();
|
|
99
|
+
const cano = trinom.getCanonicalForm();
|
|
100
|
+
rootsTex = `On a :
|
|
101
|
+
|
|
102
|
+
$$
|
|
103
|
+
${cano.toTex()}=0 \\iff ${square(substract("x", alpha).simplify()).toTex()} = ${frac(opposite(beta), a).simplify().toTex()}
|
|
104
|
+
$$
|
|
105
|
+
|
|
106
|
+
Cela donne deux équations à résoudre :
|
|
107
|
+
|
|
108
|
+
$$
|
|
109
|
+
${substract("x", alpha).simplify().toTex()} = ${sqrt(frac(opposite(beta), a).simplify()).toTex()}
|
|
110
|
+
$$
|
|
111
|
+
|
|
112
|
+
d'où $x = ${substract(sqrt(frac(opposite(beta), a)), alpha)
|
|
113
|
+
.simplify()
|
|
114
|
+
.toTex()}$, et :
|
|
115
|
+
|
|
116
|
+
$$
|
|
117
|
+
${substract("x", alpha).simplify().toTex()} = ${opposite(sqrt(frac(opposite(beta), a).simplify())).toTex()}
|
|
118
|
+
$$
|
|
119
|
+
|
|
120
|
+
d'où $x = ${substract(opposite(sqrt(frac(opposite(beta), a))), alpha)
|
|
121
|
+
.simplify()
|
|
122
|
+
.toTex()}$.
|
|
123
|
+
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
rootsTex = `Puisque $f$ est donnée sous forme factorisée, on peut facilement déterminer ses racines : ce sont $${roots[0].toTex()}$ et $${roots[1].toTex()}$.`;
|
|
128
|
+
}
|
|
129
|
+
return `Un trinôme est du signe de son coefficient $a$, sauf entre ses éventuelles racines. Ici, $f$ est donc ${aSign} sauf entre ses racines (si elle en a) où elle est ${aInvSign}.
|
|
130
|
+
|
|
131
|
+
On commence donc par déterminer les racines de $f$.
|
|
132
|
+
|
|
133
|
+
${rootsTex}
|
|
134
|
+
|
|
135
|
+
On en conclut donc que $f$ est ${aSign} sur $\\left]-\\infty; ${roots[0].toTex()}\\right]$ et sur $\\left[${roots[1].toTex()}; +\\infty\\right[$, et ${aInvSign} sur $\\left[${roots[0].toTex()}; ${roots[1].toTex()}\\right]$.
|
|
136
|
+
`;
|
|
137
|
+
};
|
|
138
|
+
const isAnswerTableValid = (ans, { answerTable }) => {
|
|
139
|
+
try {
|
|
140
|
+
return ans.every((row, i) => row.every((cell, j) => cell === answerTable[i][j]));
|
|
141
|
+
}
|
|
142
|
+
catch (err) {
|
|
143
|
+
return handleVEAError(err);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const getTrinomSignTableFromAlgebraicFormQuestion = (opts) => {
|
|
147
|
+
const form = opts?.givenForm === "Forme canonique"
|
|
148
|
+
? "cano"
|
|
149
|
+
: opts?.givenForm === "Forme factorisée"
|
|
150
|
+
? "facto"
|
|
151
|
+
: "dev";
|
|
152
|
+
let trinom;
|
|
153
|
+
if (form === "cano") {
|
|
154
|
+
trinom = TrinomConstructor.randomNiceRootsAndSummit(2);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
trinom = TrinomConstructor.randomNiceRoots(2);
|
|
158
|
+
}
|
|
159
|
+
const identifiers = {
|
|
160
|
+
form,
|
|
161
|
+
a: trinom.a,
|
|
162
|
+
b: trinom.b,
|
|
163
|
+
c: trinom.c,
|
|
164
|
+
};
|
|
165
|
+
return getQuestionFromIdentifiers(identifiers, opts);
|
|
166
|
+
};
|
|
167
|
+
const getKeys = () => {
|
|
168
|
+
return ["infty"];
|
|
169
|
+
};
|
|
170
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
171
|
+
return {
|
|
172
|
+
answerTable: getAnswerTable(identifiers, opts),
|
|
173
|
+
instruction: getInstruction(identifiers, opts),
|
|
174
|
+
answerFormat: "tex",
|
|
175
|
+
keys: getKeys(identifiers),
|
|
176
|
+
identifiers,
|
|
177
|
+
hint: getHint(identifiers, opts),
|
|
178
|
+
correction: getCorrection(identifiers, opts),
|
|
179
|
+
initTable: [
|
|
180
|
+
["$x$", "", "\\ ", "", "\\ ", "", "\\ ", ""],
|
|
181
|
+
["$f(x)$", "\\ ", "", "", "", "", "", "\\ "],
|
|
182
|
+
],
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
const options = [
|
|
186
|
+
{
|
|
187
|
+
id: "givenForm",
|
|
188
|
+
label: "Forme donnée",
|
|
189
|
+
target: GeneratorOptionTarget.generation,
|
|
190
|
+
type: GeneratorOptionType.select,
|
|
191
|
+
values: ["Forme développée", "Forme factorisée", "Forme canonique"],
|
|
192
|
+
defaultValue: "Forme développée",
|
|
193
|
+
},
|
|
194
|
+
];
|
|
195
|
+
export const trinomSignTableFromAlgebraicForm = {
|
|
196
|
+
id: "trinomSignTableFromAlgebraicForm",
|
|
197
|
+
label: "Dresser le tableau de signes d'un trinôme donné sous forme algébrique",
|
|
198
|
+
isSingleStep: true,
|
|
199
|
+
generator: (nb, opts) => getDistinctQuestions(() => getTrinomSignTableFromAlgebraicFormQuestion(opts), nb),
|
|
200
|
+
qcmTimer: 60,
|
|
201
|
+
freeTimer: 60,
|
|
202
|
+
subject: "Mathématiques",
|
|
203
|
+
getQuestionFromIdentifiers,
|
|
204
|
+
hasHintAndCorrection: true,
|
|
205
|
+
answerType: "signTable",
|
|
206
|
+
options,
|
|
207
|
+
isAnswerTableValid,
|
|
208
|
+
getKeys,
|
|
209
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./treeInInstruction.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type TreeDiagram = string[][][][];
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
tree: TreeDiagram;
|
|
5
|
+
};
|
|
6
|
+
export declare const treeInInstruction: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=treeInInstruction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treeInInstruction.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/treeInInstruction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAQrC,KAAK,WAAW,GAAG,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;AAClC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,WAAW,CAAC;CACnB,CAAC;AAiGF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAkBnD,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
|
|
4
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
7
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
8
|
+
const getPropositions = (n, { answer }) => {
|
|
9
|
+
const propositions = [];
|
|
10
|
+
addValidProp(propositions, answer);
|
|
11
|
+
propWhile(propositions, n, () => {
|
|
12
|
+
tryToAddWrongProp(propositions, randint(-10, 10) + "");
|
|
13
|
+
});
|
|
14
|
+
return shuffleProps(propositions, n);
|
|
15
|
+
};
|
|
16
|
+
const getAnswer = () => {
|
|
17
|
+
return "prout";
|
|
18
|
+
};
|
|
19
|
+
const getInstruction = (identifiers) => {
|
|
20
|
+
const { tree } = identifiers;
|
|
21
|
+
return `Bla bla bla voici un arbre de proba :
|
|
22
|
+
|
|
23
|
+
<svg id="treeDiagram">${JSON.stringify(tree)}</svg>
|
|
24
|
+
|
|
25
|
+
Comment ça va ajd ?`;
|
|
26
|
+
};
|
|
27
|
+
const getHint = () => {
|
|
28
|
+
return `indice`;
|
|
29
|
+
};
|
|
30
|
+
const getCorrection = () => {
|
|
31
|
+
return `correction`;
|
|
32
|
+
};
|
|
33
|
+
const getKeys = () => {
|
|
34
|
+
return [];
|
|
35
|
+
};
|
|
36
|
+
const isAnswerValid = () => {
|
|
37
|
+
try {
|
|
38
|
+
return coinFlip();
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
return handleVEAError(err);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const getTreeInInstructionQuestion = () => {
|
|
45
|
+
const steps = randint(2, 4);
|
|
46
|
+
const randomBlock = () => {
|
|
47
|
+
const branches = randint(2, 4);
|
|
48
|
+
const isDecimal = coinFlip();
|
|
49
|
+
const value = () => {
|
|
50
|
+
return isDecimal
|
|
51
|
+
? randfloat(0.1, 1, 2)
|
|
52
|
+
: RationalConstructor.randomIrreductibleProba().toTree().toTex();
|
|
53
|
+
};
|
|
54
|
+
const res = [
|
|
55
|
+
[`£${value()}£`, "£A£"],
|
|
56
|
+
[`£${value()}£`, "£B£"],
|
|
57
|
+
];
|
|
58
|
+
if (branches === 3)
|
|
59
|
+
res.push([`£${value()}£`, "£C£"]);
|
|
60
|
+
return res;
|
|
61
|
+
};
|
|
62
|
+
const firstBlock = randomBlock();
|
|
63
|
+
const firstBlockLength = firstBlock.length;
|
|
64
|
+
const tree = [[firstBlock], []];
|
|
65
|
+
for (let i = 0; i < firstBlockLength; i++) {
|
|
66
|
+
tree[1].push(randomBlock());
|
|
67
|
+
}
|
|
68
|
+
if (steps === 3) {
|
|
69
|
+
tree.push([]);
|
|
70
|
+
tree[1].forEach((block) => {
|
|
71
|
+
const length = block.length;
|
|
72
|
+
for (let i = 0; i < length; i++) {
|
|
73
|
+
tree[2].push(randomBlock());
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
const identifiers = {
|
|
78
|
+
tree,
|
|
79
|
+
};
|
|
80
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
81
|
+
};
|
|
82
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
83
|
+
return {
|
|
84
|
+
answer: getAnswer(identifiers),
|
|
85
|
+
instruction: getInstruction(identifiers),
|
|
86
|
+
keys: getKeys(identifiers),
|
|
87
|
+
answerFormat: "tex",
|
|
88
|
+
identifiers,
|
|
89
|
+
hint: getHint(identifiers),
|
|
90
|
+
correction: getCorrection(identifiers),
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export const treeInInstruction = {
|
|
94
|
+
id: "treeInInstruction",
|
|
95
|
+
connector: "=",
|
|
96
|
+
label: "Test arbre in instruction",
|
|
97
|
+
isSingleStep: true,
|
|
98
|
+
generator: (nb, opts) => getDistinctQuestions(() => getTreeInInstructionQuestion(opts), nb),
|
|
99
|
+
qcmTimer: 60,
|
|
100
|
+
freeTimer: 60,
|
|
101
|
+
getPropositions,
|
|
102
|
+
isAnswerValid,
|
|
103
|
+
subject: "Mathématiques",
|
|
104
|
+
getInstruction,
|
|
105
|
+
getHint,
|
|
106
|
+
getCorrection,
|
|
107
|
+
getAnswer,
|
|
108
|
+
getQuestionFromIdentifiers,
|
|
109
|
+
hasHintAndCorrection: true,
|
|
110
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
firstRank: number;
|
|
4
|
+
firstTerm: number;
|
|
5
|
+
reason: number;
|
|
6
|
+
form: "explicit" | "recu" | "termAndReason";
|
|
7
|
+
};
|
|
8
|
+
type Options = {
|
|
9
|
+
forms: string[];
|
|
10
|
+
};
|
|
11
|
+
export declare const arithmeticVariations: Exercise<Identifiers, Options>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=arithmeticVariations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arithmeticVariations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/arithmeticVariations.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,eAAe,CAAC;CAC7C,CAAC;AA+HF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AAoBF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA8B/D,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
5
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
6
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
7
|
+
const getPropositions = (n, { answer }) => {
|
|
8
|
+
const propositions = [];
|
|
9
|
+
addValidProp(propositions, answer, "raw");
|
|
10
|
+
tryToAddWrongProp(propositions, "Strictement croissante", "raw");
|
|
11
|
+
tryToAddWrongProp(propositions, "Strictement décroissante", "raw");
|
|
12
|
+
tryToAddWrongProp(propositions, "Constante", "raw");
|
|
13
|
+
tryToAddWrongProp(propositions, "Non monotone", "raw");
|
|
14
|
+
return shuffleProps(propositions, n);
|
|
15
|
+
};
|
|
16
|
+
const getAnswer = (identifiers) => {
|
|
17
|
+
const { reason } = identifiers;
|
|
18
|
+
return reason > 0 ? "Strictement croissante" : "Strictement décroissante";
|
|
19
|
+
};
|
|
20
|
+
const getInstruction = (identifiers) => {
|
|
21
|
+
const { firstRank, firstTerm, form, reason } = identifiers;
|
|
22
|
+
const def = form === "explicit"
|
|
23
|
+
? `, pour tout $n\\geq ${firstRank}$ :
|
|
24
|
+
|
|
25
|
+
$$
|
|
26
|
+
u_n = ${add(firstTerm, multiply(reason, "n"))
|
|
27
|
+
.simplify({ forbidFactorize: true })
|
|
28
|
+
.toTex()}
|
|
29
|
+
$$`
|
|
30
|
+
: form === "recu"
|
|
31
|
+
? ` :
|
|
32
|
+
|
|
33
|
+
$$
|
|
34
|
+
\\left\\{\\begin{matrix}
|
|
35
|
+
u_{${firstRank}} = ${firstTerm} \\\\
|
|
36
|
+
u_{n+1} = ${add("u_n", reason).toTex()} \\text{ pour }n\\geq ${firstRank}
|
|
37
|
+
\\end{matrix}\\right.
|
|
38
|
+
$$
|
|
39
|
+
|
|
40
|
+
`
|
|
41
|
+
: ` son premier terme $u_{${firstRank}} = ${firstTerm}$ et sa raison $r = ${reason}$.`;
|
|
42
|
+
return `On considère une suite arithmétique $u$, définie par${def}
|
|
43
|
+
|
|
44
|
+
Quel est le sens de variation de $u$ ?
|
|
45
|
+
`;
|
|
46
|
+
};
|
|
47
|
+
const getHint = () => {
|
|
48
|
+
return `Une suite arithmétique de raison $r$ est :
|
|
49
|
+
|
|
50
|
+
- strictement croissante si $r>0$;
|
|
51
|
+
- strictement décroissante si $r<0$;
|
|
52
|
+
- constante si $r = 0$.`;
|
|
53
|
+
};
|
|
54
|
+
const getCorrection = (identifiers) => {
|
|
55
|
+
const { reason, firstTerm, form } = identifiers;
|
|
56
|
+
const sign = reason > 0 ? "positive" : "négative";
|
|
57
|
+
const way = reason > 0 ? "croissante" : "décroissante";
|
|
58
|
+
if (form === "explicit") {
|
|
59
|
+
return `Puisque la formule explicite de $u$ est :
|
|
60
|
+
|
|
61
|
+
$$
|
|
62
|
+
u_n = ${add(firstTerm, multiply(reason, "n"))
|
|
63
|
+
.simplify({ forbidFactorize: true })
|
|
64
|
+
.toTex()}
|
|
65
|
+
$$
|
|
66
|
+
|
|
67
|
+
alors $u$ est une suite de premier terme $${firstTerm}$ et de raison $${reason}$.
|
|
68
|
+
|
|
69
|
+
Puisque la raison $${reason}$ est strictement ${sign}, alors $u$ est strictement ${way}.`;
|
|
70
|
+
}
|
|
71
|
+
if (form === "recu") {
|
|
72
|
+
return `La suite $u$ est définie par une formule de récurrence :
|
|
73
|
+
|
|
74
|
+
$$
|
|
75
|
+
u_{n+1} = ${add("u_n", reason).toTex()}
|
|
76
|
+
$$
|
|
77
|
+
|
|
78
|
+
La raison de la suite $u$ est donc $${reason}$.
|
|
79
|
+
|
|
80
|
+
Puisque la raison $${reason}$ est strictement ${sign}, alors $u$ est strictement ${way}.`;
|
|
81
|
+
}
|
|
82
|
+
return `Puisque la raison $${reason}$ de la suite $u$ est strictement ${sign}, alors $u$ est strictement ${way}.`;
|
|
83
|
+
};
|
|
84
|
+
const getArithmeticVariationsQuestion = (opts) => {
|
|
85
|
+
const form = opts?.forms
|
|
86
|
+
? random(opts.forms)
|
|
87
|
+
: random([
|
|
88
|
+
"Formule explicite",
|
|
89
|
+
"Formule de récurrence",
|
|
90
|
+
"Premier terme et raison",
|
|
91
|
+
]);
|
|
92
|
+
const firstRank = random([0, 1]);
|
|
93
|
+
const firstTerm = randint(-9, 10);
|
|
94
|
+
const reason = randint(-9, 10, [0]);
|
|
95
|
+
const identifiers = {
|
|
96
|
+
form: form === "Formule explicite"
|
|
97
|
+
? "explicit"
|
|
98
|
+
: form === "Formule de récurrence"
|
|
99
|
+
? "recu"
|
|
100
|
+
: "termAndReason",
|
|
101
|
+
firstRank,
|
|
102
|
+
firstTerm,
|
|
103
|
+
reason,
|
|
104
|
+
};
|
|
105
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
106
|
+
};
|
|
107
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
108
|
+
return {
|
|
109
|
+
answer: getAnswer(identifiers),
|
|
110
|
+
instruction: getInstruction(identifiers),
|
|
111
|
+
answerFormat: "raw",
|
|
112
|
+
identifiers,
|
|
113
|
+
hint: getHint(identifiers),
|
|
114
|
+
correction: getCorrection(identifiers),
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
const options = [
|
|
118
|
+
{
|
|
119
|
+
id: "forms",
|
|
120
|
+
label: "Type de définition de la suite",
|
|
121
|
+
target: GeneratorOptionTarget.generation,
|
|
122
|
+
type: GeneratorOptionType.multiselect,
|
|
123
|
+
values: [
|
|
124
|
+
"Formule explicite",
|
|
125
|
+
"Formule de récurrence",
|
|
126
|
+
"Premier terme et raison",
|
|
127
|
+
],
|
|
128
|
+
defaultValue: [
|
|
129
|
+
"Formule explicite",
|
|
130
|
+
"Formule de récurrence",
|
|
131
|
+
"Premier terme et raison",
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
export const arithmeticVariations = {
|
|
136
|
+
id: "arithmeticVariations",
|
|
137
|
+
label: "Déterminer le sens de variation d'une suite arithmétique",
|
|
138
|
+
isSingleStep: true,
|
|
139
|
+
generator: (nb, opts) => getDistinctQuestions(() => getArithmeticVariationsQuestion(opts), nb),
|
|
140
|
+
qcmTimer: 60,
|
|
141
|
+
freeTimer: 60,
|
|
142
|
+
getPropositions,
|
|
143
|
+
subject: "Mathématiques",
|
|
144
|
+
getInstruction,
|
|
145
|
+
getHint,
|
|
146
|
+
getCorrection,
|
|
147
|
+
getAnswer,
|
|
148
|
+
getQuestionFromIdentifiers,
|
|
149
|
+
hasHintAndCorrection: true,
|
|
150
|
+
answerType: "QCU",
|
|
151
|
+
options,
|
|
152
|
+
validateOptions: (opts) => {
|
|
153
|
+
return opts.forms.length > 0
|
|
154
|
+
? {
|
|
155
|
+
message: "OK",
|
|
156
|
+
valid: true,
|
|
157
|
+
}
|
|
158
|
+
: {
|
|
159
|
+
message: "Veuillez choisir au moins un type de définition de la suite.",
|
|
160
|
+
valid: false,
|
|
161
|
+
};
|
|
162
|
+
},
|
|
163
|
+
};
|
|
@@ -17,4 +17,5 @@ export * from "./arithmeticFindRandomTermFromTwoTerms.js";
|
|
|
17
17
|
export * from "./arithmeticFindTerm.js";
|
|
18
18
|
export * from "./arithmeticFindTermFirstRankOne.js";
|
|
19
19
|
export * from "./arithmeticFindAntecedent.js";
|
|
20
|
+
export * from "./arithmeticVariations.js";
|
|
20
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AAEpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yBAAyB,CAAC;AACxC,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/arithmetic/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AAEpD,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAE/D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uCAAuC,CAAC;AACtD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mDAAmD,CAAC;AAClE,cAAc,sCAAsC,CAAC;AACrD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,yBAAyB,CAAC;AACxC,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1346,8 +1346,11 @@ declare const mathExercises: (Exercise<{
|
|
|
1346
1346
|
a: number;
|
|
1347
1347
|
b: number;
|
|
1348
1348
|
c: number;
|
|
1349
|
-
isDevForm
|
|
1350
|
-
|
|
1349
|
+
isDevForm?: boolean;
|
|
1350
|
+
form?: "cano" | "dev" | "facto";
|
|
1351
|
+
}, {
|
|
1352
|
+
form: string[];
|
|
1353
|
+
}> | Exercise<{
|
|
1351
1354
|
a: number;
|
|
1352
1355
|
b: number;
|
|
1353
1356
|
c: number;
|
|
@@ -1360,8 +1363,21 @@ declare const mathExercises: (Exercise<{
|
|
|
1360
1363
|
a: number;
|
|
1361
1364
|
b: number;
|
|
1362
1365
|
type: number;
|
|
1363
|
-
},
|
|
1366
|
+
}, {
|
|
1367
|
+
factoType: string[];
|
|
1368
|
+
}> | Exercise<{
|
|
1364
1369
|
coeffs: number[];
|
|
1370
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1371
|
+
equations: {
|
|
1372
|
+
a: number;
|
|
1373
|
+
b: number;
|
|
1374
|
+
c: number;
|
|
1375
|
+
form: "dev" | "cano" | "facto";
|
|
1376
|
+
}[];
|
|
1377
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1378
|
+
aIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1379
|
+
bIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1380
|
+
cIds: import("./tree/nodes/nodeConstructor.js").NodeIdentifiers;
|
|
1365
1381
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1366
1382
|
roots: number[];
|
|
1367
1383
|
a: number;
|
|
@@ -1408,6 +1424,17 @@ declare const mathExercises: (Exercise<{
|
|
|
1408
1424
|
trinomCoeffs: number[];
|
|
1409
1425
|
isAskingPositive: boolean;
|
|
1410
1426
|
isStrict: boolean;
|
|
1427
|
+
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1428
|
+
a: number;
|
|
1429
|
+
b: number;
|
|
1430
|
+
c: number;
|
|
1431
|
+
form: "dev" | "cano" | "facto";
|
|
1432
|
+
}, {
|
|
1433
|
+
givenForm: string;
|
|
1434
|
+
}> | Exercise<{
|
|
1435
|
+
a: number;
|
|
1436
|
+
b: number;
|
|
1437
|
+
c: number;
|
|
1411
1438
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
1412
1439
|
param: string;
|
|
1413
1440
|
coeffs: number[];
|
|
@@ -3108,6 +3135,13 @@ declare const mathExercises: (Exercise<{
|
|
|
3108
3135
|
b: number;
|
|
3109
3136
|
n: number;
|
|
3110
3137
|
}, Record<string, string | boolean | string[]>> | Exercise<{
|
|
3138
|
+
firstRank: number;
|
|
3139
|
+
firstTerm: number;
|
|
3140
|
+
reason: number;
|
|
3141
|
+
form: "explicit" | "recu" | "termAndReason";
|
|
3142
|
+
}, {
|
|
3143
|
+
forms: string[];
|
|
3144
|
+
}> | Exercise<{
|
|
3111
3145
|
firstValue: number;
|
|
3112
3146
|
reason: number;
|
|
3113
3147
|
askedRank: number;
|
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"}
|
|
@@ -46,7 +46,7 @@ export declare abstract class TrinomConstructor {
|
|
|
46
46
|
excludes?: number[];
|
|
47
47
|
}): Trinom;
|
|
48
48
|
static randomNiceRoots(nbOfRoots?: number): Trinom;
|
|
49
|
-
static randomNiceRootsAndSummit(): Trinom;
|
|
49
|
+
static randomNiceRootsAndSummit(nbOfRoots?: number): Trinom;
|
|
50
50
|
static fromCoeffs(coeffs: number[]): Trinom;
|
|
51
51
|
static fromRoots(roots: number[], a: number): Trinom;
|
|
52
52
|
static fromAlphaBeta(params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trinom.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/trinom.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAO,OAAO,EAAE,MAAM,uCAAuC,CAAC;AAErE,OAA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