math-exercises 1.3.27 → 1.3.29
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/derivation/derivative/constanteDerivative.d.ts +4 -0
- package/lib/exercises/derivation/derivative/constanteDerivative.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/constanteDerivative.js +27 -0
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.js +1 -1
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +1 -1
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.js +1 -1
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +1 -1
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +1 -4
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +2 -2
- package/lib/exercises/derivation/derivative/usualderivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/usualderivative.js +4 -1
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +2 -0
- package/lib/exercises/proba/probabilityTree.d.ts.map +1 -1
- package/lib/exercises/proba/probabilityTree.js +10 -11
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constanteDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/constanteDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAI9D,eAAO,MAAM,mBAAmB,EAAE,QAUjC,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,QAAQ,CAWjD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getConstanteDerivative = exports.constanteDerivative = void 0;
|
|
4
|
+
const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
|
|
5
|
+
const randint_1 = require("../../../math/utils/random/randint");
|
|
6
|
+
exports.constanteDerivative = {
|
|
7
|
+
id: 'constanteDerivative',
|
|
8
|
+
connector: '=',
|
|
9
|
+
instruction: '',
|
|
10
|
+
label: "Dérivée d'une constante",
|
|
11
|
+
levels: ['1', '0'],
|
|
12
|
+
section: 'Dérivation',
|
|
13
|
+
isSingleStep: false,
|
|
14
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getConstanteDerivative, nb),
|
|
15
|
+
keys: ['x'],
|
|
16
|
+
};
|
|
17
|
+
function getConstanteDerivative() {
|
|
18
|
+
const c = (0, randint_1.randint)(-9, 10, [0]);
|
|
19
|
+
const question = {
|
|
20
|
+
instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${c}$ `,
|
|
21
|
+
startStatement: `f'(x)`,
|
|
22
|
+
answer: '0',
|
|
23
|
+
keys: [],
|
|
24
|
+
};
|
|
25
|
+
return question;
|
|
26
|
+
}
|
|
27
|
+
exports.getConstanteDerivative = getConstanteDerivative;
|
|
@@ -16,7 +16,7 @@ exports.firstDegreeDerivative = {
|
|
|
16
16
|
keys: ['x'],
|
|
17
17
|
};
|
|
18
18
|
function getFirstDegreeDerivative() {
|
|
19
|
-
const [a, b] = [(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10)];
|
|
19
|
+
const [a, b] = [(0, randint_1.randint)(-9, 10, [0]), (0, randint_1.randint)(-9, 10)];
|
|
20
20
|
const polynomial = new polynomial_1.Polynomial([b, a]);
|
|
21
21
|
const question = {
|
|
22
22
|
instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) = ${polynomial.toString()}$ `,
|
|
@@ -15,7 +15,7 @@ exports.inverseFunctionDerivative = {
|
|
|
15
15
|
keys: ['x'],
|
|
16
16
|
};
|
|
17
17
|
function getInverseFunctionDerivative() {
|
|
18
|
-
const a = (0, randint_1.randint)(-
|
|
18
|
+
const a = (0, randint_1.randint)(-9, 10, [0]);
|
|
19
19
|
const question = {
|
|
20
20
|
instruction: `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) =\\frac{${a}}{x}$ `,
|
|
21
21
|
startStatement: `f'(x)`,
|
|
@@ -20,7 +20,7 @@ exports.powerFunctionDerivative = {
|
|
|
20
20
|
keys: ['x'],
|
|
21
21
|
};
|
|
22
22
|
function getPowerFunctionDerivative() {
|
|
23
|
-
const a = (0, randint_1.randint)(-
|
|
23
|
+
const a = (0, randint_1.randint)(-9, 10, [0]);
|
|
24
24
|
const n = (0, randint_1.randint)(2, 10);
|
|
25
25
|
const statement = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a), new powerNode_1.PowerNode(new variableNode_1.VariableNode('x'), new numberNode_1.NumberNode(n))));
|
|
26
26
|
const answerStatement = (0, simplify_1.simplifyNode)(new multiplyNode_1.MultiplyNode(new numberNode_1.NumberNode(a * n), new powerNode_1.PowerNode(new variableNode_1.VariableNode('x'), new numberNode_1.NumberNode(n - 1))));
|
|
@@ -16,7 +16,7 @@ exports.rootFunctionDerivative = {
|
|
|
16
16
|
keys: ['x'],
|
|
17
17
|
};
|
|
18
18
|
function getRootFunctionDerivative() {
|
|
19
|
-
const a = (0, randint_1.randint)(-
|
|
19
|
+
const a = (0, randint_1.randint)(-9, 10, [0]);
|
|
20
20
|
let instruction = `Déterminer la fonction dérivée $f'$ de la fonction $f$ définie par $f(x) =$ `;
|
|
21
21
|
let answer = '';
|
|
22
22
|
if (a === 1)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/secondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK9D,eAAO,MAAM,sBAAsB,EAAE,QAUpC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"secondDegreeDerivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/secondDegreeDerivative.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAK9D,eAAO,MAAM,sBAAsB,EAAE,QAUpC,CAAC;AAEF,wBAAgB,yBAAyB,IAAI,QAAQ,CAcpD"}
|
|
@@ -16,10 +16,7 @@ exports.secondDegreeDerivative = {
|
|
|
16
16
|
keys: ['x'],
|
|
17
17
|
};
|
|
18
18
|
function getSecondDegreeDerivative() {
|
|
19
|
-
const coefficients = [];
|
|
20
|
-
coefficients.push((0, randint_1.randint)(-9, 10, [0]));
|
|
21
|
-
for (let i = 1; i <= 2; i++)
|
|
22
|
-
coefficients.push((0, randint_1.randint)(-9, 10));
|
|
19
|
+
const coefficients = [(0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10), (0, randint_1.randint)(-9, 10, [0])];
|
|
23
20
|
const polynomial = new polynomial_1.Polynomial(coefficients);
|
|
24
21
|
const derivative = polynomial.derivate();
|
|
25
22
|
const question = {
|
|
@@ -17,9 +17,9 @@ exports.thirdDegreeDerivative = {
|
|
|
17
17
|
};
|
|
18
18
|
function getThirdDegreeDerivative() {
|
|
19
19
|
const coefficients = [];
|
|
20
|
-
coefficients.push((0, randint_1.randint)(-10, 10, [0]));
|
|
21
20
|
for (let i = 1; i <= 3; i++)
|
|
22
|
-
coefficients.push((0, randint_1.randint)(-
|
|
21
|
+
coefficients.push((0, randint_1.randint)(-9, 10));
|
|
22
|
+
coefficients.push((0, randint_1.randint)(-9, 10, [0]));
|
|
23
23
|
const polynomial = new polynomial_1.Polynomial(coefficients);
|
|
24
24
|
const derivative = polynomial.derivate();
|
|
25
25
|
const question = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usualderivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/usualderivative.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"usualderivative.d.ts","sourceRoot":"","sources":["../../../../src/exercises/derivation/derivative/usualderivative.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAUpD,eAAO,MAAM,eAAe,EAAE,QAU7B,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,QAAQ,CAqB7C"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getUsualDerivative = exports.usualDerivative = void 0;
|
|
4
4
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
5
5
|
const getDistinctQuestions_1 = require("../../utils/getDistinctQuestions");
|
|
6
|
+
const constanteDerivative_1 = require("./constanteDerivative");
|
|
6
7
|
const firstDegreeDerivative_1 = require("./firstDegreeDerivative");
|
|
7
8
|
const inverseFunctionDerivative_1 = require("./inverseFunctionDerivative");
|
|
8
9
|
const powerFunctionDerivative_1 = require("./powerFunctionDerivative");
|
|
@@ -21,7 +22,7 @@ exports.usualDerivative = {
|
|
|
21
22
|
keys: ['x'],
|
|
22
23
|
};
|
|
23
24
|
function getUsualDerivative() {
|
|
24
|
-
const rand = (0, randint_1.randint)(1,
|
|
25
|
+
const rand = (0, randint_1.randint)(1, 8);
|
|
25
26
|
switch (rand) {
|
|
26
27
|
case 1:
|
|
27
28
|
return (0, firstDegreeDerivative_1.getFirstDegreeDerivative)();
|
|
@@ -35,6 +36,8 @@ function getUsualDerivative() {
|
|
|
35
36
|
return (0, powerFunctionDerivative_1.getPowerFunctionDerivative)();
|
|
36
37
|
case 6:
|
|
37
38
|
return (0, rootFunctionDerivative_1.getRootFunctionDerivative)();
|
|
39
|
+
case 7:
|
|
40
|
+
return (0, constanteDerivative_1.getConstanteDerivative)();
|
|
38
41
|
default:
|
|
39
42
|
throw Error('erreur');
|
|
40
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exercises.d.ts","sourceRoot":"","sources":["../../src/exercises/exercises.ts"],"names":[],"mappings":"AA+EA,eAAO,MAAM,SAAS,iCAwHrB,CAAC"}
|
|
@@ -34,6 +34,7 @@ const factoIdRmq1_1 = require("./calculLitteral/factorisation/factoIdRmq1");
|
|
|
34
34
|
const factoIdRmq2_1 = require("./calculLitteral/factorisation/factoIdRmq2");
|
|
35
35
|
const factoIdRmq3_1 = require("./calculLitteral/factorisation/factoIdRmq3");
|
|
36
36
|
const factoType1Exercise_1 = require("./calculLitteral/factorisation/factoType1Exercise");
|
|
37
|
+
const constanteDerivative_1 = require("./derivation/derivative/constanteDerivative");
|
|
37
38
|
const firstDegreeDerivative_1 = require("./derivation/derivative/firstDegreeDerivative");
|
|
38
39
|
const inverseFunctionDerivative_1 = require("./derivation/derivative/inverseFunctionDerivative");
|
|
39
40
|
const powerFunctionDerivative_1 = require("./derivation/derivative/powerFunctionDerivative");
|
|
@@ -162,6 +163,7 @@ exports.exercises = [
|
|
|
162
163
|
reciprocalPercentage_1.reciprocalPercentage,
|
|
163
164
|
averageEvolutionRate_1.averageEvolutionRate,
|
|
164
165
|
usualderivative_1.usualDerivative,
|
|
166
|
+
constanteDerivative_1.constanteDerivative,
|
|
165
167
|
firstDegreeDerivative_1.firstDegreeDerivative,
|
|
166
168
|
secondDegreeDerivative_1.secondDegreeDerivative,
|
|
167
169
|
thirdDegreeDerivative_1.thirdDegreeDerivative,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../src/exercises/proba/probabilityTree.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjD,eAAO,MAAM,eAAe,EAAE,QAS7B,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../src/exercises/proba/probabilityTree.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGjD,eAAO,MAAM,eAAe,EAAE,QAS7B,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,QAAQ,CAwF7C"}
|
|
@@ -60,29 +60,28 @@ function getProbabilityTree() {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
let commands = [
|
|
63
|
-
'Racine = Point({0,0})',
|
|
64
63
|
'A = Point({2,2})',
|
|
65
64
|
'B = Point({2,-2})',
|
|
66
65
|
'AC = Point({5,3})',
|
|
67
66
|
'AD = Point({5,1})',
|
|
68
67
|
'BC = Point({5,-1})',
|
|
69
68
|
'BD = Point({5,-3})',
|
|
70
|
-
'Segment(
|
|
69
|
+
'Segment(Point({0,0}),A)',
|
|
71
70
|
'Segment(A,AC)',
|
|
72
71
|
'Segment(A,AD)',
|
|
73
|
-
'Segment(
|
|
72
|
+
'Segment(Point({0,0}),B)',
|
|
74
73
|
'Segment(B,BC)',
|
|
75
74
|
'Segment(B,BD)',
|
|
76
75
|
'ShowAxes(false)',
|
|
77
76
|
'ShowGrid(false)',
|
|
78
|
-
`Text("${pA.toTex()}", (0.5, 2.5), true, true)`,
|
|
79
|
-
`Text("${pA_C.toTex()}", (3, 4), true, true)`,
|
|
80
|
-
`Text("${pA_D.toTex()}", (3, 1.5), true, true)`,
|
|
81
|
-
`Text("${pB.toTex()}", (0.5, -1), true, true)`,
|
|
82
|
-
`Text("${pB_C.toTex()}", (
|
|
83
|
-
`Text("${pB_D.toTex()}", (3, -2.5), true, true)`,
|
|
77
|
+
`Text("\\scriptsize${pA.toTex()}", (0.5, 2.5), true, true)`,
|
|
78
|
+
`Text("\\scriptsize${pA_C.toTex()}", (3, 4), true, true)`,
|
|
79
|
+
`Text("\\scriptsize${pA_D.toTex()}", (3.2, 1.5), true, true)`,
|
|
80
|
+
`Text("\\scriptsize${pB.toTex()}", (0.5, -1), true, true)`,
|
|
81
|
+
`Text("\\scriptsize${pB_C.toTex()}", (2.8, 0), true, true)`,
|
|
82
|
+
`Text("\\scriptsize${pB_D.toTex()}", (3, -2.5), true, true)`,
|
|
84
83
|
'Text("A", (1.85 , 2.5))',
|
|
85
|
-
'Text("B", (1.85 , -2.
|
|
84
|
+
'Text("B", (1.85 , -2.8))',
|
|
86
85
|
'Text("C", (5.5 , 2.85))',
|
|
87
86
|
'Text("D", (5.5 , 0.85))',
|
|
88
87
|
'Text("C", (5.5 , -1.1))',
|
|
@@ -94,7 +93,7 @@ function getProbabilityTree() {
|
|
|
94
93
|
answer,
|
|
95
94
|
keys: [],
|
|
96
95
|
commands,
|
|
97
|
-
coords: [-2, 8, -
|
|
96
|
+
coords: [-2, 8, -5, 5],
|
|
98
97
|
};
|
|
99
98
|
return question;
|
|
100
99
|
}
|