math-exercises 2.0.41 → 2.0.43
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/commonDivisorsList.d.ts +8 -0
- package/lib/exercises/calcul/arithmetics/commonDivisorsList.d.ts.map +1 -0
- package/lib/exercises/calcul/arithmetics/commonDivisorsList.js +64 -0
- package/lib/exercises/calcul/arithmetics/divisorsList.d.ts +7 -0
- package/lib/exercises/calcul/arithmetics/divisorsList.d.ts.map +1 -0
- package/lib/exercises/calcul/arithmetics/divisorsList.js +56 -0
- package/lib/exercises/calcul/arithmetics/index.d.ts +3 -0
- package/lib/exercises/calcul/arithmetics/index.d.ts.map +1 -1
- package/lib/exercises/calcul/arithmetics/index.js +3 -0
- package/lib/exercises/calcul/arithmetics/pgcdCalcul.d.ts +8 -0
- package/lib/exercises/calcul/arithmetics/pgcdCalcul.d.ts.map +1 -0
- package/lib/exercises/calcul/arithmetics/pgcdCalcul.js +47 -0
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/distributivity/firstIdentity.js +4 -2
- package/lib/exercises/calculLitteral/factorisation/factoIdRmq3.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/index.d.ts +1 -0
- package/lib/exercises/calculLitteral/index.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/index.js +1 -0
- package/lib/exercises/calculLitteral/inequations/index.d.ts +1 -0
- package/lib/exercises/calculLitteral/inequations/index.d.ts.map +1 -1
- package/lib/exercises/calculLitteral/inequations/index.js +1 -0
- package/lib/exercises/calculLitteral/inequations/squareFunctionInequation.d.ts +9 -0
- package/lib/exercises/calculLitteral/inequations/squareFunctionInequation.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/inequations/squareFunctionInequation.js +65 -0
- package/lib/exercises/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts +8 -0
- package/lib/exercises/calculLitteral/systems/basicNiceValuesSystemResolution.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/systems/basicNiceValuesSystemResolution.js +56 -0
- package/lib/exercises/calculLitteral/systems/basicSystemResolution.d.ts +8 -0
- package/lib/exercises/calculLitteral/systems/basicSystemResolution.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/systems/basicSystemResolution.js +67 -0
- package/lib/exercises/calculLitteral/systems/index.d.ts +3 -0
- package/lib/exercises/calculLitteral/systems/index.d.ts.map +1 -0
- package/lib/exercises/calculLitteral/systems/index.js +18 -0
- package/lib/exercises/derivation/derivative/cosCompositionDerivation.d.ts +8 -0
- package/lib/exercises/derivation/derivative/cosCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/cosCompositionDerivation.js +56 -0
- package/lib/exercises/derivation/derivative/index.d.ts +4 -0
- package/lib/exercises/derivation/derivative/index.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/index.js +4 -0
- package/lib/exercises/derivation/derivative/powerCompositionDerivation.d.ts +9 -0
- package/lib/exercises/derivation/derivative/powerCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/powerCompositionDerivation.js +61 -0
- package/lib/exercises/derivation/derivative/sinCompositionDerivation.d.ts +8 -0
- package/lib/exercises/derivation/derivative/sinCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/sinCompositionDerivation.js +57 -0
- package/lib/exercises/derivation/derivative/sqrtCompositionDerivation.d.ts +8 -0
- package/lib/exercises/derivation/derivative/sqrtCompositionDerivation.d.ts.map +1 -0
- package/lib/exercises/derivation/derivative/sqrtCompositionDerivation.js +61 -0
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.d.ts.map +1 -1
- package/lib/exercises/derivation/derivative/thirdDegreeFunctionVariation.js +12 -11
- package/lib/exercises/exercise.d.ts +1 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/functions/absolute/absoluteValueInequations.d.ts.map +1 -1
- package/lib/exercises/functions/absolute/absoluteValueInequations.js +6 -5
- package/lib/exercises/functions/affines/signFunction.d.ts.map +1 -1
- package/lib/exercises/functions/affines/signFunction.js +7 -6
- package/lib/exercises/functions/basics/graphicInequation.d.ts +1 -1
- package/lib/exercises/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/functions/basics/graphicInequation.js +6 -5
- package/lib/exercises/functions/basics/imageFunction.js +1 -1
- package/lib/exercises/functions/basics/index.d.ts +2 -0
- package/lib/exercises/functions/basics/index.d.ts.map +1 -1
- package/lib/exercises/functions/basics/index.js +2 -0
- package/lib/exercises/functions/basics/twoFunctionsEquation.d.ts +9 -0
- package/lib/exercises/functions/basics/twoFunctionsEquation.d.ts.map +1 -0
- package/lib/exercises/functions/basics/twoFunctionsEquation.js +135 -0
- package/lib/exercises/functions/basics/twoFunctionsInequation.d.ts +17 -0
- package/lib/exercises/functions/basics/twoFunctionsInequation.d.ts.map +1 -0
- package/lib/exercises/functions/basics/twoFunctionsInequation.js +181 -0
- package/lib/exercises/functions/index.d.ts +1 -0
- package/lib/exercises/functions/index.d.ts.map +1 -1
- package/lib/exercises/functions/index.js +1 -0
- package/lib/exercises/functions/parity/parityFromAlgebra.js +1 -1
- package/lib/exercises/functions/parity/parityFromGraph.js +1 -1
- package/lib/exercises/functions/square/index.d.ts +2 -0
- package/lib/exercises/functions/square/index.d.ts.map +1 -0
- package/lib/exercises/functions/square/index.js +17 -0
- package/lib/exercises/functions/square/squareImageInterval.d.ts +11 -0
- package/lib/exercises/functions/square/squareImageInterval.d.ts.map +1 -0
- package/lib/exercises/functions/square/squareImageInterval.js +109 -0
- package/lib/exercises/functions/trinoms/secondDegreeInequation.d.ts.map +1 -1
- package/lib/exercises/functions/trinoms/secondDegreeInequation.js +4 -3
- package/lib/exercises/matrices/matrixInversibilityDomain.d.ts.map +1 -1
- package/lib/exercises/matrices/matrixInversibilityDomain.js +3 -2
- package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticExplicitFormulaUsage.js +7 -3
- package/lib/exercises/sequences/arithmetic/arithmeticFindReason.js +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticReasonUsage.js +7 -3
- package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.js +7 -3
- package/lib/exercises/sequences/explicitFormulaUsage.js +3 -3
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricExplicitFormulaUsage.js +7 -3
- package/lib/exercises/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricReasonUsage.js +7 -3
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.js +7 -2
- package/lib/exercises/sequences/recurrenceFormulaUsage.js +3 -3
- package/lib/exercises/sets/intervals/inequalityToInterval.d.ts +1 -1
- package/lib/exercises/sets/intervals/inequalityToInterval.d.ts.map +1 -1
- package/lib/exercises/sets/intervals/intervalsIntersection.d.ts +1 -1
- package/lib/exercises/sets/intervals/intervalsIntersection.d.ts.map +1 -1
- package/lib/exercises/sets/intervals/intervalsUnion.d.ts +1 -1
- package/lib/exercises/sets/intervals/intervalsUnion.d.ts.map +1 -1
- package/lib/index.d.ts +55 -6
- package/lib/index.d.ts.map +1 -1
- package/lib/math/polynomials/affine.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.d.ts +2 -1
- package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.js +14 -13
- package/lib/math/systems/system.d.ts +14 -0
- package/lib/math/systems/system.d.ts.map +1 -0
- package/lib/math/systems/system.js +71 -0
- package/lib/math/utils/arithmetic/isPrime.d.ts +2 -0
- package/lib/math/utils/arithmetic/isPrime.d.ts.map +1 -0
- package/lib/math/utils/arithmetic/isPrime.js +14 -0
- package/lib/server.d.ts.map +1 -1
- package/lib/server.js +0 -2
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +9 -8
- package/lib/tree/nodes/numbers/infiniteNode.d.ts +2 -0
- package/lib/tree/nodes/numbers/infiniteNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/infiniteNode.js +6 -1
- package/lib/tree/nodes/operators/fractionNode.js +3 -3
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +7 -0
- package/lib/tree/nodes/sets/closure.d.ts +13 -0
- package/lib/tree/nodes/sets/closure.d.ts.map +1 -0
- package/lib/tree/nodes/sets/closure.js +63 -0
- package/lib/tree/nodes/sets/intervalNode.d.ts +4 -7
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +29 -26
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +0 -6
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +4 -10
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ const getArithmeticReasonUsage = () => {
|
|
|
15
15
|
instruction: `$(u_n)$ est une suite arithmétique de raison $r = ${reason}$ et on sait que $u_{${startRank}} = ${startValue}$. Calculer : $u_{${askedRank}}$`,
|
|
16
16
|
startStatement: `u_{${askedRank}}`,
|
|
17
17
|
answer,
|
|
18
|
-
keys: ["
|
|
18
|
+
keys: ["u", "underscore", "equal"],
|
|
19
19
|
answerFormat: "tex",
|
|
20
20
|
identifiers: { reason, startRank, startValue },
|
|
21
21
|
};
|
|
@@ -29,8 +29,12 @@ const getPropositions = (n, { answer }) => {
|
|
|
29
29
|
}
|
|
30
30
|
return (0, shuffle_1.shuffle)(propositions);
|
|
31
31
|
};
|
|
32
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
33
|
-
return
|
|
32
|
+
const isAnswerValid = (ans, { answer, startRank }) => {
|
|
33
|
+
return [
|
|
34
|
+
answer,
|
|
35
|
+
`u_${startRank + 1}=${answer}`,
|
|
36
|
+
`u_{${startRank + 1}}=${answer}`,
|
|
37
|
+
].includes(ans);
|
|
34
38
|
};
|
|
35
39
|
exports.arithmeticReasonUsage = {
|
|
36
40
|
id: "arithmeticReasonUsage",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmeticRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"arithmeticRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/arithmetic/arithmeticRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAsCF,eAAO,MAAM,gCAAgC,EAAE,YAAY,CAAC,WAAW,CAatE,CAAC"}
|
|
@@ -15,7 +15,7 @@ const getArithmeticRecurrenceFormulaUsage = () => {
|
|
|
15
15
|
instruction: `$(u_n)$ est une suite définie par $u_{n+1} = ${reason} + u_n$ et $u_{${firstRank}} = ${firstValue}$. Calculer : $u_{${askedRank}}$`,
|
|
16
16
|
startStatement: `u_{${askedRank}}`,
|
|
17
17
|
answer,
|
|
18
|
-
keys: ["
|
|
18
|
+
keys: ["u", "underscore", "equal"],
|
|
19
19
|
answerFormat: "tex",
|
|
20
20
|
identifiers: { firstRank, firstValue, reason },
|
|
21
21
|
};
|
|
@@ -29,8 +29,12 @@ const getPropositions = (n, { answer }) => {
|
|
|
29
29
|
}
|
|
30
30
|
return (0, shuffle_1.shuffle)(propositions);
|
|
31
31
|
};
|
|
32
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
33
|
-
return
|
|
32
|
+
const isAnswerValid = (ans, { answer, firstRank }) => {
|
|
33
|
+
return [
|
|
34
|
+
answer,
|
|
35
|
+
`u_${firstRank + 1}=${answer}`,
|
|
36
|
+
`u_{${firstRank + 1}}=${answer}`,
|
|
37
|
+
].includes(ans);
|
|
34
38
|
};
|
|
35
39
|
exports.arithmeticRecurrenceFormulaUsage = {
|
|
36
40
|
id: "arithmeticRecurrenceFormulaUsage",
|
|
@@ -14,7 +14,7 @@ const getExplicitFormulaUsageQuestion = () => {
|
|
|
14
14
|
instruction: `Soit $u$ la suite définie pour tout $n\\geq 0$ par $u_n = ${u
|
|
15
15
|
.toTree()
|
|
16
16
|
.toTex()}$. Calculer $u_${rank}$.`,
|
|
17
|
-
keys: [],
|
|
17
|
+
keys: ["u", "underscore", "equal"],
|
|
18
18
|
answerFormat: "tex",
|
|
19
19
|
identifiers: { rank, coeffs: u.coefficients },
|
|
20
20
|
};
|
|
@@ -32,8 +32,8 @@ const getPropositions = (n, { answer, rank, coeffs }) => {
|
|
|
32
32
|
}
|
|
33
33
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
34
34
|
};
|
|
35
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
36
|
-
return
|
|
35
|
+
const isAnswerValid = (ans, { answer, rank }) => {
|
|
36
|
+
return [answer, `u_{${rank}}=${answer}`, `u_${rank}=${answer}`].includes(ans);
|
|
37
37
|
};
|
|
38
38
|
exports.explicitFormulaUsage = {
|
|
39
39
|
id: "explicitFormulaUsage",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"geometricExplicitFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricExplicitFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAgDF,eAAO,MAAM,6BAA6B,EAAE,YAAY,CAAC,WAAW,CAanE,CAAC"}
|
|
@@ -20,14 +20,18 @@ const getGeometricExplicitFormulaUsage = () => {
|
|
|
20
20
|
instruction: `$(u_n)$ est une suite géométrique définie par $u_n = ${formulaTex}$. Calculer : $u_{${askedRank}}$`,
|
|
21
21
|
startStatement: `u_{${askedRank}}`,
|
|
22
22
|
answer,
|
|
23
|
-
keys: [],
|
|
23
|
+
keys: ["u", "underscore", "equal"],
|
|
24
24
|
answerFormat: "tex",
|
|
25
25
|
identifiers: { firstValue, reason, askedRank },
|
|
26
26
|
};
|
|
27
27
|
return question;
|
|
28
28
|
};
|
|
29
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
30
|
-
return
|
|
29
|
+
const isAnswerValid = (ans, { answer, askedRank }) => {
|
|
30
|
+
return [
|
|
31
|
+
answer,
|
|
32
|
+
`u_{${askedRank}}=${answer}`,
|
|
33
|
+
`u_${askedRank}=${answer}`,
|
|
34
|
+
].includes(ans);
|
|
31
35
|
};
|
|
32
36
|
const getPropositions = (n, { answer, firstValue, reason, askedRank }) => {
|
|
33
37
|
const propositions = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricReasonUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"geometricReasonUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricReasonUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AA8CF,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,WAAW,CAY1D,CAAC"}
|
|
@@ -15,7 +15,7 @@ const getGeometricReasonUsage = () => {
|
|
|
15
15
|
instruction: `$(u_n)$ est une suite géométrique de raison $q = ${reason}$ et on sait que $u_{${startRank}} = ${startValue}$. Calculer : $u_{${askedRank}}$`,
|
|
16
16
|
startStatement: `u_{${askedRank}}`,
|
|
17
17
|
answer,
|
|
18
|
-
keys: ["
|
|
18
|
+
keys: ["u", "underscore", "equal"],
|
|
19
19
|
answerFormat: "tex",
|
|
20
20
|
identifiers: { startValue, reason, startRank },
|
|
21
21
|
};
|
|
@@ -31,8 +31,12 @@ const getPropositions = (n, { answer, startValue, reason }) => {
|
|
|
31
31
|
}
|
|
32
32
|
return (0, shuffle_1.shuffle)(propositions);
|
|
33
33
|
};
|
|
34
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
35
|
-
return
|
|
34
|
+
const isAnswerValid = (ans, { answer, startRank }) => {
|
|
35
|
+
return [
|
|
36
|
+
answer,
|
|
37
|
+
`u_{${startRank}}=${answer}`,
|
|
38
|
+
`u_${startRank}=${answer}`,
|
|
39
|
+
].includes(ans);
|
|
36
40
|
};
|
|
37
41
|
exports.geometricReasonUsage = {
|
|
38
42
|
id: "geometricReasonUsage",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometricRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"geometricRecurrenceFormulaUsage.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sequences/geometric/geometricRecurrenceFormulaUsage.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAKlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAkDF,eAAO,MAAM,+BAA+B,EAAE,YAAY,CAAC,WAAW,CAarE,CAAC"}
|
|
@@ -15,7 +15,7 @@ const getGeometricRecurrenceFormulaUsage = () => {
|
|
|
15
15
|
instruction: `$(u_n)$ est une suite définie par $u_{n+1} = ${reason}\\times u_n$ et $u_{${firstRank}} = ${firstValue}$. Calculer : $u_{${askedRank}}$`,
|
|
16
16
|
startStatement: `u_{${askedRank}}`,
|
|
17
17
|
answer,
|
|
18
|
-
keys: ["
|
|
18
|
+
keys: ["u", "underscore", "equal"],
|
|
19
19
|
answerFormat: "tex",
|
|
20
20
|
identifiers: { firstValue, reason, firstRank },
|
|
21
21
|
};
|
|
@@ -31,7 +31,12 @@ const getPropositions = (n, { answer, firstValue, reason }) => {
|
|
|
31
31
|
}
|
|
32
32
|
return (0, shuffle_1.shuffle)(propositions);
|
|
33
33
|
};
|
|
34
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
34
|
+
const isAnswerValid = (ans, { answer, firstRank }) => {
|
|
35
|
+
return [
|
|
36
|
+
answer,
|
|
37
|
+
`u_{${firstRank + 1}}=${answer}`,
|
|
38
|
+
`u_${firstRank + 1}=${answer}`,
|
|
39
|
+
].includes(ans);
|
|
35
40
|
return ans === answer;
|
|
36
41
|
};
|
|
37
42
|
exports.geometricRecurrenceFormulaUsage = {
|
|
@@ -20,7 +20,7 @@ const getRecurrenceFormulaUsageQuestion = () => {
|
|
|
20
20
|
instruction: `Soit $u$ la suite définie par $u_0 = ${u0}$ et pour tout $n\\geq 1$, $u_{n+1} = ${u
|
|
21
21
|
.toTree()
|
|
22
22
|
.toTex()}$. Calculer $u_${rank}$.`,
|
|
23
|
-
keys: [],
|
|
23
|
+
keys: ["u", "underscore", "equal"],
|
|
24
24
|
answerFormat: "tex",
|
|
25
25
|
identifiers: { rank, u0, coeffs },
|
|
26
26
|
};
|
|
@@ -37,8 +37,8 @@ const getPropositions = (n, { answer, rank, u0, coeffs }) => {
|
|
|
37
37
|
}
|
|
38
38
|
return (0, exercise_1.shuffleProps)(propositions, n);
|
|
39
39
|
};
|
|
40
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
41
|
-
return
|
|
40
|
+
const isAnswerValid = (ans, { answer, rank }) => {
|
|
41
|
+
return [answer, `u_{${rank}}=${answer}`, `u_${rank}=${answer}`].includes(ans);
|
|
42
42
|
};
|
|
43
43
|
exports.recurrenceFormulaUsage = {
|
|
44
44
|
id: "recurrenceFormulaUsage",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MathExercise } from "../../../exercises/exercise";
|
|
2
|
-
import { ClosureType } from "../../../tree/nodes/sets/
|
|
2
|
+
import { ClosureType } from "../../../tree/nodes/sets/closure";
|
|
3
3
|
type Identifiers = {
|
|
4
4
|
isIntervalToInequality: boolean;
|
|
5
5
|
intervalMin: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"inequalityToInterval.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/inequalityToInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AASlC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAK5D,KAAK,WAAW,GAAG;IACjB,sBAAsB,EAAE,OAAO,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,WAAW,CAAC;CAC9B,CAAC;AA8KF,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,WAAW,CAa1D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"intervalsIntersection.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAwDF,eAAO,MAAM,qBAAqB,EAAE,YAAY,CAAC,WAAW,CAa3D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"intervalsUnion.d.ts","sourceRoot":"","sources":["../../../../src/exercises/sets/intervals/intervalsUnion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAQb,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAG5D,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AA6CF,eAAO,MAAM,cAAc,EAAE,YAAY,CAAC,WAAW,CAapD,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -18,6 +18,14 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
|
|
|
18
18
|
remainder: number;
|
|
19
19
|
}> | import("./exercises/exercise").MathExercise<{
|
|
20
20
|
type: number;
|
|
21
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
22
|
+
a: number;
|
|
23
|
+
b: number;
|
|
24
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
25
|
+
a: number;
|
|
26
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
27
|
+
a: number;
|
|
28
|
+
b: number;
|
|
21
29
|
}> | import("./exercises/exercise").MathExercise<{
|
|
22
30
|
integerFirst: boolean;
|
|
23
31
|
integer: number;
|
|
@@ -200,6 +208,9 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
|
|
|
200
208
|
b: number;
|
|
201
209
|
c: number;
|
|
202
210
|
d: number;
|
|
211
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
212
|
+
k: number;
|
|
213
|
+
inequationSymbol: import("./math/inequations/inequation").InegalitySymbols;
|
|
203
214
|
}> | import("./exercises/exercise").MathExercise<{
|
|
204
215
|
rand: boolean;
|
|
205
216
|
poly1: number[];
|
|
@@ -218,6 +229,12 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
|
|
|
218
229
|
e: number;
|
|
219
230
|
f: number;
|
|
220
231
|
g: number;
|
|
232
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
233
|
+
coeffs: number[][];
|
|
234
|
+
isXAsked: boolean;
|
|
235
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
236
|
+
coeffs: number[][];
|
|
237
|
+
isXAsked: boolean;
|
|
221
238
|
}> | import("./exercises/exercise").MathExercise<{
|
|
222
239
|
word: string;
|
|
223
240
|
}> | import("./exercises/exercise").MathExercise<{
|
|
@@ -379,6 +396,19 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
|
|
|
379
396
|
b?: number | undefined;
|
|
380
397
|
coefficients?: number[] | undefined;
|
|
381
398
|
tex?: string | undefined;
|
|
399
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
400
|
+
affineA: number;
|
|
401
|
+
affineB: number;
|
|
402
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
403
|
+
affineA: number;
|
|
404
|
+
affineB: number;
|
|
405
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
406
|
+
affineA: number;
|
|
407
|
+
affineB: number;
|
|
408
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
409
|
+
affineA: number;
|
|
410
|
+
affineB: number;
|
|
411
|
+
power: number;
|
|
382
412
|
}> | import("./exercises/exercise").MathExercise<{
|
|
383
413
|
coeffs: number[];
|
|
384
414
|
x: number;
|
|
@@ -457,7 +487,21 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
|
|
|
457
487
|
intervals: {
|
|
458
488
|
a: number;
|
|
459
489
|
b: number;
|
|
460
|
-
closure: import("./tree/nodes/sets/
|
|
490
|
+
closure: import("./tree/nodes/sets/closure").ClosureType;
|
|
491
|
+
}[];
|
|
492
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
493
|
+
yValue: number;
|
|
494
|
+
fSplinePoints: number[][];
|
|
495
|
+
gSplinePoints: number[][];
|
|
496
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
497
|
+
yValue: number;
|
|
498
|
+
fSplinePoints: number[][];
|
|
499
|
+
gSplinePoints: number[][];
|
|
500
|
+
ineqSymbol: import("./math/inequations/inequation").InegalitySymbols;
|
|
501
|
+
intervals: {
|
|
502
|
+
a: number;
|
|
503
|
+
b: number;
|
|
504
|
+
closure: import("./tree/nodes/sets/closure").ClosureType;
|
|
461
505
|
}[];
|
|
462
506
|
}> | import("./exercises/exercise").MathExercise<{
|
|
463
507
|
k: number;
|
|
@@ -565,6 +609,11 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
|
|
|
565
609
|
}> | import("./exercises/exercise").MathExercise<{
|
|
566
610
|
type: string;
|
|
567
611
|
fctCmd: string;
|
|
612
|
+
}> | import("./exercises/exercise").MathExercise<{
|
|
613
|
+
a: number;
|
|
614
|
+
b: number;
|
|
615
|
+
closure: import("./tree/nodes/sets/closure").ClosureType;
|
|
616
|
+
type: number;
|
|
568
617
|
}> | import("./exercises/exercise").MathExercise<{
|
|
569
618
|
coin: boolean;
|
|
570
619
|
radius: number;
|
|
@@ -962,21 +1011,21 @@ declare const mathExercises: (import("./exercises/exercise").MathExercise<{
|
|
|
962
1011
|
isIntervalToInequality: boolean;
|
|
963
1012
|
intervalMin: number;
|
|
964
1013
|
intervalMax: number;
|
|
965
|
-
intervalClosure: import("./tree/nodes/sets/
|
|
1014
|
+
intervalClosure: import("./tree/nodes/sets/closure").ClosureType;
|
|
966
1015
|
}> | import("./exercises/exercise").MathExercise<{
|
|
967
1016
|
int1Min: number;
|
|
968
1017
|
int1Max: number;
|
|
969
|
-
int1Closure: import("./tree/nodes/sets/
|
|
1018
|
+
int1Closure: import("./tree/nodes/sets/closure").ClosureType;
|
|
970
1019
|
int2Min: number;
|
|
971
1020
|
int2Max: number;
|
|
972
|
-
int2Closure: import("./tree/nodes/sets/
|
|
1021
|
+
int2Closure: import("./tree/nodes/sets/closure").ClosureType;
|
|
973
1022
|
}> | import("./exercises/exercise").MathExercise<{
|
|
974
1023
|
int1Min: number;
|
|
975
1024
|
int1Max: number;
|
|
976
|
-
int1Closure: import("./tree/nodes/sets/
|
|
1025
|
+
int1Closure: import("./tree/nodes/sets/closure").ClosureType;
|
|
977
1026
|
int2Min: number;
|
|
978
1027
|
int2Max: number;
|
|
979
|
-
int2Closure: import("./tree/nodes/sets/
|
|
1028
|
+
int2Closure: import("./tree/nodes/sets/closure").ClosureType;
|
|
980
1029
|
}> | import("./exercises/exercise").MathExercise<{
|
|
981
1030
|
type: number;
|
|
982
1031
|
nb: string;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;KACzB;CACF;AAgDD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,QAAA,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;KACzB;CACF;AAgDD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAtCnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA/BF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA/BF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAO4C,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affine.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/affine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"affine.d.ts","sourceRoot":"","sources":["../../../src/math/polynomials/affine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,MAAM,CACX,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAC3D,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAC1D,MAAM;IAcT,MAAM,CAAC,gBAAgB,CACrB,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,EAC3D,KAAK,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAC1D,MAAM,EAAE;CAWZ;AAED,qBAAa,MAAO,SAAQ,UAAU;IACpC,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;gBAEL,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAY;IAOxD,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,MAAM;CAGnB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Nombre } from "../../../math/numbers/nombre";
|
|
2
2
|
import { AlgebraicNode } from "../../../tree/nodes/algebraicNode";
|
|
3
|
-
import { ClosureType
|
|
3
|
+
import { ClosureType } from "../../../tree/nodes/sets/closure";
|
|
4
|
+
import { IntervalNode } from "../../../tree/nodes/sets/intervalNode";
|
|
4
5
|
import { MathSet } from "../mathSet";
|
|
5
6
|
import { MathSetInterface } from "../mathSetInterface";
|
|
6
7
|
export declare abstract class IntervalConstructor {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"intervals.d.ts","sourceRoot":"","sources":["../../../../src/math/sets/intervals/intervals.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAc,MAAM,2BAA2B,CAAC;AAI/D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAM/D,OAAO,
|
|
1
|
+
{"version":3,"file":"intervals.d.ts","sourceRoot":"","sources":["../../../../src/math/sets/intervals/intervals.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAc,MAAM,2BAA2B,CAAC;AAI/D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAM/D,OAAO,EAAW,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAIlE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,8BAAsB,mBAAmB;IACvC,MAAM,CAAC,MAAM;IA2Cb,MAAM,CAAC,gBAAgB,CAAC,EAAE,EAAE,MAAM;CAWnC;AAED,qBAAa,QAAS,YAAW,gBAAgB;IAC/C,OAAO,EAAE,aAAa,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,WAAW,CAAC;IACrB,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC;IACvB,YAAY,EAAE,GAAG,GAAG,GAAG,CAAC;IACxB,oBAAoB,EAAE,MAAM,GAAG,GAAG,CAAC;IACnC,qBAAqB,EAAE,MAAM,GAAG,GAAG,CAAC;IACpC,GAAG,EAAE,MAAM,CAAC;gBACA,GAAG,EAAE,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW;IAiBxE,MAAM,CAAC,QAAQ,EAAE,QAAQ;IAOzB,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;IA6ClC,YAAY,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO;IAyCzC,WAAW,IAAI,MAAM;IAGrB,KAAK,IAAI,MAAM;IAMf,YAAY,IAAI,MAAM;IAmBtB,gBAAgB,IAAI,MAAM;IAI1B,MAAM;CAGP"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Interval = exports.IntervalConstructor = void 0;
|
|
4
4
|
const randint_1 = require("../../../math/utils/random/randint");
|
|
5
5
|
const infiniteNode_1 = require("../../../tree/nodes/numbers/infiniteNode");
|
|
6
|
+
const closure_1 = require("../../../tree/nodes/sets/closure");
|
|
6
7
|
const intervalNode_1 = require("../../../tree/nodes/sets/intervalNode");
|
|
7
8
|
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
8
9
|
const mathSet_1 = require("../mathSet");
|
|
@@ -15,37 +16,37 @@ class IntervalConstructor {
|
|
|
15
16
|
case 0:
|
|
16
17
|
min = infiniteNode_1.MinusInfinityNode;
|
|
17
18
|
max = (0, randint_1.randint)(-10, 10).toTree();
|
|
18
|
-
closure = (0, coinFlip_1.coinFlip)() ?
|
|
19
|
+
closure = (0, coinFlip_1.coinFlip)() ? closure_1.ClosureType.OF : closure_1.ClosureType.OO;
|
|
19
20
|
break;
|
|
20
21
|
case 1:
|
|
21
22
|
min = (0, randint_1.randint)(-10, 10).toTree();
|
|
22
23
|
max = infiniteNode_1.PlusInfinityNode;
|
|
23
|
-
closure = (0, coinFlip_1.coinFlip)() ?
|
|
24
|
+
closure = (0, coinFlip_1.coinFlip)() ? closure_1.ClosureType.OO : closure_1.ClosureType.FO;
|
|
24
25
|
break;
|
|
25
26
|
case 2:
|
|
26
27
|
a = (0, randint_1.randint)(-10, 10);
|
|
27
28
|
min = a.toTree();
|
|
28
29
|
max = (0, randint_1.randint)(a + 1, a + 10).toTree();
|
|
29
|
-
closure =
|
|
30
|
+
closure = closure_1.ClosureType.FF;
|
|
30
31
|
break;
|
|
31
32
|
case 3:
|
|
32
33
|
a = (0, randint_1.randint)(-10, 10);
|
|
33
34
|
min = a.toTree();
|
|
34
35
|
max = (0, randint_1.randint)(a + 1, a + 10).toTree();
|
|
35
|
-
closure =
|
|
36
|
+
closure = closure_1.ClosureType.OF;
|
|
36
37
|
break;
|
|
37
38
|
case 4:
|
|
38
39
|
a = (0, randint_1.randint)(-10, 10);
|
|
39
40
|
min = a.toTree();
|
|
40
41
|
max = (0, randint_1.randint)(a + 1, a + 10).toTree();
|
|
41
|
-
closure =
|
|
42
|
+
closure = closure_1.ClosureType.FO;
|
|
42
43
|
break;
|
|
43
44
|
case 5:
|
|
44
45
|
default:
|
|
45
46
|
a = (0, randint_1.randint)(-10, 10);
|
|
46
47
|
min = a.toTree();
|
|
47
48
|
max = (0, randint_1.randint)(a + 1, a + 10).toTree();
|
|
48
|
-
closure =
|
|
49
|
+
closure = closure_1.ClosureType.OO;
|
|
49
50
|
break;
|
|
50
51
|
}
|
|
51
52
|
return new Interval(min, max, closure);
|
|
@@ -73,9 +74,9 @@ class Interval {
|
|
|
73
74
|
this.minTex = min.toTex();
|
|
74
75
|
this.maxTex = max.toTex();
|
|
75
76
|
this.leftBracket =
|
|
76
|
-
closure ===
|
|
77
|
+
closure === closure_1.ClosureType.FF || closure === closure_1.ClosureType.FO ? "[" : "]";
|
|
77
78
|
this.rightBracket =
|
|
78
|
-
closure ===
|
|
79
|
+
closure === closure_1.ClosureType.FF || closure === closure_1.ClosureType.OF ? "]" : "[";
|
|
79
80
|
this.leftInequalitySymbol = this.leftBracket === "[" ? "\\le" : "<";
|
|
80
81
|
this.rightInequalitySymbol = this.rightBracket === "]" ? "\\le" : "<";
|
|
81
82
|
this.tex = this.toTex();
|
|
@@ -117,7 +118,7 @@ class Interval {
|
|
|
117
118
|
: secondInterval.getRandomElement());
|
|
118
119
|
}
|
|
119
120
|
else {
|
|
120
|
-
const closure =
|
|
121
|
+
const closure = closure_1.Closure.fromBrackets(unionLeftBracket, unionRightBracket);
|
|
121
122
|
return new Interval(min, max, closure);
|
|
122
123
|
}
|
|
123
124
|
}
|
|
@@ -149,7 +150,7 @@ class Interval {
|
|
|
149
150
|
: b < d
|
|
150
151
|
? this.rightBracket
|
|
151
152
|
: interval.rightBracket;
|
|
152
|
-
const closure =
|
|
153
|
+
const closure = closure_1.Closure.fromBrackets(leftBracket, rightBracket);
|
|
153
154
|
return new Interval(min, max, closure);
|
|
154
155
|
}
|
|
155
156
|
insideToTex() {
|
|
@@ -159,8 +160,8 @@ class Interval {
|
|
|
159
160
|
return `${this.leftBracket}\\ ${this.insideToTex()}\\ ${this.rightBracket}\\ `;
|
|
160
161
|
}
|
|
161
162
|
toInequality() {
|
|
162
|
-
const isLeftClosed = this.closure ===
|
|
163
|
-
const isRightClosed = this.closure ===
|
|
163
|
+
const isLeftClosed = this.closure === closure_1.ClosureType.FO || this.closure === closure_1.ClosureType.FF;
|
|
164
|
+
const isRightClosed = this.closure === closure_1.ClosureType.FF || this.closure === closure_1.ClosureType.OF;
|
|
164
165
|
if (this.max === Infinity) {
|
|
165
166
|
if (isLeftClosed) {
|
|
166
167
|
return `x\\ge${this.minTex}`;
|
|
@@ -169,7 +170,7 @@ class Interval {
|
|
|
169
170
|
return `x>${this.minTex}`;
|
|
170
171
|
}
|
|
171
172
|
else if (this.min === -Infinity) {
|
|
172
|
-
if (this.closure ===
|
|
173
|
+
if (this.closure === closure_1.ClosureType.OF) {
|
|
173
174
|
return `x\\le${this.maxTex}`;
|
|
174
175
|
}
|
|
175
176
|
else
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare abstract class SystemConstructor {
|
|
2
|
+
static random(): System;
|
|
3
|
+
static niceValues(): System;
|
|
4
|
+
}
|
|
5
|
+
export declare class System {
|
|
6
|
+
coeffs: number[][];
|
|
7
|
+
constructor(coeffs: number[][]);
|
|
8
|
+
solve(): {
|
|
9
|
+
x: import("../../tree/nodes/algebraicNode").AlgebraicNode;
|
|
10
|
+
y: import("../../tree/nodes/algebraicNode").AlgebraicNode;
|
|
11
|
+
};
|
|
12
|
+
toTex(): string;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=system.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../../src/math/systems/system.ts"],"names":[],"mappings":"AASA,8BAAsB,iBAAiB;IACrC,MAAM,CAAC,MAAM;IAeb,MAAM,CAAC,UAAU;CAiBlB;AACD,qBAAa,MAAM;IACjB,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;gBAEP,MAAM,EAAE,MAAM,EAAE,EAAE;IAG9B,KAAK;;;;IAwCL,KAAK;CAcN"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.System = exports.SystemConstructor = void 0;
|
|
4
|
+
const addNode_1 = require("../../tree/nodes/operators/addNode");
|
|
5
|
+
const fractionNode_1 = require("../../tree/nodes/operators/fractionNode");
|
|
6
|
+
const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
|
|
7
|
+
const substractNode_1 = require("../../tree/nodes/operators/substractNode");
|
|
8
|
+
const variableNode_1 = require("../../tree/nodes/variables/variableNode");
|
|
9
|
+
const doWhile_1 = require("../../utils/doWhile");
|
|
10
|
+
const randint_1 = require("../utils/random/randint");
|
|
11
|
+
class SystemConstructor {
|
|
12
|
+
static random() {
|
|
13
|
+
const a1 = (0, randint_1.randint)(-10, 11, [0]);
|
|
14
|
+
const b1 = (0, randint_1.randint)(-10, 11, [0]);
|
|
15
|
+
const c1 = (0, randint_1.randint)(-10, 11);
|
|
16
|
+
const a2 = (0, randint_1.randint)(-10, 11, [0]);
|
|
17
|
+
const b2 = (0, doWhile_1.doWhile)(() => (0, randint_1.randint)(-10, 11, [0]), (x) => a1 / b1 === a2 / x);
|
|
18
|
+
const c2 = (0, randint_1.randint)(-10, 11);
|
|
19
|
+
return new System([
|
|
20
|
+
[a1, b1, c1],
|
|
21
|
+
[a2, b2, c2],
|
|
22
|
+
]);
|
|
23
|
+
}
|
|
24
|
+
static niceValues() {
|
|
25
|
+
const a1 = (0, randint_1.randint)(-10, 11, [0]);
|
|
26
|
+
const b1 = (0, randint_1.randint)(-10, 11, [0]);
|
|
27
|
+
const a2 = (0, randint_1.randint)(-10, 11, [0]);
|
|
28
|
+
const b2 = (0, doWhile_1.doWhile)(() => (0, randint_1.randint)(-10, 11, [0]), (x) => a1 / b1 === a2 / x);
|
|
29
|
+
const x = (0, randint_1.randint)(-10, 11);
|
|
30
|
+
const y = (0, randint_1.randint)(-10, 11);
|
|
31
|
+
const c1 = a1 * x + b1 * y;
|
|
32
|
+
const c2 = a2 * x + b2 * y;
|
|
33
|
+
return new System([
|
|
34
|
+
[a1, b1, c1],
|
|
35
|
+
[a2, b2, c2],
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.SystemConstructor = SystemConstructor;
|
|
40
|
+
class System {
|
|
41
|
+
//coeffs[i][0]x+coeffs[i][1]y = coeffs[i][2]
|
|
42
|
+
constructor(coeffs) {
|
|
43
|
+
this.coeffs = coeffs;
|
|
44
|
+
}
|
|
45
|
+
solve() {
|
|
46
|
+
if (this.coeffs.length !== 2)
|
|
47
|
+
throw Error("General system resolution not implemented yet");
|
|
48
|
+
//x = (c'-b'c/b)/(a'-b'a/b)
|
|
49
|
+
if (!this.coeffs[0][1] ||
|
|
50
|
+
this.coeffs[1][0] ===
|
|
51
|
+
(this.coeffs[1][1] * this.coeffs[0][0]) / this.coeffs[0][1])
|
|
52
|
+
throw Error("No solution");
|
|
53
|
+
const x = new fractionNode_1.FractionNode(new substractNode_1.SubstractNode(this.coeffs[1][2].toTree(), new fractionNode_1.FractionNode((this.coeffs[1][1] * this.coeffs[0][2]).toTree(), this.coeffs[0][1].toTree())), new substractNode_1.SubstractNode(this.coeffs[1][0].toTree(), new fractionNode_1.FractionNode((this.coeffs[1][1] * this.coeffs[0][0]).toTree(), this.coeffs[0][1].toTree()))).simplify();
|
|
54
|
+
//y = c-ax/b
|
|
55
|
+
console.log("x", x.toTex());
|
|
56
|
+
const y = new fractionNode_1.FractionNode(new substractNode_1.SubstractNode(this.coeffs[0][2].toTree(), new multiplyNode_1.MultiplyNode(this.coeffs[0][0].toTree(), x)), this.coeffs[0][1].toTree()).simplify();
|
|
57
|
+
return {
|
|
58
|
+
x,
|
|
59
|
+
y,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
toTex() {
|
|
63
|
+
const x = new variableNode_1.VariableNode("x");
|
|
64
|
+
const y = new variableNode_1.VariableNode("y");
|
|
65
|
+
return `\\left\\{\\begin{matrix}
|
|
66
|
+
${new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(this.coeffs[0][0].toTree(), x), new multiplyNode_1.MultiplyNode(this.coeffs[0][1].toTree(), y)).toTex()}&=&${this.coeffs[0][2]} \\\\
|
|
67
|
+
${new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(this.coeffs[1][0].toTree(), x), new multiplyNode_1.MultiplyNode(this.coeffs[1][1].toTree(), y)).toTex()}&=&${this.coeffs[1][2]}
|
|
68
|
+
\\end{matrix}\\right.`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.System = System;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isPrime.d.ts","sourceRoot":"","sources":["../../../../src/math/utils/arithmetic/isPrime.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,MAAO,MAAM,YAOhC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPrime = void 0;
|
|
4
|
+
const isPrime = (n) => {
|
|
5
|
+
if (n === 0 || n === 1)
|
|
6
|
+
return false;
|
|
7
|
+
const sqrt = Math.floor(Math.sqrt(n));
|
|
8
|
+
for (let i = 2; i <= sqrt; i++) {
|
|
9
|
+
if (n % i === 0)
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
return true;
|
|
13
|
+
};
|
|
14
|
+
exports.isPrime = isPrime;
|
package/lib/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,CAAC;AAOrB,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAa3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,MAAM,aAAa,CAAC;QAC5B,SAAS,EAAE,MAAM,MAAM,CAAC;KACzB;CACF"}
|
package/lib/server.js
CHANGED
|
@@ -37,7 +37,6 @@ const dotenv_1 = __importDefault(require("dotenv"));
|
|
|
37
37
|
const cors_1 = __importDefault(require("cors"));
|
|
38
38
|
const numberNode_1 = require("./tree/nodes/numbers/numberNode");
|
|
39
39
|
const infiniteNode_1 = require("./tree/nodes/numbers/infiniteNode");
|
|
40
|
-
const round_1 = require("./math/utils/round");
|
|
41
40
|
const jsonParser = body_parser_1.default.json();
|
|
42
41
|
const allExercises = [...exercises];
|
|
43
42
|
Number.prototype.toTree = function () {
|
|
@@ -56,7 +55,6 @@ const runServer = () => {
|
|
|
56
55
|
const app = (0, express_1.default)();
|
|
57
56
|
app.use((0, cors_1.default)());
|
|
58
57
|
console.log(exercises.length);
|
|
59
|
-
console.log((0, round_1.round)((35 * 10) / 6, 2) * 100);
|
|
60
58
|
app.get("/", (req, res) => {
|
|
61
59
|
res.json(allExercises);
|
|
62
60
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inequationNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/inequations/inequationNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEjB,MAAM,mCAAmC,CAAC;AAI3C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"inequationNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/inequations/inequationNode.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAEjB,MAAM,mCAAmC,CAAC;AAI3C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,qBAAa,cAAe,YAAW,IAAI;IACzC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjB,OAAO,EAAE,gBAAgB,EAAE,CAAC;gBAE1B,QAAQ,EAAE,IAAI,EAAE,EAChB,OAAO,EAAE,gBAAgB,EAAE,GAAG,gBAAgB;IAwBhD,UAAU;IA6CV,UAAU;IAQV,cAAc;IAGd,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS;IAYhD,YAAY;IAGZ,QAAQ;IAGR,SAAS;IAGT,KAAK;CAGN"}
|