math-exercises 1.3.66 → 1.3.67
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/calcul/arithmetics/euclideanDivision.js +1 -1
- package/lib/exercises/calcul/arithmetics/primeNumbers.js +1 -1
- package/lib/exercises/calcul/fractions/fractionAndIntegerDivision.js +1 -1
- package/lib/exercises/calcul/rounding/rounding.d.ts.map +1 -1
- package/lib/exercises/calcul/rounding/rounding.js +0 -1
- package/lib/exercises/derivation/derivative/constanteDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/constanteDerivative.js +7 -2
- package/lib/exercises/derivation/derivative/expDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/expDerivativeOne.js +8 -18
- package/lib/exercises/derivation/derivative/expDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/expDerivativeThree.js +8 -17
- package/lib/exercises/derivation/derivative/expDerivativeTwo.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/expDerivativeTwo.js +6 -2
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/firstDegreeDerivative.js +7 -2
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/inverseFunctionDerivative.js +8 -2
- package/lib/exercises/derivation/derivative/lnDerivativeOne.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/lnDerivativeOne.js +16 -20
- package/lib/exercises/derivation/derivative/lnDerivativeThree.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/lnDerivativeThree.js +14 -5
- package/lib/exercises/derivation/derivative/lnDerivativeTwo.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/lnDerivativeTwo.js +8 -2
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/powerFunctionDerivative.js +7 -2
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/rootFunctionDerivative.js +7 -2
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/secondDegreeDerivative.js +5 -1
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeDerivative.js +5 -1
- package/lib/exercises/exercise.d.ts +1 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/exercise.js +13 -0
- package/lib/exercises/exercises.d.ts.map +1 -1
- package/lib/exercises/exercises.js +6 -0
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.d.ts.map +1 -1
- package/lib/exercises/functions/basics/inverseImageFunctionGeogebra.js +0 -1
- package/lib/exercises/limits/polynomeLimit.js +2 -2
- package/lib/exercises/limits/sequenceGeometricLimit.d.ts +4 -0
- package/lib/exercises/limits/sequenceGeometricLimit.d.ts.map +1 -0
- package/lib/exercises/limits/sequenceGeometricLimit.js +51 -0
- package/lib/exercises/limits/sequencePolynomLimit.d.ts.map +1 -1
- package/lib/exercises/limits/sequencePolynomLimit.js +9 -7
- package/lib/exercises/limits/sequencePolynomNoFILimit.d.ts +4 -0
- package/lib/exercises/limits/sequencePolynomNoFILimit.d.ts.map +1 -0
- package/lib/exercises/limits/sequencePolynomNoFILimit.js +66 -0
- package/lib/exercises/limits/sequencePolynomProductLimit.d.ts +4 -0
- package/lib/exercises/limits/sequencePolynomProductLimit.d.ts.map +1 -0
- package/lib/exercises/limits/sequencePolynomProductLimit.js +74 -0
- package/lib/exercises/limits/sequenceRationalFracLimit.d.ts.map +1 -1
- package/lib/exercises/limits/sequenceRationalFracLimit.js +12 -8
- package/lib/exercises/limits/sequenceSimpleElementsSumLimit.d.ts +4 -0
- package/lib/exercises/limits/sequenceSimpleElementsSumLimit.d.ts.map +1 -0
- package/lib/exercises/limits/sequenceSimpleElementsSumLimit.js +65 -0
- package/lib/exercises/primitve/exponentialPrimitive.js +1 -1
- package/lib/exercises/primitve/logarithmePrimitive.js +2 -2
- package/lib/exercises/primitve/polynomialPrimitive.js +2 -2
- package/lib/exercises/primitve/sinCosPrimitive.js +1 -1
- package/lib/exercises/probaStat/quartiles.d.ts.map +1 -1
- package/lib/exercises/probaStat/quartiles.js +0 -1
- package/lib/exercises/sets/intervals/inequalityToInterval.js +3 -3
- package/lib/math/numbers/decimals/decimal.d.ts +1 -1
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +2 -1
- package/lib/math/numbers/rationals/rational.d.ts +1 -0
- package/lib/math/numbers/rationals/rational.d.ts.map +1 -1
- package/lib/math/numbers/rationals/rational.js +10 -0
- package/lib/math/polynomials/polynomial.d.ts +2 -1
- package/lib/math/polynomials/polynomial.d.ts.map +1 -1
- package/lib/math/polynomials/polynomial.js +41 -13
- package/lib/math/sequences/geometricSequence.d.ts +11 -1
- package/lib/math/sequences/geometricSequence.d.ts.map +1 -1
- package/lib/math/sequences/geometricSequence.js +65 -2
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/tree/nodes/operators/powerNode.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tryToAddWrongProp = void 0;
|
|
4
|
+
const uuidv4_1 = require("uuidv4");
|
|
5
|
+
const tryToAddWrongProp = (props, statement, format = 'tex') => {
|
|
6
|
+
if (!props.some((prop) => prop.statement === statement)) {
|
|
7
|
+
props.push({
|
|
8
|
+
id: (0, uuidv4_1.uuid)(),
|
|
9
|
+
statement,
|
|
10
|
+
isRightAnswer: false,
|
|
11
|
+
format: format,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
exports.tryToAddWrongProp = tryToAddWrongProp;
|
|
@@ -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":"AAoLA,eAAO,MAAM,SAAS,iCAsQrB,CAAC"}
|
|
@@ -167,6 +167,9 @@ const intervalsUnion_1 = require("./sets/intervals/intervalsUnion");
|
|
|
167
167
|
const intervalsIntersection_1 = require("./sets/intervals/intervalsIntersection");
|
|
168
168
|
const sequencePolynomLimit_1 = require("./limits/sequencePolynomLimit");
|
|
169
169
|
const sequenceRationalFracLimit_1 = require("./limits/sequenceRationalFracLimit");
|
|
170
|
+
const sequencePolynomProductLimit_1 = require("./limits/sequencePolynomProductLimit");
|
|
171
|
+
const sequencePolynomNoFILimit_1 = require("./limits/sequencePolynomNoFILimit");
|
|
172
|
+
const sequenceGeometricLimit_1 = require("./limits/sequenceGeometricLimit");
|
|
170
173
|
exports.exercises = [
|
|
171
174
|
/**
|
|
172
175
|
* calcul litteral
|
|
@@ -400,5 +403,8 @@ exports.exercises = [
|
|
|
400
403
|
/**limites */
|
|
401
404
|
polynomeLimit_1.polynomeLimit,
|
|
402
405
|
sequencePolynomLimit_1.sequencePolynomLimit,
|
|
406
|
+
sequencePolynomNoFILimit_1.sequencePolynomNoFILimit,
|
|
403
407
|
sequenceRationalFracLimit_1.sequenceRationalFracLimit,
|
|
408
|
+
sequencePolynomProductLimit_1.sequencePolynomProductLimit,
|
|
409
|
+
sequenceGeometricLimit_1.sequenceGeometricLimit,
|
|
404
410
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inverseImageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/inverseImageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAS3E,eAAO,MAAM,4BAA4B,EAAE,QAY1C,CAAC;AAEF,wBAAgB,+BAA+B,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"inverseImageFunctionGeogebra.d.ts","sourceRoot":"","sources":["../../../../src/exercises/functions/basics/inverseImageFunctionGeogebra.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAS3E,eAAO,MAAM,4BAA4B,EAAE,QAY1C,CAAC;AAEF,wBAAgB,+BAA+B,IAAI,QAAQ,CA0J1D"}
|
|
@@ -24,8 +24,8 @@ exports.polynomeLimit = {
|
|
|
24
24
|
freeTimer: 60,
|
|
25
25
|
};
|
|
26
26
|
function getApplyPercentQuestion() {
|
|
27
|
-
const polynome1 =
|
|
28
|
-
const polynome2 =
|
|
27
|
+
const polynome1 = polynomial_1.PolynomialConstructor.randomWithOrder((0, randint_1.randint)(2, 6));
|
|
28
|
+
const polynome2 = polynomial_1.PolynomialConstructor.randomWithOrder((0, randint_1.randint)(2, 6));
|
|
29
29
|
// a_1x^n + b_2x^(n-1) + ...
|
|
30
30
|
const a1 = polynome1.coefficients[polynome1.coefficients.length - 1];
|
|
31
31
|
const a2 = polynome2.coefficients[polynome2.coefficients.length - 1];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequenceGeometricLimit.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/sequenceGeometricLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAU9F,eAAO,MAAM,sBAAsB,EAAE,QAWpC,CAAC;AAEF,wBAAgB,iCAAiC,IAAI,QAAQ,CAgC5D"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSequenceGeometricLimitQuestion = exports.sequenceGeometricLimit = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const geometricSequence_1 = require("../../math/sequences/geometricSequence");
|
|
7
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
exports.sequenceGeometricLimit = {
|
|
10
|
+
id: 'sequenceGeometricLimit',
|
|
11
|
+
connector: '=',
|
|
12
|
+
instruction: '',
|
|
13
|
+
label: "Limite d'une suite géométrique",
|
|
14
|
+
levels: ['TermSpé', 'MathComp'],
|
|
15
|
+
isSingleStep: true,
|
|
16
|
+
sections: ['Limites'],
|
|
17
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSequenceGeometricLimitQuestion, nb),
|
|
18
|
+
qcmTimer: 60,
|
|
19
|
+
freeTimer: 60,
|
|
20
|
+
};
|
|
21
|
+
function getSequenceGeometricLimitQuestion() {
|
|
22
|
+
const sequence = geometricSequence_1.GeometricSequenceConstructor.randomWithLimit();
|
|
23
|
+
const to = '+\\infty';
|
|
24
|
+
const answer = sequence.getLimit();
|
|
25
|
+
if (!answer)
|
|
26
|
+
throw Error('received geometric sequence with no limit');
|
|
27
|
+
const getPropositions = (n) => {
|
|
28
|
+
const res = [];
|
|
29
|
+
res.push({
|
|
30
|
+
id: (0, uuid_1.v4)(),
|
|
31
|
+
statement: answer,
|
|
32
|
+
isRightAnswer: true,
|
|
33
|
+
format: 'tex',
|
|
34
|
+
});
|
|
35
|
+
(0, exercise_1.tryToAddWrongProp)(res, '+\\infty');
|
|
36
|
+
(0, exercise_1.tryToAddWrongProp)(res, '-\\infty');
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(res, '0');
|
|
38
|
+
(0, exercise_1.tryToAddWrongProp)(res, sequence.reason.tex + '');
|
|
39
|
+
(0, exercise_1.tryToAddWrongProp)(res, sequence.firstTerm.tex + '');
|
|
40
|
+
return (0, shuffle_1.shuffle)(res).slice(0, n);
|
|
41
|
+
};
|
|
42
|
+
const question = {
|
|
43
|
+
answer: answer,
|
|
44
|
+
instruction: `Déterminer la limite de la suite $u$ définie par : $u_n = ${sequence.toTree().toTex()}$.`,
|
|
45
|
+
keys: ['infty'],
|
|
46
|
+
getPropositions,
|
|
47
|
+
answerFormat: 'tex',
|
|
48
|
+
};
|
|
49
|
+
return question;
|
|
50
|
+
}
|
|
51
|
+
exports.getSequenceGeometricLimitQuestion = getSequenceGeometricLimitQuestion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencePolynomLimit.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/sequencePolynomLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,
|
|
1
|
+
{"version":3,"file":"sequencePolynomLimit.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/sequencePolynomLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAQ9F,eAAO,MAAM,oBAAoB,EAAE,QAWlC,CAAC;AAEF,wBAAgB,+BAA+B,IAAI,QAAQ,CAkD1D"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSequencePolynomLimitQuestion = exports.sequencePolynomLimit = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
4
5
|
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
5
6
|
const polynomial_1 = require("../../math/polynomials/polynomial");
|
|
6
|
-
const
|
|
7
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
7
8
|
const shuffle_1 = require("../../utils/shuffle");
|
|
8
9
|
const uuid_1 = require("uuid");
|
|
9
10
|
exports.sequencePolynomLimit = {
|
|
@@ -20,8 +21,7 @@ exports.sequencePolynomLimit = {
|
|
|
20
21
|
};
|
|
21
22
|
function getSequencePolynomLimitQuestion() {
|
|
22
23
|
const poly = polynomial_1.PolynomialConstructor.random(4, 'n');
|
|
23
|
-
const
|
|
24
|
-
const to = isPositiveInfinite ? '+\\infty' : '-\\infty';
|
|
24
|
+
const to = '+\\infty';
|
|
25
25
|
const answer = poly.getLimit(to);
|
|
26
26
|
const getPropositions = (n) => {
|
|
27
27
|
const res = [];
|
|
@@ -31,12 +31,16 @@ function getSequencePolynomLimitQuestion() {
|
|
|
31
31
|
isRightAnswer: true,
|
|
32
32
|
format: 'tex',
|
|
33
33
|
});
|
|
34
|
+
(0, exercise_1.tryToAddWrongProp)(res, '+\\infty');
|
|
35
|
+
(0, exercise_1.tryToAddWrongProp)(res, '-\\infty');
|
|
36
|
+
(0, exercise_1.tryToAddWrongProp)(res, '0');
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(res, poly.coefficients[poly.degree] + '');
|
|
34
38
|
const missing = n - res.length;
|
|
35
39
|
for (let i = 0; i < missing; i++) {
|
|
36
40
|
let isDuplicate;
|
|
37
41
|
let proposition;
|
|
38
42
|
do {
|
|
39
|
-
const wrongAnswer = '';
|
|
43
|
+
const wrongAnswer = (0, randint_1.randint)(-10, 10) + '';
|
|
40
44
|
proposition = {
|
|
41
45
|
id: (0, uuid_1.v4)() + ``,
|
|
42
46
|
statement: wrongAnswer,
|
|
@@ -51,9 +55,7 @@ function getSequencePolynomLimitQuestion() {
|
|
|
51
55
|
};
|
|
52
56
|
const question = {
|
|
53
57
|
answer: answer,
|
|
54
|
-
instruction: `
|
|
55
|
-
.toTree()
|
|
56
|
-
.toTex()}$. Déterminer $$\\lim_{n\\to ${to}}u_n$$.`,
|
|
58
|
+
instruction: `Déterminer la limite de la suite $u$ définie par : $u_n = ${poly.toTree().toTex()}$.`,
|
|
57
59
|
keys: ['infty'],
|
|
58
60
|
getPropositions,
|
|
59
61
|
answerFormat: 'tex',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequencePolynomNoFILimit.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/sequencePolynomNoFILimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAQ9F,eAAO,MAAM,wBAAwB,EAAE,QAWtC,CAAC;AAEF,wBAAgB,mCAAmC,IAAI,QAAQ,CAmD9D"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSequencePolynomNoFILimitQuestion = exports.sequencePolynomNoFILimit = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const polynomial_1 = require("../../math/polynomials/polynomial");
|
|
7
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
8
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
exports.sequencePolynomNoFILimit = {
|
|
11
|
+
id: 'sequencePolynomNoFILimit',
|
|
12
|
+
connector: '=',
|
|
13
|
+
instruction: '',
|
|
14
|
+
label: "Limite d'une suite polynomiale (sans F.I.)",
|
|
15
|
+
levels: ['TermSpé', 'MathComp'],
|
|
16
|
+
isSingleStep: true,
|
|
17
|
+
sections: ['Limites'],
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSequencePolynomNoFILimitQuestion, nb),
|
|
19
|
+
qcmTimer: 60,
|
|
20
|
+
freeTimer: 60,
|
|
21
|
+
};
|
|
22
|
+
function getSequencePolynomNoFILimitQuestion() {
|
|
23
|
+
const length = (0, randint_1.randint)(2, 5);
|
|
24
|
+
const poly = polynomial_1.PolynomialConstructor.randomWithLengthAndSameSigns(4, length, 'n');
|
|
25
|
+
const to = '+\\infty';
|
|
26
|
+
const answer = poly.getLimit(to);
|
|
27
|
+
const getPropositions = (n) => {
|
|
28
|
+
const res = [];
|
|
29
|
+
res.push({
|
|
30
|
+
id: (0, uuid_1.v4)(),
|
|
31
|
+
statement: answer,
|
|
32
|
+
isRightAnswer: true,
|
|
33
|
+
format: 'tex',
|
|
34
|
+
});
|
|
35
|
+
(0, exercise_1.tryToAddWrongProp)(res, '+\\infty');
|
|
36
|
+
(0, exercise_1.tryToAddWrongProp)(res, '-\\infty');
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(res, '0');
|
|
38
|
+
(0, exercise_1.tryToAddWrongProp)(res, poly.coefficients[poly.degree] + '');
|
|
39
|
+
const missing = n - res.length;
|
|
40
|
+
for (let i = 0; i < missing; i++) {
|
|
41
|
+
let isDuplicate;
|
|
42
|
+
let proposition;
|
|
43
|
+
do {
|
|
44
|
+
const wrongAnswer = (0, randint_1.randint)(-10, 10) + '';
|
|
45
|
+
proposition = {
|
|
46
|
+
id: (0, uuid_1.v4)() + ``,
|
|
47
|
+
statement: wrongAnswer,
|
|
48
|
+
isRightAnswer: false,
|
|
49
|
+
format: 'tex',
|
|
50
|
+
};
|
|
51
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
52
|
+
} while (isDuplicate);
|
|
53
|
+
res.push(proposition);
|
|
54
|
+
}
|
|
55
|
+
return (0, shuffle_1.shuffle)(res);
|
|
56
|
+
};
|
|
57
|
+
const question = {
|
|
58
|
+
answer: answer,
|
|
59
|
+
instruction: `Déterminer la limite de la suite $u$ définie par : $u_n = ${poly.toTree().toTex()}$.`,
|
|
60
|
+
keys: ['infty'],
|
|
61
|
+
getPropositions,
|
|
62
|
+
answerFormat: 'tex',
|
|
63
|
+
};
|
|
64
|
+
return question;
|
|
65
|
+
}
|
|
66
|
+
exports.getSequencePolynomNoFILimitQuestion = getSequencePolynomNoFILimitQuestion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequencePolynomProductLimit.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/sequencePolynomProductLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAU9F,eAAO,MAAM,2BAA2B,EAAE,QAWzC,CAAC;AAEF,wBAAgB,sCAAsC,IAAI,QAAQ,CA4DjE"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSequencePolynomProductLimitQuestion = exports.sequencePolynomProductLimit = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const rational_1 = require("../../math/numbers/rationals/rational");
|
|
7
|
+
const monom_1 = require("../../math/polynomials/monom");
|
|
8
|
+
const polynomial_1 = require("../../math/polynomials/polynomial");
|
|
9
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
10
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
11
|
+
const uuid_1 = require("uuid");
|
|
12
|
+
exports.sequencePolynomProductLimit = {
|
|
13
|
+
id: 'sequencePolynomProductLimit',
|
|
14
|
+
connector: '=',
|
|
15
|
+
instruction: '',
|
|
16
|
+
label: "Limite d'un produit de suites polynomiales)",
|
|
17
|
+
levels: ['TermSpé', 'MathComp'],
|
|
18
|
+
isSingleStep: true,
|
|
19
|
+
sections: ['Limites'],
|
|
20
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSequencePolynomProductLimitQuestion, nb),
|
|
21
|
+
qcmTimer: 60,
|
|
22
|
+
freeTimer: 60,
|
|
23
|
+
};
|
|
24
|
+
function getSequencePolynomProductLimitQuestion() {
|
|
25
|
+
const polyNum = polynomial_1.PolynomialConstructor.randomWithLength(3, 2, 'n');
|
|
26
|
+
const polyDenum = polynomial_1.PolynomialConstructor.randomWithLength(3, 2, 'n');
|
|
27
|
+
const numLeadingCoeff = polyNum.coefficients[polyNum.degree];
|
|
28
|
+
const denumLeadingCoeff = polyDenum.coefficients[polyDenum.degree];
|
|
29
|
+
const product = new monom_1.Monom(polyNum.degree + polyDenum.degree, numLeadingCoeff * denumLeadingCoeff, 'n');
|
|
30
|
+
const to = '+\\infty';
|
|
31
|
+
let answer = product.getLimit(to);
|
|
32
|
+
let leadingCoeffsRational = new rational_1.Rational(numLeadingCoeff, denumLeadingCoeff).simplify().toTree().toTex();
|
|
33
|
+
const getPropositions = (n) => {
|
|
34
|
+
const res = [];
|
|
35
|
+
res.push({
|
|
36
|
+
id: (0, uuid_1.v4)(),
|
|
37
|
+
statement: answer,
|
|
38
|
+
isRightAnswer: true,
|
|
39
|
+
format: 'tex',
|
|
40
|
+
});
|
|
41
|
+
(0, exercise_1.tryToAddWrongProp)(res, '+\\infty');
|
|
42
|
+
(0, exercise_1.tryToAddWrongProp)(res, '-\\infty');
|
|
43
|
+
(0, exercise_1.tryToAddWrongProp)(res, '0');
|
|
44
|
+
(0, exercise_1.tryToAddWrongProp)(res, leadingCoeffsRational);
|
|
45
|
+
const missing = n - res.length;
|
|
46
|
+
for (let i = 0; i < missing; i++) {
|
|
47
|
+
let isDuplicate;
|
|
48
|
+
let proposition;
|
|
49
|
+
do {
|
|
50
|
+
const wrongAnswer = (0, randint_1.randint)(-10, 10) + '';
|
|
51
|
+
proposition = {
|
|
52
|
+
id: (0, uuid_1.v4)() + ``,
|
|
53
|
+
statement: wrongAnswer,
|
|
54
|
+
isRightAnswer: false,
|
|
55
|
+
format: 'tex',
|
|
56
|
+
};
|
|
57
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
58
|
+
} while (isDuplicate);
|
|
59
|
+
res.push(proposition);
|
|
60
|
+
}
|
|
61
|
+
return (0, shuffle_1.shuffle)(res);
|
|
62
|
+
};
|
|
63
|
+
const question = {
|
|
64
|
+
answer,
|
|
65
|
+
instruction: `Déterminer la limite de la suite $u$ définie par : $u_n = (${polyNum.toTree().toTex()})(${polyDenum
|
|
66
|
+
.toTree()
|
|
67
|
+
.toTex()})$.`,
|
|
68
|
+
keys: ['infty'],
|
|
69
|
+
getPropositions,
|
|
70
|
+
answerFormat: 'tex',
|
|
71
|
+
};
|
|
72
|
+
return question;
|
|
73
|
+
}
|
|
74
|
+
exports.getSequencePolynomProductLimitQuestion = getSequencePolynomProductLimitQuestion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequenceRationalFracLimit.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/sequenceRationalFracLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,
|
|
1
|
+
{"version":3,"file":"sequenceRationalFracLimit.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/sequenceRationalFracLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAU9F,eAAO,MAAM,yBAAyB,EAAE,QAWvC,CAAC;AAEF,wBAAgB,oCAAoC,IAAI,QAAQ,CAuE/D"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSequenceRationalFracLimitQuestion = exports.sequenceRationalFracLimit = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
4
5
|
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
5
6
|
const rational_1 = require("../../math/numbers/rationals/rational");
|
|
6
7
|
const monom_1 = require("../../math/polynomials/monom");
|
|
7
8
|
const polynomial_1 = require("../../math/polynomials/polynomial");
|
|
8
|
-
const
|
|
9
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
9
10
|
const shuffle_1 = require("../../utils/shuffle");
|
|
10
11
|
const uuid_1 = require("uuid");
|
|
11
12
|
exports.sequenceRationalFracLimit = {
|
|
@@ -25,11 +26,11 @@ function getSequenceRationalFracLimitQuestion() {
|
|
|
25
26
|
const polyDenum = polynomial_1.PolynomialConstructor.random(4, 'n');
|
|
26
27
|
const numLeadingCoeff = polyNum.coefficients[polyNum.degree];
|
|
27
28
|
const denumLeadingCoeff = polyDenum.coefficients[polyDenum.degree];
|
|
28
|
-
const
|
|
29
|
-
const to = isPositiveInfinite ? '+\\infty' : '-\\infty';
|
|
29
|
+
const to = '+\\infty';
|
|
30
30
|
let answer;
|
|
31
|
+
let leadingCoeffsRational = new rational_1.Rational(numLeadingCoeff, denumLeadingCoeff).simplify().toTree().toTex();
|
|
31
32
|
if (polyDenum.degree === polyNum.degree) {
|
|
32
|
-
answer =
|
|
33
|
+
answer = leadingCoeffsRational;
|
|
33
34
|
}
|
|
34
35
|
else if (polyDenum.degree > polyNum.degree) {
|
|
35
36
|
answer = '0';
|
|
@@ -38,7 +39,6 @@ function getSequenceRationalFracLimitQuestion() {
|
|
|
38
39
|
const tempPoly = new monom_1.Monom(polyNum.degree - polyDenum.degree, numLeadingCoeff * denumLeadingCoeff > 0 ? 1 : -1, 'n');
|
|
39
40
|
answer = tempPoly.getLimit(to);
|
|
40
41
|
}
|
|
41
|
-
// sinon créer un polynome de coeff = leading coeff et degré = division des degrés
|
|
42
42
|
const getPropositions = (n) => {
|
|
43
43
|
const res = [];
|
|
44
44
|
res.push({
|
|
@@ -47,12 +47,16 @@ function getSequenceRationalFracLimitQuestion() {
|
|
|
47
47
|
isRightAnswer: true,
|
|
48
48
|
format: 'tex',
|
|
49
49
|
});
|
|
50
|
+
(0, exercise_1.tryToAddWrongProp)(res, '+\\infty');
|
|
51
|
+
(0, exercise_1.tryToAddWrongProp)(res, '-\\infty');
|
|
52
|
+
(0, exercise_1.tryToAddWrongProp)(res, '0');
|
|
53
|
+
(0, exercise_1.tryToAddWrongProp)(res, leadingCoeffsRational);
|
|
50
54
|
const missing = n - res.length;
|
|
51
55
|
for (let i = 0; i < missing; i++) {
|
|
52
56
|
let isDuplicate;
|
|
53
57
|
let proposition;
|
|
54
58
|
do {
|
|
55
|
-
const wrongAnswer = '';
|
|
59
|
+
const wrongAnswer = (0, randint_1.randint)(-10, 10) + '';
|
|
56
60
|
proposition = {
|
|
57
61
|
id: (0, uuid_1.v4)() + ``,
|
|
58
62
|
statement: wrongAnswer,
|
|
@@ -67,9 +71,9 @@ function getSequenceRationalFracLimitQuestion() {
|
|
|
67
71
|
};
|
|
68
72
|
const question = {
|
|
69
73
|
answer,
|
|
70
|
-
instruction: `
|
|
74
|
+
instruction: `Déterminer la limite de la suite $u$ définie par : $u_n = \\dfrac{${polyNum
|
|
71
75
|
.toTree()
|
|
72
|
-
.toTex()}}
|
|
76
|
+
.toTex()}}{${polyDenum.toTree().toTex()}}$.`,
|
|
73
77
|
keys: ['infty'],
|
|
74
78
|
getPropositions,
|
|
75
79
|
answerFormat: 'tex',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sequenceSimpleElementsSumLimit.d.ts","sourceRoot":"","sources":["../../../src/exercises/limits/sequenceSimpleElementsSumLimit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAqB,MAAM,0BAA0B,CAAC;AAQ9F,eAAO,MAAM,8BAA8B,EAAE,QAW5C,CAAC;AAEF,wBAAgB,+BAA+B,IAAI,QAAQ,CAkD1D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSequencePolynomLimitQuestion = exports.sequenceSimpleElementsSumLimit = void 0;
|
|
4
|
+
const exercise_1 = require("../../exercises/exercise");
|
|
5
|
+
const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
|
|
6
|
+
const polynomial_1 = require("../../math/polynomials/polynomial");
|
|
7
|
+
const randint_1 = require("../../math/utils/random/randint");
|
|
8
|
+
const shuffle_1 = require("../../utils/shuffle");
|
|
9
|
+
const uuid_1 = require("uuid");
|
|
10
|
+
exports.sequenceSimpleElementsSumLimit = {
|
|
11
|
+
id: 'sequenceSimpleElementsSumLimit',
|
|
12
|
+
connector: '=',
|
|
13
|
+
instruction: '',
|
|
14
|
+
label: "Limite d'une suite de sommes",
|
|
15
|
+
levels: ['TermSpé', 'MathComp'],
|
|
16
|
+
isSingleStep: true,
|
|
17
|
+
sections: ['Limites'],
|
|
18
|
+
generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSequencePolynomLimitQuestion, nb),
|
|
19
|
+
qcmTimer: 60,
|
|
20
|
+
freeTimer: 60,
|
|
21
|
+
};
|
|
22
|
+
function getSequencePolynomLimitQuestion() {
|
|
23
|
+
const poly = polynomial_1.PolynomialConstructor.random(4, 'n');
|
|
24
|
+
const to = '+\\infty';
|
|
25
|
+
const answer = poly.getLimit(to);
|
|
26
|
+
const getPropositions = (n) => {
|
|
27
|
+
const res = [];
|
|
28
|
+
res.push({
|
|
29
|
+
id: (0, uuid_1.v4)(),
|
|
30
|
+
statement: answer,
|
|
31
|
+
isRightAnswer: true,
|
|
32
|
+
format: 'tex',
|
|
33
|
+
});
|
|
34
|
+
(0, exercise_1.tryToAddWrongProp)(res, '+\\infty');
|
|
35
|
+
(0, exercise_1.tryToAddWrongProp)(res, '-\\infty');
|
|
36
|
+
(0, exercise_1.tryToAddWrongProp)(res, '0');
|
|
37
|
+
(0, exercise_1.tryToAddWrongProp)(res, poly.coefficients[poly.degree] + '');
|
|
38
|
+
const missing = n - res.length;
|
|
39
|
+
for (let i = 0; i < missing; i++) {
|
|
40
|
+
let isDuplicate;
|
|
41
|
+
let proposition;
|
|
42
|
+
do {
|
|
43
|
+
const wrongAnswer = (0, randint_1.randint)(-10, 10) + '';
|
|
44
|
+
proposition = {
|
|
45
|
+
id: (0, uuid_1.v4)() + ``,
|
|
46
|
+
statement: wrongAnswer,
|
|
47
|
+
isRightAnswer: false,
|
|
48
|
+
format: 'tex',
|
|
49
|
+
};
|
|
50
|
+
isDuplicate = res.some((p) => p.statement === proposition.statement);
|
|
51
|
+
} while (isDuplicate);
|
|
52
|
+
res.push(proposition);
|
|
53
|
+
}
|
|
54
|
+
return (0, shuffle_1.shuffle)(res);
|
|
55
|
+
};
|
|
56
|
+
const question = {
|
|
57
|
+
answer: answer,
|
|
58
|
+
instruction: `Déterminer la limite de la suite $u$ définie par : $u_n = ${poly.toTree().toTex()}$.`,
|
|
59
|
+
keys: ['infty'],
|
|
60
|
+
getPropositions,
|
|
61
|
+
answerFormat: 'tex',
|
|
62
|
+
};
|
|
63
|
+
return question;
|
|
64
|
+
}
|
|
65
|
+
exports.getSequencePolynomLimitQuestion = getSequencePolynomLimitQuestion;
|
|
@@ -31,7 +31,7 @@ exports.exponentialPrimitive = {
|
|
|
31
31
|
function getExponentialPrimitive() {
|
|
32
32
|
const rand = (0, coinFlip_1.coinFlip)();
|
|
33
33
|
const a = (0, randint_1.randint)(-9, 10);
|
|
34
|
-
const u =
|
|
34
|
+
const u = polynomial_1.PolynomialConstructor.randomWithOrder((0, randint_1.randint)(1, 3));
|
|
35
35
|
let selectedFunction;
|
|
36
36
|
let integratedFuction;
|
|
37
37
|
if (rand) {
|
|
@@ -24,7 +24,7 @@ exports.logarithmePrimitive = {
|
|
|
24
24
|
freeTimer: 60,
|
|
25
25
|
};
|
|
26
26
|
function getLogarithmePrimitive() {
|
|
27
|
-
const u =
|
|
27
|
+
const u = polynomial_1.PolynomialConstructor.randomWithOrder((0, randint_1.randint)(1, 3));
|
|
28
28
|
const selectedFunction = new fractionNode_1.FractionNode(u.derivate().toTree(), u.toTree());
|
|
29
29
|
const integratedFuction = `ln\|${u.toTex()}\|`;
|
|
30
30
|
const getPropositions = (n) => {
|
|
@@ -48,7 +48,7 @@ function getLogarithmePrimitive() {
|
|
|
48
48
|
.toTree(), new powerNode_1.PowerNode(u.toTree(), new numberNode_1.NumberNode(2))).toTex(),
|
|
49
49
|
`ln(${new powerNode_1.PowerNode(u.toTree(), new numberNode_1.NumberNode(2)).toTex()})`,
|
|
50
50
|
new powerNode_1.PowerNode(u.toTree(), new numberNode_1.NumberNode(2)).toTex(),
|
|
51
|
-
`ln\|${
|
|
51
|
+
`ln\|${polynomial_1.PolynomialConstructor.randomWithOrder((0, randint_1.randint)(1, 3)).toTex()}\|`,
|
|
52
52
|
];
|
|
53
53
|
wrongIntegral = wrongIntegrals[(0, randint_1.randint)(0, wrongIntegrals.length)];
|
|
54
54
|
proposition = {
|
|
@@ -41,7 +41,7 @@ function getIntegratedPolynomialNode(polynomial) {
|
|
|
41
41
|
}
|
|
42
42
|
function getPolynomialPrimitive() {
|
|
43
43
|
const degree = (0, randint_1.randint)(1, 4);
|
|
44
|
-
const polynomial =
|
|
44
|
+
const polynomial = polynomial_1.PolynomialConstructor.randomWithOrder(degree);
|
|
45
45
|
const integralPolynomial = getIntegratedPolynomialNode(polynomial);
|
|
46
46
|
const getPropositions = (n) => {
|
|
47
47
|
const propositions = [];
|
|
@@ -55,7 +55,7 @@ function getPolynomialPrimitive() {
|
|
|
55
55
|
let isDuplicate;
|
|
56
56
|
let proposition;
|
|
57
57
|
do {
|
|
58
|
-
const wrongPolynomial =
|
|
58
|
+
const wrongPolynomial = polynomial_1.PolynomialConstructor.randomWithOrder(degree);
|
|
59
59
|
const wrongIntegral = getIntegratedPolynomialNode(wrongPolynomial);
|
|
60
60
|
proposition = {
|
|
61
61
|
id: (0, uuid_1.v4)(),
|
|
@@ -29,7 +29,7 @@ exports.sinCosPrimitive = {
|
|
|
29
29
|
function getSinCosPrimitive() {
|
|
30
30
|
const rand = (0, coinFlip_1.coinFlip)();
|
|
31
31
|
const a = (0, randint_1.randint)(-9, 10, [0]);
|
|
32
|
-
const u =
|
|
32
|
+
const u = polynomial_1.PolynomialConstructor.randomWithOrder((0, randint_1.randint)(1, 3));
|
|
33
33
|
let selectedFunction;
|
|
34
34
|
let integratedFuction;
|
|
35
35
|
if (rand) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quartiles.d.ts","sourceRoot":"","sources":["../../../src/exercises/probaStat/quartiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI9D,eAAO,MAAM,SAAS,EAAE,QAYvB,CAAC;AAEF,wBAAgB,YAAY,IAAI,QAAQ,
|
|
1
|
+
{"version":3,"file":"quartiles.d.ts","sourceRoot":"","sources":["../../../src/exercises/probaStat/quartiles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAe,QAAQ,EAAE,MAAM,aAAa,CAAC;AAI9D,eAAO,MAAM,SAAS,EAAE,QAYvB,CAAC;AAEF,wBAAgB,YAAY,IAAI,QAAQ,CAiGvC"}
|
|
@@ -35,7 +35,6 @@ function getQuartiles() {
|
|
|
35
35
|
const n = randomEffectives.reduce((sum, value) => sum + value, 0);
|
|
36
36
|
const firstQuartileIndex = Math.round(n / 4 + 0.49);
|
|
37
37
|
const thirdQuartileIndex = Math.round((3 * n) / 4 + 0.49);
|
|
38
|
-
console.log(thirdQuartileIndex + '///' + (3 * n) / 4);
|
|
39
38
|
const firstQuartile = sortedValues[firstQuartileIndex - 1];
|
|
40
39
|
const thirdQuartile = sortedValues[thirdQuartileIndex - 1];
|
|
41
40
|
const randomQuartile = (0, randint_1.randint)(0, 2);
|
|
@@ -58,9 +58,9 @@ function getInequalityToIntervalQuestion() {
|
|
|
58
58
|
if (isIntervalToInequality) {
|
|
59
59
|
if (interval.min === -Infinity) {
|
|
60
60
|
const wrongStatements = [
|
|
61
|
-
`x
|
|
62
|
-
`-\\infty
|
|
63
|
-
`-\\infty <
|
|
61
|
+
`x${switchInequality(interval.rightInequalitySymbol)}${interval.maxTex}`,
|
|
62
|
+
`-\\infty\\le x${switchInequality(interval.rightInequalitySymbol)}${interval.maxTex}`,
|
|
63
|
+
`-\\infty <x${switchInequality(interval.rightInequalitySymbol)}${interval.maxTex}`,
|
|
64
64
|
];
|
|
65
65
|
wrongStatements.forEach((statement) => {
|
|
66
66
|
res.push({
|
|
@@ -2,7 +2,7 @@ import { Node } from '../../../tree/nodes/node';
|
|
|
2
2
|
import { Nombre, NumberType } from '../nombre';
|
|
3
3
|
export declare abstract class DecimalConstructor {
|
|
4
4
|
static randomFracPart(precision: number): string;
|
|
5
|
-
static random(min: number, max: number, precision
|
|
5
|
+
static random(min: number, max: number, precision?: number): Decimal;
|
|
6
6
|
static fromParts(intPart: string, decimalPart: string): Decimal;
|
|
7
7
|
}
|
|
8
8
|
export declare class Decimal implements Nombre {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/decimals/decimal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAG7C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAQhD,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"decimal.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/decimals/decimal.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAG7C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,8BAAsB,kBAAkB;IACtC,MAAM,CAAC,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAQhD,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO;IAMpE,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO;CAGhE;AAED,qBAAa,OAAQ,YAAW,MAAM;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,aAAsB;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;gBACR,KAAK,EAAE,MAAM;IASzB;;;;OAIG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAoEhC,oBAAoB,CAAC,KAAK,EAAE,MAAM;IAsBlC,MAAM,IAAI,IAAI;CAGf"}
|
|
@@ -14,8 +14,9 @@ class DecimalConstructor {
|
|
|
14
14
|
return decimals;
|
|
15
15
|
}
|
|
16
16
|
static random(min, max, precision) {
|
|
17
|
+
let prec = precision ?? (0, randint_1.randint)(1, 4);
|
|
17
18
|
const int = (0, randint_1.randint)(min, max) + '';
|
|
18
|
-
const decimals = DecimalConstructor.randomFracPart(
|
|
19
|
+
const decimals = DecimalConstructor.randomFracPart(prec);
|
|
19
20
|
return DecimalConstructor.fromParts(int, decimals);
|
|
20
21
|
}
|
|
21
22
|
static fromParts(intPart, decimalPart) {
|
|
@@ -6,6 +6,7 @@ export declare abstract class RationalConstructor {
|
|
|
6
6
|
*/
|
|
7
7
|
static randomSimplifiable(maxGcd?: number): Rational;
|
|
8
8
|
static randomIrreductible(max?: number): Rational;
|
|
9
|
+
static randomIrreductibleWithSign(max?: number): Rational;
|
|
9
10
|
}
|
|
10
11
|
export declare class Rational implements Nombre {
|
|
11
12
|
num: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rational.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/rationals/rational.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"rational.d.ts","sourceRoot":"","sources":["../../../../src/math/numbers/rationals/rational.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAQ7C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAE/C,8BAAsB,mBAAmB;IACvC;;OAEG;IACH,MAAM,CAAC,kBAAkB,CAAC,MAAM,GAAE,MAAW;IAW7C,MAAM,CAAC,kBAAkB,CAAC,GAAG,GAAE,MAAW;IAO1C,MAAM,CAAC,0BAA0B,CAAC,GAAG,GAAE,MAAW;CAQnD;AAED,qBAAa,QAAS,YAAW,MAAM;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,UAAU,CAAC;gBAEL,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAUlD,KAAK;IAIL,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgBvB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgB5B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM;IAgB1B,QAAQ,IAAI,QAAQ;IAIpB,MAAM,IAAI,IAAI;IAId,QAAQ,IAAI,MAAM;CAMnB"}
|