math-exercises 3.0.102 → 3.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/curve/sqrtCurvePoint.d.ts.map +1 -1
- package/lib/exercises/math/curve/sqrtCurvePoint.js +4 -2
- package/lib/exercises/math/curve/squareCurvePoint.d.ts.map +1 -1
- package/lib/exercises/math/curve/squareCurvePoint.js +4 -2
- package/lib/exercises/math/functions/sign/equationFromSignTable.js +1 -1
- package/lib/exercises/math/functions/square/squareImageIntervalWithGraph.d.ts.map +1 -1
- package/lib/exercises/math/functions/square/squareImageIntervalWithGraph.js +10 -2
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.js +3 -2
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorMultiple.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/constructions/traceVectorMultiple.js +8 -1
- package/lib/exercises/math/geometry/vectors/distributeAndReduceVectors.js +6 -7
- package/lib/exercises/math/geometry/vectors/parallelogram/parallelogramCriterion.js +1 -1
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +33 -10
- package/lib/exercises/math/geometry/vectors/vectorLinearCombination.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorLinearCombination.js +39 -9
- package/lib/exercises/math/geometry/vectors/vectorNormCalculation.js +1 -1
- package/lib/exercises/math/geometry/vectors/vectorRepresentative.js +1 -1
- package/lib/exercises/math/probaStat/basicProbas/ballsBasicProbas.js +1 -1
- package/lib/exercises/math/probaStat/basicProbas/cardBasicProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/cardBasicProbas.js +1 -3
- package/lib/exercises/math/probaStat/basicProbas/rouletteProbas.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicProbas/rouletteProbas.js +5 -3
- package/lib/exercises/math/probaStat/events/describeEvent.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/events/describeEvent.js +4 -10
- package/lib/exercises/math/probaStat/events/eventNotation.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/events/eventNotation.js +4 -10
- package/lib/exercises/math/probaStat/issuesCountingForCards.js +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableNoContext.js +5 -3
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +10 -2
- package/lib/exercises/math/probaStat/stats1var/averageLinearity.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageLinearity.js +5 -4
- package/lib/exercises/math/probaStat/stats1var/compareSeriesDispersion.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/compareSeriesDispersion.js +14 -32
- package/lib/exercises/math/probaStat/stats1var/interquartilesList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/interquartilesList.js +1 -0
- package/lib/exercises/math/probaStat/stats1var/interquartilesTable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/interquartilesTable.js +1 -0
- package/lib/exercises/math/probaStat/stats1var/quartiles.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartiles.js +1 -0
- package/lib/exercises/math/probaStat/stats1var/quartilesList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/quartilesList.js +1 -0
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +1 -1
- package/lib/exercises/math/python/pythonForLoopInstructionCompletion.js +1 -1
- package/lib/exercises/math/python/variableType.js +1 -1
- package/lib/exercises/math/python/whileLoop.d.ts.map +1 -1
- package/lib/exercises/math/python/whileLoop.js +1 -0
- package/lib/exercises/math/python/whileLoopCount.js +2 -2
- package/lib/exercises/math/sampling/samplingFrequency.d.ts.map +1 -1
- package/lib/exercises/math/sampling/samplingFrequency.js +1 -3
- package/lib/exercises/math/sequences/genericSequenceVariations.js +3 -3
- package/lib/exercises/math/sequences/sequencePlot.js +1 -1
- package/lib/exercises/pc/electricity/kirchhoffVoltageLaw.js +1 -1
- package/lib/math/probability/binomial.d.ts +1 -0
- package/lib/math/probability/binomial.d.ts.map +1 -1
- package/lib/math/probability/binomial.js +20 -0
- package/lib/math/utils/stats/gaussianWithNoise.d.ts +3 -0
- package/lib/math/utils/stats/gaussianWithNoise.d.ts.map +1 -0
- package/lib/math/utils/stats/gaussianWithNoise.js +9 -0
- package/lib/playground.d.ts +5 -0
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +8 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sqrtCurvePoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/curve/sqrtCurvePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAatC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"sqrtCurvePoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/curve/sqrtCurvePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAatC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAyHF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}
|
|
@@ -50,8 +50,10 @@ const getCorrection = (identifiers) => {
|
|
|
50
50
|
const y = point.y;
|
|
51
51
|
const isValidPoint = isPointOnCurve(identifiers);
|
|
52
52
|
const conclusion = isValidPoint
|
|
53
|
-
?
|
|
54
|
-
:
|
|
53
|
+
? `Le point est donc bien sur la courbe.`
|
|
54
|
+
: `Puisque $f\\left(${x.toTex()}\\right) = ${sqrt(x)
|
|
55
|
+
.simplify()
|
|
56
|
+
.toTex()}\\neq ${y.toTex()}$, le point n'est donc pas sur la courbe.`;
|
|
55
57
|
return `$${point.toTexWithCoords()}$ appartient à la courbe de la fonction racine carrée si et seulement si :
|
|
56
58
|
|
|
57
59
|
${alignTex(sqrt(x).simplify().toTex() != sqrt(x).toTex()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"squareCurvePoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/curve/squareCurvePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AActC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;
|
|
1
|
+
{"version":3,"file":"squareCurvePoint.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/curve/squareCurvePoint.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AActC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AA2HF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAiBlD,CAAC"}
|
|
@@ -49,8 +49,10 @@ const getCorrection = (identifiers) => {
|
|
|
49
49
|
const point = PointConstructor.fromIdentifiers(pointId);
|
|
50
50
|
const isValidPoint = isPointOnCurve(identifiers);
|
|
51
51
|
const conclusion = isValidPoint
|
|
52
|
-
?
|
|
53
|
-
:
|
|
52
|
+
? `Le point est donc bien sur la courbe.`
|
|
53
|
+
: `Puisque $f(${point.x.toTex()}) = ${square(point.x)
|
|
54
|
+
.simplify()
|
|
55
|
+
.toTex()}\\neq ${point.y.toTex()}$, le point n'est donc pas sur la courbe.`;
|
|
54
56
|
return `$${point.toTexWithCoords()}$ appartient à la courbe de la fonction carré si et seulement si :
|
|
55
57
|
|
|
56
58
|
${alignTex([
|
|
@@ -210,7 +210,7 @@ const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
|
210
210
|
return {
|
|
211
211
|
answer: getAnswer(identifiers, opts),
|
|
212
212
|
instruction: getInstruction(identifiers, opts),
|
|
213
|
-
answerFormat: "
|
|
213
|
+
answerFormat: "tex",
|
|
214
214
|
identifiers,
|
|
215
215
|
hint: getHint(identifiers, opts),
|
|
216
216
|
correction: getCorrection(identifiers, opts),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"squareImageIntervalWithGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/square/squareImageIntervalWithGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAW,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAMxE,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;
|
|
1
|
+
{"version":3,"file":"squareImageIntervalWithGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/square/squareImageIntervalWithGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAAW,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAMxE,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,OAAO,EAAE,WAAW,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AA2NF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAc9D,CAAC"}
|
|
@@ -163,12 +163,20 @@ const getPropositions = (n, { answer, a, b, type, closure }) => {
|
|
|
163
163
|
}
|
|
164
164
|
return shuffleProps(propositions, n);
|
|
165
165
|
};
|
|
166
|
-
const isAnswerValid = (ans, { answer,
|
|
166
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
167
167
|
try {
|
|
168
|
+
const intervalSolution = getAnswerNode(identifiers);
|
|
168
169
|
const parsed = intervalParser(ans);
|
|
169
170
|
if (!parsed)
|
|
170
171
|
return false;
|
|
171
|
-
|
|
172
|
+
if (parsed.closure !== intervalSolution.closure)
|
|
173
|
+
return false;
|
|
174
|
+
const a = parsed.a.evaluate();
|
|
175
|
+
const b = parsed.b.evaluate();
|
|
176
|
+
return (Math.abs(a - intervalSolution.a.evaluate()) < 3 &&
|
|
177
|
+
Math.abs(b - intervalSolution.b.evaluate()) < 3);
|
|
178
|
+
// return;
|
|
179
|
+
// return parsed.simplify().toTex() === answer;
|
|
172
180
|
}
|
|
173
181
|
catch (err) {
|
|
174
182
|
return handleVEAError(err);
|
package/lib/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pointImageFromTranslation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAMtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;
|
|
1
|
+
{"version":3,"file":"pointImageFromTranslation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/euclidianConstructions/pointImageFromTranslation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAMtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAEF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,OAAO,CAAC;CACpB,CAAC;AAyKF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBpE,CAAC"}
|
|
@@ -73,8 +73,9 @@ const getStudentGGBOptions = (identifiers) => {
|
|
|
73
73
|
coords: ggb.getCoordsForPoints([...points, endPoint]),
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
-
const isGGBAnswerValid = (ans, { ggbAnswer }) => {
|
|
77
|
-
const
|
|
76
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, points, startPoint, translationPoints }) => {
|
|
77
|
+
const pointsUsed = points.map((p) => p.name);
|
|
78
|
+
const studentAns = ans.filter((c) => !pointsUsed.includes(c[0]));
|
|
78
79
|
if (studentAns.length !== 1)
|
|
79
80
|
return false;
|
|
80
81
|
const studentPoint = studentAns[0].split("=")[1];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traceVectorMultiple.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/constructions/traceVectorMultiple.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;
|
|
1
|
+
{"version":3,"file":"traceVectorMultiple.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/constructions/traceVectorMultiple.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AAOtC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,gBAAgB,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiLF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAkBrD,CAAC"}
|
|
@@ -28,7 +28,14 @@ const getHint = (identifiers) => {
|
|
|
28
28
|
const { startPointIndex, points, coeff, vectorPointsIndexes } = identifiers;
|
|
29
29
|
const origin = identifiers.points[startPointIndex].name;
|
|
30
30
|
const vec = `${identifiers.points[vectorPointsIndexes[0]].name}${identifiers.points[vectorPointsIndexes[1]].name}`;
|
|
31
|
-
|
|
31
|
+
const u = `\\overrightarrow{u}`;
|
|
32
|
+
return `
|
|
33
|
+
On considère un nombre réel $k\\neq 0$ et un vecteur $${u}\\neq \\overrightarrow{0}$. Le vecteur $k${u}$ est le vecteur :
|
|
34
|
+
|
|
35
|
+
- de même direction que $${u}$ ;
|
|
36
|
+
- de même sens que $${u}$ si $k>0$, et de sens contraire si $k<0$ ;
|
|
37
|
+
- de norme égale à $k||${u}||$ si $k>0$, et égale à $-k||${u}||$ si $k<0$.
|
|
38
|
+
`;
|
|
32
39
|
};
|
|
33
40
|
const getCorrection = (identifiers) => {
|
|
34
41
|
const { startPointIndex, points, coeff, vectorPointsIndexes } = identifiers;
|
|
@@ -48,14 +48,13 @@ ${node.toTex()}
|
|
|
48
48
|
$$`;
|
|
49
49
|
};
|
|
50
50
|
const getHint = (identifiers) => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
return `Utilise la propriété :
|
|
51
|
+
const u = "\\overrightarrow{u}";
|
|
52
|
+
const v = "\\overrightarrow{v}";
|
|
53
|
+
return `On rappelle les propriétés suivantes : pour tous vecteurs $${u}$ et $${v}$ et pour tous nombres réels $k$ et $k'$,
|
|
55
54
|
|
|
56
|
-
|
|
57
|
-
k(
|
|
58
|
-
|
|
55
|
+
- $k\\left(${u}+${v}\\right) = k${u}+k${v}$ ;
|
|
56
|
+
- $k${u}+k'${u}=(k+k')${u}$ ;
|
|
57
|
+
- $k\\left(k'${u}\\right) = \\left(k\\times k'\\right)${u}$.`;
|
|
59
58
|
};
|
|
60
59
|
const getCorrection = (identifiers) => {
|
|
61
60
|
const node = reifyAlgebraic(identifiers.expression);
|
|
@@ -73,7 +73,7 @@ Donner le nom du parallélogramme formé par ces vecteurs.`;
|
|
|
73
73
|
Donner une égalité entre deux vecteurs issus de ce parallélogramme.`;
|
|
74
74
|
};
|
|
75
75
|
const getHint = (identifiers) => {
|
|
76
|
-
return `$ABCD$ est un parallélogramme si et
|
|
76
|
+
return `$ABCD$ est un parallélogramme si et seulement si les vecteurs $\\overrightarrow{AB}$ et $\\overrightarrow{DC}$ sont égaux.`;
|
|
77
77
|
};
|
|
78
78
|
const getCorrection = (identifiers) => {
|
|
79
79
|
const { isAskingParallelogramName, pointNames } = identifiers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorCoordinatesFromTwoPoints.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"vectorCoordinatesFromTwoPoints.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AA4GF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAchE,CAAC"}
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { shuffleProps, tryToAddWrongProp, addValidProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Vector } from "../../../../math/geometry/vector.js";
|
|
3
4
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
|
+
import { binom, isBinomialCoefficientNode, } from "../../../../tree/nodes/operators/binomialCoefficientNode.js";
|
|
4
6
|
import { SubstractNode } from "../../../../tree/nodes/operators/substractNode.js";
|
|
7
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
8
|
+
import { vectorParser } from "../../../../tree/parsers/vectorParser.js";
|
|
9
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
5
10
|
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
6
11
|
import { randomLetter } from "../../../../utils/strings/randomLetter.js";
|
|
7
12
|
const getInstruction = (identifiers) => {
|
|
8
13
|
const { A, B, startLetter, endLetter } = identifiers;
|
|
9
|
-
return `
|
|
14
|
+
return `Soient deux points $${startLetter}\\left(${A[0]};${A[1]}\\right)$ et $${endLetter}\\left(${B[0]};${B[1]}\\right)$.
|
|
10
15
|
|
|
11
16
|
Quelles sont les coordonnées du vecteur $\\overrightarrow{${startLetter}${endLetter}}$ ?`;
|
|
12
17
|
};
|
|
13
18
|
const getAnswer = (identifiers) => {
|
|
14
19
|
const { A, B, startLetter, endLetter } = identifiers;
|
|
15
|
-
const
|
|
16
|
-
return
|
|
20
|
+
const vec = new Vector("u", (B[0] - A[0]).toTree(), (B[1] - A[1]).toTree());
|
|
21
|
+
return vec.toBinomCoords().toTex();
|
|
17
22
|
};
|
|
18
23
|
const getHint = (identifiers) => {
|
|
19
24
|
return `Si $A(x_A;y_A)$ et $B(x_B;y_B)$ sont deux points, alors le vecteur $\\overrightarrow{AB}$ a pour coordonnées :
|
|
@@ -40,7 +45,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
40
45
|
const question = {
|
|
41
46
|
answer: getAnswer(identifiers),
|
|
42
47
|
instruction: getInstruction(identifiers),
|
|
43
|
-
keys: ["semicolon"],
|
|
48
|
+
keys: ["binom", "semicolon"],
|
|
44
49
|
answerFormat: "tex",
|
|
45
50
|
hint: getHint(identifiers),
|
|
46
51
|
correction: getCorrection(identifiers),
|
|
@@ -62,16 +67,34 @@ const getVectorCoordinatesFromTwoPointsQuestion = () => {
|
|
|
62
67
|
const getPropositions = (n, { answer, A, B }) => {
|
|
63
68
|
const propositions = [];
|
|
64
69
|
addValidProp(propositions, answer);
|
|
65
|
-
tryToAddWrongProp(propositions,
|
|
66
|
-
tryToAddWrongProp(propositions,
|
|
67
|
-
tryToAddWrongProp(propositions,
|
|
70
|
+
tryToAddWrongProp(propositions, binom(A[0] - B[0], A[1] - B[1]).toTex());
|
|
71
|
+
tryToAddWrongProp(propositions, binom(A[1] - A[0], B[1] - B[0]).toTex());
|
|
72
|
+
tryToAddWrongProp(propositions, binom(B[1] - B[0], A[1] - A[0]).toTex());
|
|
68
73
|
while (propositions.length < n) {
|
|
69
|
-
tryToAddWrongProp(propositions,
|
|
74
|
+
tryToAddWrongProp(propositions, binom(randint(-10, 10), randint(-10, 10)).toTex());
|
|
70
75
|
}
|
|
71
76
|
return shuffleProps(propositions, n);
|
|
72
77
|
};
|
|
73
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
74
|
-
|
|
78
|
+
const isAnswerValid = (ans, { answer, A, B }) => {
|
|
79
|
+
try {
|
|
80
|
+
const solVector = new Vector("u", (B[0] - A[0]).toTree(), (B[1] - A[1]).toTree());
|
|
81
|
+
if (ans.includes("binom")) {
|
|
82
|
+
const parsed = parseAlgebraic(ans);
|
|
83
|
+
if (!isBinomialCoefficientNode(parsed))
|
|
84
|
+
return false;
|
|
85
|
+
const vec = new Vector("u", parsed.leftChild, parsed.rightChild);
|
|
86
|
+
return solVector.simplify().toCoords() === vec.toCoords();
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
const vec = vectorParser(ans);
|
|
90
|
+
if (!vec)
|
|
91
|
+
return false;
|
|
92
|
+
return solVector.simplify().toCoords() === vec.toCoords();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
return handleVEAError(err);
|
|
97
|
+
}
|
|
75
98
|
};
|
|
76
99
|
export const vectorCoordinatesFromTwoPoints = {
|
|
77
100
|
id: "vectorCoordinatesFromTwoPoints",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vectorLinearCombination.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorLinearCombination.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"vectorLinearCombination.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/geometry/vectors/vectorLinearCombination.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAgBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,YAAY,CAAC;IAChB,CAAC,EAAE,YAAY,CAAC;CACjB,CAAC;AAEF,KAAK,YAAY,GAAG;IAClB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAsNF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
|
|
@@ -4,8 +4,12 @@ import { Vector, VectorConstructor } from "../../../../math/geometry/vector.js";
|
|
|
4
4
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
5
|
import { NumberNode } from "../../../../tree/nodes/numbers/numberNode.js";
|
|
6
6
|
import { add, AddNode } from "../../../../tree/nodes/operators/addNode.js";
|
|
7
|
+
import { isBinomialCoefficientNode } from "../../../../tree/nodes/operators/binomialCoefficientNode.js";
|
|
7
8
|
import { multiply, MultiplyNode, } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
9
|
import { VariableNode } from "../../../../tree/nodes/variables/variableNode.js";
|
|
10
|
+
import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
11
|
+
import { vectorParser } from "../../../../tree/parsers/vectorParser.js";
|
|
12
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
9
13
|
const getInstruction = (identifiers) => {
|
|
10
14
|
const { a, b } = identifiers;
|
|
11
15
|
const u = new Vector("u", identifiers.u.x.toTree(), identifiers.u.y.toTree());
|
|
@@ -18,13 +22,16 @@ $$
|
|
|
18
22
|
${getAddVectorTex(getMultiplyVectorTex(a, u), getMultiplyVectorTex(b, v))}
|
|
19
23
|
$$`;
|
|
20
24
|
};
|
|
21
|
-
const
|
|
25
|
+
const getAnswerNode = (identifiers) => {
|
|
22
26
|
const { a, b } = identifiers;
|
|
23
27
|
const u = new Vector("u", identifiers.u.x.toTree(), identifiers.u.y.toTree());
|
|
24
28
|
const v = new Vector("v", identifiers.v.x.toTree(), identifiers.v.y.toTree());
|
|
25
29
|
const aUPlusBv = calculateLinearCombination(a, b, u, v);
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
return new Vector("au+bv", aUPlusBv.x, aUPlusBv.y);
|
|
31
|
+
};
|
|
32
|
+
const getAnswer = (identifiers) => {
|
|
33
|
+
const correctAnswer = getAnswerNode(identifiers);
|
|
34
|
+
return `${correctAnswer.toBinomCoords().toTex()}`;
|
|
28
35
|
};
|
|
29
36
|
const getHint = (identifiers) => {
|
|
30
37
|
return `Calcule d'abord les coordonnées de chaque vecteur de la somme. Puis, additionne ces coordonnées.`;
|
|
@@ -65,7 +72,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
65
72
|
const question = {
|
|
66
73
|
answer: getAnswer(identifiers),
|
|
67
74
|
instruction: getInstruction(identifiers),
|
|
68
|
-
keys: ["semicolon"],
|
|
75
|
+
keys: ["binom", "semicolon"],
|
|
69
76
|
answerFormat: "tex",
|
|
70
77
|
identifiers,
|
|
71
78
|
hint: getHint(identifiers),
|
|
@@ -103,14 +110,18 @@ const getPropositions = (n, { answer, a, b, u, v }) => {
|
|
|
103
110
|
addValidProp(propositions, answer);
|
|
104
111
|
const uVector = new Vector("u", new NumberNode(u.x), new NumberNode(u.y));
|
|
105
112
|
const vVector = new Vector("v", new NumberNode(v.x), new NumberNode(v.y));
|
|
106
|
-
generateProposition(a, b, uVector, vVector).forEach((value) => tryToAddWrongProp(propositions, value.
|
|
113
|
+
generateProposition(a, b, uVector, vVector).forEach((value) => tryToAddWrongProp(propositions, value.toBinomCoords().toTex()));
|
|
107
114
|
let aRandom;
|
|
108
115
|
let bRandom;
|
|
109
116
|
while (propositions.length < n) {
|
|
110
117
|
aRandom = randint(a - 2, a + 3, [a]);
|
|
111
118
|
bRandom = randint(b - 2, b + 3, [b]);
|
|
112
|
-
tryToAddWrongProp(propositions, calculateLinearCombination(aRandom, b, uVector, vVector)
|
|
113
|
-
|
|
119
|
+
tryToAddWrongProp(propositions, calculateLinearCombination(aRandom, b, uVector, vVector)
|
|
120
|
+
.toBinomCoords()
|
|
121
|
+
.toTex());
|
|
122
|
+
tryToAddWrongProp(propositions, calculateLinearCombination(a, bRandom, uVector, vVector)
|
|
123
|
+
.toBinomCoords()
|
|
124
|
+
.toTex());
|
|
114
125
|
}
|
|
115
126
|
return shuffleProps(propositions, n);
|
|
116
127
|
};
|
|
@@ -135,8 +146,27 @@ const generateProposition = (a, b, v, u) => {
|
|
|
135
146
|
const secondProposition = new Vector("au+bv", aUPlusbV.x, aUPlusbV.y);
|
|
136
147
|
return [firtPropostion, secondProposition];
|
|
137
148
|
};
|
|
138
|
-
const isAnswerValid = (ans, { answer }) => {
|
|
139
|
-
|
|
149
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
150
|
+
try {
|
|
151
|
+
const solVector = getAnswerNode(identifiers);
|
|
152
|
+
if (ans.includes("binom")) {
|
|
153
|
+
const parsed = parseAlgebraic(ans);
|
|
154
|
+
if (!isBinomialCoefficientNode(parsed))
|
|
155
|
+
return false;
|
|
156
|
+
const vec = new Vector("u", parsed.leftChild, parsed.rightChild);
|
|
157
|
+
console.log(solVector.toCoords(), vec.toCoords());
|
|
158
|
+
return solVector.simplify().toCoords() === vec.toCoords();
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
const vec = vectorParser(ans);
|
|
162
|
+
if (!vec)
|
|
163
|
+
return false;
|
|
164
|
+
return solVector.simplify().toCoords() === vec.toCoords();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
return handleVEAError(err);
|
|
169
|
+
}
|
|
140
170
|
};
|
|
141
171
|
export const vectorLinearCombination = {
|
|
142
172
|
id: "vectorLinearCombination",
|
|
@@ -14,7 +14,7 @@ const getAnswer = (identifiers) => {
|
|
|
14
14
|
};
|
|
15
15
|
const getInstruction = (identifiers) => {
|
|
16
16
|
const u = new Vector("u", identifiers.x.toTree(), identifiers.y.toTree());
|
|
17
|
-
return `
|
|
17
|
+
return `Calculer la norme du vecteur $${u.toTexWithCoords()}$.`;
|
|
18
18
|
};
|
|
19
19
|
const getHint = (identifiers) => {
|
|
20
20
|
return `La norme d'un vecteur est la racine carrée de la somme des carrés de ses coordonnées. En d'autres termes, la norme du vecteur $\\overrightarrow{u}\\begin{pmatrix}x \\\\ y \\end{pmatrix}$ est :
|
|
@@ -38,7 +38,7 @@ const getInstruction = (identifiers) => {
|
|
|
38
38
|
|
|
39
39
|

|
|
40
40
|
|
|
41
|
-
Parmi les vecteurs suivants, lequel
|
|
41
|
+
Parmi les vecteurs suivants, lequel ou lesquels sont des représentants du vecteur $\\overrightarrow{${identifiers.vec}}$ ?`;
|
|
42
42
|
};
|
|
43
43
|
const getHint = (identifiers) => {
|
|
44
44
|
return `On appelle représentant d'un vecteur $\\overrightarrow{u}$ tout vecteur qui est égal à $\\overrightarrow{u}$.`;
|
|
@@ -25,7 +25,7 @@ const getAnswer = (identifiers) => {
|
|
|
25
25
|
};
|
|
26
26
|
const getHint = (identifiers) => {
|
|
27
27
|
const { repartitions, colorAskedIndex } = identifiers;
|
|
28
|
-
return `
|
|
28
|
+
return `Toutes les boules ont la même chance d'être tirée !`;
|
|
29
29
|
};
|
|
30
30
|
const getCorrection = (identifiers) => {
|
|
31
31
|
const { repartitions, colorAskedIndex } = identifiers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cardBasicProbas.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/cardBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAAE,UAAU,EAAe,MAAM,oCAAoC,CAAC;AAI7E,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAoJF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"cardBasicProbas.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/cardBasicProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAQrC,OAAO,EAAE,UAAU,EAAe,MAAM,oCAAoC,CAAC;AAI7E,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB,CAAC;AAoJF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,CAcjD,CAAC"}
|
|
@@ -64,7 +64,7 @@ const getHint = (identifiers) => {
|
|
|
64
64
|
const { questionType, value, color } = identifiers;
|
|
65
65
|
return `Dans un jeu de cartes de $52$ cartes, il y a $13$ piques, $13$ trèfles, $13$ coeurs et $13$ carreaux.
|
|
66
66
|
|
|
67
|
-
Chaque couleur est
|
|
67
|
+
Chaque couleur est composée de l'as, du deux, du trois, etc.. jusqu'au dix, puis du valet, de la dame et du roi.`;
|
|
68
68
|
};
|
|
69
69
|
const getCorrection = (identifiers) => {
|
|
70
70
|
const { questionType, value, color } = identifiers;
|
|
@@ -139,9 +139,7 @@ export const cardBasicProbas = {
|
|
|
139
139
|
id: "cardBasicProbas",
|
|
140
140
|
connector: "=",
|
|
141
141
|
label: "Calcul de probabilité simple avec un jeu de cartes",
|
|
142
|
-
levels: ["5ème", "4ème", "3ème", "2ndPro", "2nde", "CAP"],
|
|
143
142
|
isSingleStep: true,
|
|
144
|
-
sections: ["Probabilités"],
|
|
145
143
|
generator: (nb) => getDistinctQuestions(getCardBasicProbasQuestion, nb),
|
|
146
144
|
qcmTimer: 60,
|
|
147
145
|
freeTimer: 60,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rouletteProbas.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/rouletteProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;
|
|
1
|
+
{"version":3,"file":"rouletteProbas.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/basicProbas/rouletteProbas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAwIF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,WAAW,CAkBhD,CAAC"}
|
|
@@ -27,7 +27,9 @@ const getAnswer = (identifiers) => {
|
|
|
27
27
|
};
|
|
28
28
|
const getInstruction = (identifiers) => {
|
|
29
29
|
const { a, type } = identifiers;
|
|
30
|
-
const event = type === 1
|
|
30
|
+
const event = type === 1
|
|
31
|
+
? `un multiple de $${a}$`
|
|
32
|
+
: `un numéro strictement supérieur à $${a - 1}$`;
|
|
31
33
|
return `On lance une bille sur une roulette équilibrée qui comporte tous les numéros de $0$ à $36$.
|
|
32
34
|
|
|
33
35
|
Calculer la probabilité de l'évènement "la bille s'arrête sur ${event}".`;
|
|
@@ -39,7 +41,7 @@ const getHint = (identifiers) => {
|
|
|
39
41
|
return `N'oublie pas que $0$ est un multiple de $${a}$. De plus, n'oublie pas de compter $0$ dans le total des numéros possibles.`;
|
|
40
42
|
case 2:
|
|
41
43
|
default:
|
|
42
|
-
return `Compte les nombres supérieurs à $${a}$ et inférieurs à $36$. De plus, n'oublie pas de compter $0$ dans le total des numéros possibles.`;
|
|
44
|
+
return `Compte les nombres strictement supérieurs à $${a - 1}$ et inférieurs à $36$. De plus, n'oublie pas de compter $0$ dans le total des numéros possibles.`;
|
|
43
45
|
}
|
|
44
46
|
};
|
|
45
47
|
const getCorrection = (identifiers) => {
|
|
@@ -65,7 +67,7 @@ $$
|
|
|
65
67
|
`;
|
|
66
68
|
case 2:
|
|
67
69
|
default:
|
|
68
|
-
return `Il y a $${36 - a + 1}$ numéros supérieurs à $${a}$ et inférieurs à $36$.
|
|
70
|
+
return `Il y a $${36 - a + 1}$ numéros strictement supérieurs à $${a - 1}$ et inférieurs à $36$.
|
|
69
71
|
|
|
70
72
|
Puisqu'il y a $37$ numéros possibles, et que la roulette est bien équilibrée, la probabilité recherchée est donc :
|
|
71
73
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describeEvent.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/events/describeEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,CAAC;CAC7C,CAAC;
|
|
1
|
+
{"version":3,"file":"describeEvent.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/events/describeEvent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,CAAC;CAC7C,CAAC;AAoLF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAkB/C,CAAC"}
|
|
@@ -87,16 +87,10 @@ const getInstruction = (identifiers) => {
|
|
|
87
87
|
`Décrire par une phrase l'évènement $${overlineA} ${operator} ${overlineB}$.`);
|
|
88
88
|
};
|
|
89
89
|
const getHint = ({ question }) => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
return `L'union ($\\cup$) de deux événements signifie que l'un ou l'autre des évènements (ou les deux) se réalisent.`;
|
|
95
|
-
case "intersection":
|
|
96
|
-
return `L'intersection ($\\cap$) de deux événements signifie que les deux évènements se réalisent en même temps.`;
|
|
97
|
-
default:
|
|
98
|
-
return "";
|
|
99
|
-
}
|
|
90
|
+
return `
|
|
91
|
+
- Le contraire ($\\overline{A})$ d'un évènement $A$ signifie que l'évènement ne se réalise pas.
|
|
92
|
+
- L'union ($A\\cup B$) de deux événements $A$ et $B$ signifie que l'un ou l'autre des évènements (ou les deux) se réalisent.
|
|
93
|
+
- L'intersection ($A\\cap B$) de deux événements $A$ et $B$ signifie que les deux évènements se réalisent en même temps.`;
|
|
100
94
|
};
|
|
101
95
|
const getCorrection = (identifiers) => {
|
|
102
96
|
const { eventA, eventB, question } = identifiers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventNotation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/events/eventNotation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,CAAC;CAC7C,CAAC;
|
|
1
|
+
{"version":3,"file":"eventNotation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/events/eventNotation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,QAAQ,EAAE,OAAO,GAAG,cAAc,GAAG,MAAM,CAAC;CAC7C,CAAC;AAsJF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAkB/C,CAAC"}
|
|
@@ -52,16 +52,10 @@ const getInstruction = (identifiers) => {
|
|
|
52
52
|
return instruction + `Comment se note l'événement "${sentence}" ?`;
|
|
53
53
|
};
|
|
54
54
|
const getHint = ({ question }) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
return `L'union ($\\cup$) de deux événements signifie que l'un ou l'autre des évènements (ou les deux) se réalisent.`;
|
|
60
|
-
case "intersection":
|
|
61
|
-
return `L'intersection ($\\cap$) de deux événements signifie que les deux évènements se réalisent en même temps.`;
|
|
62
|
-
default:
|
|
63
|
-
return "";
|
|
64
|
-
}
|
|
55
|
+
return `
|
|
56
|
+
- Le contraire ($\\overline{A})$ d'un évènement $A$ signifie que l'évènement ne se réalise pas.
|
|
57
|
+
- L'union ($A\\cup B$) de deux événements $A$ et $B$ signifie que l'un ou l'autre des évènements (ou les deux) se réalisent.
|
|
58
|
+
- L'intersection ($A\\cap B$) de deux événements $A$ et $B$ signifie que les deux évènements se réalisent en même temps.`;
|
|
65
59
|
};
|
|
66
60
|
const getCorrection = (identifiers) => {
|
|
67
61
|
const { eventA, eventB, question } = identifiers;
|
|
@@ -90,7 +90,7 @@ const getHint = (identifiers) => {
|
|
|
90
90
|
const { questionType, value, color } = identifiers;
|
|
91
91
|
return `Dans un jeu de cartes de $52$ cartes, il y a des cartes de pique, des cartes de trèfle, des cartes de coeur et des cartes de carreau. Les couleurs pique et trèfle sont des couleurs noires, et les couleurs carreau et coeur sont des couleurs rouges.
|
|
92
92
|
|
|
93
|
-
Chaque couleur est
|
|
93
|
+
Chaque couleur est composée de l'as, du deux, du trois, etc.. jusqu'au dix, puis du valet, de la dame et du roi.`;
|
|
94
94
|
};
|
|
95
95
|
const getCorrection = (identifiers) => {
|
|
96
96
|
const { questionType, value, color } = identifiers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAiUF,KAAK,OAAO,GAAG;IAEb,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAuBF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAgBlE,CAAC"}
|
|
@@ -149,7 +149,7 @@ const getCorrection = (identifiers) => {
|
|
|
149
149
|
: event === "P(\\overline A)"
|
|
150
150
|
? "\\overline{A}"
|
|
151
151
|
: "\\overline{B}";
|
|
152
|
-
return `On lit le total de la ${singleEvnmt.includes("A") ? "ligne" : "colonne"} $${singleEvnmt}$ : c'est $${probaFrac[0]}$. La probabilité $${event}$ vaut donc :
|
|
152
|
+
return `On lit le total de la ${singleEvnmt.includes("A") ? "ligne" : "colonne"} $${singleEvnmt}$ : c'est $${probaFrac[0]}$. Le total des issues se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$. La probabilité $${event}$ vaut donc :
|
|
153
153
|
|
|
154
154
|
$$
|
|
155
155
|
${event} = ${frac(probaFrac[0], probaFrac[1]).toSimplificationTex()}
|
|
@@ -166,7 +166,9 @@ $$`;
|
|
|
166
166
|
const columnTotal = unionEvements[1] === "B" ? bTotal : bBarreTotal;
|
|
167
167
|
return `On additionne les totaux de la ligne $${unionEvements[0]}$ et de la colonne $${unionEvements[1]}$ : cela donne $${rowTotal} + ${columnTotal} = ${rowTotal + columnTotal}$. On doit ensuite soustraire la case à l'intersection de la ligne $${unionEvements[0]}$ et de la colonne $${unionEvements[1]}$, car on l'a compté deux fois dans les totaux. Cela donne $${rowTotal + columnTotal} - ${rowTotal + columnTotal - probaFrac[0]} = ${probaFrac[0]}
|
|
168
168
|
$.
|
|
169
|
-
|
|
169
|
+
|
|
170
|
+
Enfin, le total des issues se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$.
|
|
171
|
+
|
|
170
172
|
La probabilité $${event}$ vaut donc :
|
|
171
173
|
|
|
172
174
|
$$
|
|
@@ -180,7 +182,7 @@ $$`;
|
|
|
180
182
|
: event === "P(\\overline A \\cup B)"
|
|
181
183
|
? ["\\overline{A}", "B"]
|
|
182
184
|
: ["\\overline{A}", "\\overline{B}"];
|
|
183
|
-
return `On lit la case à l'intersection de la colonne $${interEvemnts[1]}$ et de la ligne $${interEvemnts[0]}$ : c'est $${probaFrac[0]}$. La probabilité $${event}$ vaut donc :
|
|
185
|
+
return `On lit la case à l'intersection de la colonne $${interEvemnts[1]}$ et de la ligne $${interEvemnts[0]}$ : c'est $${probaFrac[0]}$. Le total des issues se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$. La probabilité $${event}$ vaut donc :
|
|
184
186
|
|
|
185
187
|
$$
|
|
186
188
|
${event} = ${frac(probaFrac[0], probaFrac[1]).toSimplificationTex()}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probaFromTableWithContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableWithContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AA6JF,KAAK,OAAO,GAAG,EAEd,CAAC;
|
|
1
|
+
{"version":3,"file":"probaFromTableWithContext.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/probaStat/probaFromTableWithContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AA6JF,KAAK,OAAO,GAAG,EAEd,CAAC;AAyIF,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBpE,CAAC"}
|
|
@@ -174,7 +174,11 @@ const getCorrection = (identifiers) => {
|
|
|
174
174
|
? "Porte des lunettes"
|
|
175
175
|
: "Ne porte pas de lunettes";
|
|
176
176
|
const isLine = event === "une fille" || event === "un garçon";
|
|
177
|
-
return `On lit le total de la ${isLine ? "ligne" : "colonne"} "${singleEvnmt}" : c'est $${probaFrac[0]}$.
|
|
177
|
+
return `On lit le total de la ${isLine ? "ligne" : "colonne"} "${singleEvnmt}" : c'est $${probaFrac[0]}$.
|
|
178
|
+
|
|
179
|
+
Le total des élèves se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$.
|
|
180
|
+
|
|
181
|
+
La probabilité recherchée vaut donc :
|
|
178
182
|
|
|
179
183
|
$$
|
|
180
184
|
${frac(probaFrac[0], probaFrac[1]).toSimplificationTex()}
|
|
@@ -195,6 +199,8 @@ $$`;
|
|
|
195
199
|
On doit ensuite soustraire la case à l'intersection de la ligne "${unionEvements[0]}" et de la colonne "${unionEvements[1]}", car on l'a compté deux fois dans les totaux. Cela donne $${rowTotal + columnTotal} - ${rowTotal + columnTotal - probaFrac[0]} = ${probaFrac[0]}
|
|
196
200
|
$.
|
|
197
201
|
|
|
202
|
+
Le total des élèves se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$.
|
|
203
|
+
|
|
198
204
|
La probabilité de tomber sur ${event} vaut donc :
|
|
199
205
|
|
|
200
206
|
$$
|
|
@@ -207,7 +213,9 @@ $$`;
|
|
|
207
213
|
.replace("une", "")
|
|
208
214
|
.replace("un", "")
|
|
209
215
|
.trim()}s" : c'est $${probaFrac[0]}$.
|
|
210
|
-
|
|
216
|
+
|
|
217
|
+
Le total des élèves se lit à l'intersection de la ligne "Total" et de la colonne "Total" : c'est $${probaFrac[1]}$.
|
|
218
|
+
|
|
211
219
|
La probabilité de tomber sur ${event} vaut donc :
|
|
212
220
|
|
|
213
221
|
$$
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"averageLinearity.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageLinearity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"averageLinearity.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/averageLinearity.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAcrC,KAAK,SAAS,GAAG,gBAAgB,GAAG,UAAU,GAAG,cAAc,GAAG,UAAU,CAAC;AAC7E,KAAK,WAAW,GACZ;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAmON,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAmBlD,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
4
|
+
import { round } from "../../../../math/utils/round.js";
|
|
4
5
|
import { add } from "../../../../tree/nodes/operators/addNode.js";
|
|
5
|
-
import { divide } from "../../../../tree/nodes/operators/divideNode.js";
|
|
6
6
|
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
7
7
|
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
8
8
|
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
@@ -70,7 +70,7 @@ const getAnswer = (identifiers) => {
|
|
|
70
70
|
return multiply(moyenne, factor).simplify().toTex();
|
|
71
71
|
case "division":
|
|
72
72
|
default:
|
|
73
|
-
return
|
|
73
|
+
return round(moyenne / factor, 4).frenchify();
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
const getInstruction = (identifiers) => {
|
|
@@ -134,7 +134,7 @@ const getCorrection = (identifiers) => {
|
|
|
134
134
|
break;
|
|
135
135
|
case "division":
|
|
136
136
|
default:
|
|
137
|
-
latexFormula = `${
|
|
137
|
+
latexFormula = `${frac(moyenne, factor).toTex()} = ${round(moyenne / factor, 4).frenchify()}`;
|
|
138
138
|
break;
|
|
139
139
|
}
|
|
140
140
|
return `Il y a eu une ${operator} de $${factor.frenchify()}$ sur les valeurs de la série, donc la moyenne devient :
|
|
@@ -146,7 +146,7 @@ $$`;
|
|
|
146
146
|
const isAnswerValid = (ans, { answer }) => {
|
|
147
147
|
try {
|
|
148
148
|
const parsed = parseAlgebraic(ans);
|
|
149
|
-
return parsed.simplify().toTex() === answer;
|
|
149
|
+
return parsed.simplify({ fractionsToDecimal: true }).toTex() === answer;
|
|
150
150
|
}
|
|
151
151
|
catch (err) {
|
|
152
152
|
return handleVEAError(err);
|
|
@@ -214,4 +214,5 @@ export const averageLinearity = {
|
|
|
214
214
|
getAnswer,
|
|
215
215
|
getQuestionFromIdentifiers,
|
|
216
216
|
hasHintAndCorrection: true,
|
|
217
|
+
shouldHaveCalculator: true,
|
|
217
218
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareSeriesDispersion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/compareSeriesDispersion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"compareSeriesDispersion.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/compareSeriesDispersion.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AA+HF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAqBzD,CAAC"}
|
|
@@ -1,42 +1,23 @@
|
|
|
1
1
|
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
3
|
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
4
5
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
5
6
|
import { round } from "../../../../math/utils/round.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
7
|
+
import { gaussianWithNoise } from "../../../../math/utils/stats/gaussianWithNoise.js";
|
|
8
|
+
import { standardDeviationWithEffectifs, } from "../../../../math/utils/stats/standardDeviation.js";
|
|
9
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
10
|
+
import { averageWithEffectifs } from "../../../../utils/average.js";
|
|
8
11
|
const getPropositions = (n, { answer }) => {
|
|
9
12
|
const propositions = [];
|
|
10
13
|
addValidProp(propositions, answer, "raw");
|
|
11
14
|
tryToAddWrongProp(propositions, "Série A", "raw");
|
|
12
15
|
tryToAddWrongProp(propositions, "Série B", "raw");
|
|
13
|
-
tryToAddWrongProp(propositions, "On ne peut pas savoir", "raw");
|
|
14
16
|
return shuffleProps(propositions, n);
|
|
15
17
|
};
|
|
16
|
-
function computeStats(serie, labels, shouldRound = false) {
|
|
17
|
-
const total = serie.reduce((a, b) => a + b, 0);
|
|
18
|
-
const rawMean = serie.reduce((acc, e, i) => acc + e * labels[i], 0) / total;
|
|
19
|
-
const rawVariance = serie.reduce((acc, e, i) => acc + e * Math.pow(labels[i] - rawMean, 2), 0) /
|
|
20
|
-
total;
|
|
21
|
-
const rawEcartType = Math.sqrt(rawVariance);
|
|
22
|
-
if (shouldRound) {
|
|
23
|
-
return {
|
|
24
|
-
total,
|
|
25
|
-
mean: round(rawMean, 2),
|
|
26
|
-
variance: round(rawVariance, 2),
|
|
27
|
-
ecartType: round(rawEcartType, 2),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
total,
|
|
32
|
-
mean: rawMean,
|
|
33
|
-
variance: rawVariance,
|
|
34
|
-
ecartType: rawEcartType,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
18
|
const getAnswer = ({ serie1, serie2, labels }) => {
|
|
38
|
-
const std1 =
|
|
39
|
-
const std2 =
|
|
19
|
+
const std1 = standardDeviationWithEffectifs(labels, serie1);
|
|
20
|
+
const std2 = standardDeviationWithEffectifs(labels, serie2);
|
|
40
21
|
return std1 > std2 ? "Série A" : "Série B";
|
|
41
22
|
};
|
|
42
23
|
const getInstruction = () => {
|
|
@@ -47,8 +28,8 @@ const getHint = () => {
|
|
|
47
28
|
};
|
|
48
29
|
const getCorrection = (identifiers) => {
|
|
49
30
|
const { serie1, serie2, labels } = identifiers;
|
|
50
|
-
const average1 =
|
|
51
|
-
const average2 =
|
|
31
|
+
const average1 = averageWithEffectifs(labels, serie1);
|
|
32
|
+
const average2 = averageWithEffectifs(labels, serie2);
|
|
52
33
|
const result = getAnswer(identifiers);
|
|
53
34
|
const otherSeries = result === "Série A" ? "série B" : "série A";
|
|
54
35
|
return `On observe que les valeurs de la ${otherSeries} sont plus concentrées autour de la moyenne de cette série (qui vaut environ $${round(result === "Série A" ? average2 : average1, 0).frenchify()}$).
|
|
@@ -96,12 +77,13 @@ const isAnswerValid = (ans, { answer }) => {
|
|
|
96
77
|
const getCompareSeriesDispersionQuestion = () => {
|
|
97
78
|
const labels = [10, 20, 30, 40];
|
|
98
79
|
const baseValue = randint(10, 25);
|
|
99
|
-
const
|
|
100
|
-
const
|
|
80
|
+
const firstIsAnswer = coinFlip();
|
|
81
|
+
const wrong = labels.map(() => randint(baseValue - 3, baseValue + 3));
|
|
82
|
+
const right = gaussianWithNoise(4, randfloat(0.1, 0.9).toTree()).map((e) => Math.min(e * 60, 30));
|
|
101
83
|
const identifiers = {
|
|
102
84
|
labels,
|
|
103
|
-
serie1,
|
|
104
|
-
serie2,
|
|
85
|
+
serie1: firstIsAnswer ? right : wrong,
|
|
86
|
+
serie2: firstIsAnswer ? wrong : right,
|
|
105
87
|
};
|
|
106
88
|
return getQuestionFromIdentifiers(identifiers);
|
|
107
89
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interquartilesList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/interquartilesList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAyFF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"interquartilesList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/interquartilesList.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAyFF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,WAAW,CAepD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interquartilesTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/interquartilesTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAqHF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"interquartilesTable.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/interquartilesTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAqHF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,WAAW,CAerD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quartiles.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/quartiles.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,QAAQ,EAaT,MAAM,sBAAsB,CAAC;AAG9B,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA6HF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"quartiles.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/quartiles.ts"],"names":[],"mappings":"AAYA,OAAO,EACL,QAAQ,EAaT,MAAM,sBAAsB,CAAC;AAG9B,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AA6HF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAc3C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quartilesList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/quartilesList.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,QAAQ,EAcT,MAAM,sBAAsB,CAAC;AAG9B,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAgGF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"quartilesList.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats1var/quartilesList.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,QAAQ,EAcT,MAAM,sBAAsB,CAAC;AAG9B,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAgGF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,WAAW,CAc/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fineAdjustementExercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats2var/fineAdjustementExercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAM5C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,sBAAsB,EAAE,sBAAsB,CAAC;CAChD,CAAC;
|
|
1
|
+
{"version":3,"file":"fineAdjustementExercise.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats2var/fineAdjustementExercise.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAGL,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAM5C,KAAK,WAAW,GAAG;IACjB,WAAW,EAAE,OAAO,CAAC;IACrB,sBAAsB,EAAE,sBAAsB,CAAC;CAChD,CAAC;AA0IF,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,WAAW,CAczD,CAAC"}
|
|
@@ -83,7 +83,7 @@ const getPropositions = (n, { answer, isJustified }) => {
|
|
|
83
83
|
let randomNb;
|
|
84
84
|
while (propositions.length < n) {
|
|
85
85
|
randomNb = randfloat(0, 0.5, 2);
|
|
86
|
-
tryToAddWrongProp(propositions, `Un ajustement affine est justifié. Le coefficient de détermination vaut ${randomNb}
|
|
86
|
+
tryToAddWrongProp(propositions, `Un ajustement affine est justifié. Le coefficient de détermination vaut ${randomNb}`, "raw");
|
|
87
87
|
}
|
|
88
88
|
return shuffleProps(propositions, n);
|
|
89
89
|
};
|
|
@@ -100,7 +100,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
100
100
|
};
|
|
101
101
|
export const variableType = {
|
|
102
102
|
id: "variableType",
|
|
103
|
-
label: "Déterminer le type d
|
|
103
|
+
label: "Déterminer le type d'une variable en Python",
|
|
104
104
|
isSingleStep: true,
|
|
105
105
|
generator: (nb, opts) => getDistinctQuestions(() => getVariableTypeQuestion(opts), nb),
|
|
106
106
|
qcmTimer: 60,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"whileLoop.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/whileLoop.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"whileLoop.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/python/whileLoop.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAIrC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAiIF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,WAAW,CAY3C,CAAC"}
|
|
@@ -11,7 +11,7 @@ def boucle(x):
|
|
|
11
11
|
return x
|
|
12
12
|
\`\`\`
|
|
13
13
|
|
|
14
|
-
Si l'on saisit la commande boucle(
|
|
14
|
+
Si l'on saisit la commande \`boucle(${inputValue})\`, combien de fois la boucle s'exécute-t-elle ?`;
|
|
15
15
|
};
|
|
16
16
|
const getAnswer = ({ inputValue, threshold }) => {
|
|
17
17
|
let x = inputValue;
|
|
@@ -53,7 +53,7 @@ const getQuestionFromIdentifiers = (identifiers) => ({
|
|
|
53
53
|
hint: getHint(identifiers),
|
|
54
54
|
correction: getCorrection(identifiers),
|
|
55
55
|
keys: [],
|
|
56
|
-
answerFormat: "
|
|
56
|
+
answerFormat: "tex",
|
|
57
57
|
identifiers,
|
|
58
58
|
});
|
|
59
59
|
const getPyWhileLoopCountQuestion = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"samplingFrequency.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sampling/samplingFrequency.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;
|
|
1
|
+
{"version":3,"file":"samplingFrequency.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/sampling/samplingFrequency.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAsGF,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,WAAW,CAoBnD,CAAC"}
|
|
@@ -25,9 +25,7 @@ const getInstruction = (identifiers) => {
|
|
|
25
25
|
return `Ce graphique donne les fréquences de $${length}$ échantillons d'une expérience aléatoire. Estimer la probabilité de l'évènement $A$.`;
|
|
26
26
|
};
|
|
27
27
|
const getHint = (identifiers) => {
|
|
28
|
-
return `
|
|
29
|
-
|
|
30
|
-
Tu peux estimer cette probabilité en déterminant graphiquement la moyenne des fréquences des échantillons.`;
|
|
28
|
+
return `Tu peux estimer la probabilité de $A$ en déterminant graphiquement la moyenne des fréquences des échantillons.`;
|
|
31
29
|
};
|
|
32
30
|
const getCorrection = (identifiers) => {
|
|
33
31
|
const { samples } = identifiers;
|
|
@@ -5,9 +5,9 @@ import { randint } from "../../../math/utils/random/randint.js";
|
|
|
5
5
|
const getInstruction = (identifiers) => {
|
|
6
6
|
const { coeffs } = identifiers;
|
|
7
7
|
const u = new Polynomial(coeffs, "n");
|
|
8
|
-
return `Soit $u$ la suite définie par $u_n = ${u
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
return `Soit $u$ la suite définie par $u_n = ${u.toTree().toTex()}$.
|
|
9
|
+
|
|
10
|
+
Quel est le sens de variations de $u$ ?`;
|
|
11
11
|
};
|
|
12
12
|
const getAnswer = (identifiers) => {
|
|
13
13
|
const { coeffs } = identifiers;
|
|
@@ -80,7 +80,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
|
|
|
80
80
|
instruction: getInstruction(identifiers),
|
|
81
81
|
ggbOptions: getGGBOptions(identifiers),
|
|
82
82
|
keys: [],
|
|
83
|
-
answerFormat: "
|
|
83
|
+
answerFormat: "tex",
|
|
84
84
|
identifiers,
|
|
85
85
|
hint: getHint(identifiers),
|
|
86
86
|
correction: getCorrection(identifiers),
|
|
@@ -57,7 +57,7 @@ La tension $U_{DC}$ aux bornes de la diode est $${uDC}$ $V$.
|
|
|
57
57
|
|
|
58
58
|
La tension $U_{ED}$ aux bornes du conducteur ohmique est $${uED} \\ \\textrm{V}$.
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
Calculer la tension de la pile $U_{AB}$.
|
|
61
61
|
|
|
62
62
|
${schema}`;
|
|
63
63
|
case "UED":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binomial.d.ts","sourceRoot":"","sources":["../../../src/math/probability/binomial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAKlE,qBAAa,QAAQ;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,aAAa,CAAC;gBACL,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa;
|
|
1
|
+
{"version":3,"file":"binomial.d.ts","sourceRoot":"","sources":["../../../src/math/probability/binomial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAKlE,qBAAa,QAAQ;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,aAAa,CAAC;gBACL,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa;IAoBvC,MAAM,CAAC,CAAC,EAAE,MAAM;IAQhB,GAAG,CAAC,CAAC,EAAE,MAAM;IAWb,GAAG,CAAC,CAAC,EAAE,MAAM;IAWb,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;CAW1B"}
|
|
@@ -7,6 +7,26 @@ export class Binomial {
|
|
|
7
7
|
this.n = n;
|
|
8
8
|
this.p = p;
|
|
9
9
|
}
|
|
10
|
+
// //ex sample([1,2,3]) renvoit un échantillon [v_i] où v_i = nb de fois où on a obtenu i succès avec B(n,p)
|
|
11
|
+
// sample(values: number[]) {
|
|
12
|
+
// const proba = this.p.evaluate();
|
|
13
|
+
// const res = [];
|
|
14
|
+
// for (const v of values) {
|
|
15
|
+
// let count = 0;
|
|
16
|
+
// for (let i = 0; i < this.n; i++) {
|
|
17
|
+
// const success = Math.random() < proba;
|
|
18
|
+
// success && count++;
|
|
19
|
+
// }
|
|
20
|
+
// v === count && res.push(count);
|
|
21
|
+
// }
|
|
22
|
+
// return res;
|
|
23
|
+
// }
|
|
24
|
+
equals(k) {
|
|
25
|
+
const proba = this.p.evaluate();
|
|
26
|
+
return (combinations(k, this.n) *
|
|
27
|
+
Math.pow(proba, k) *
|
|
28
|
+
Math.pow(1 - proba, this.n - k));
|
|
29
|
+
}
|
|
10
30
|
sup(k) {
|
|
11
31
|
const proba = this.p.evaluate();
|
|
12
32
|
return sum(k, this.n, (i) => combinations(i, this.n) *
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gaussianWithNoise.d.ts","sourceRoot":"","sources":["../../../../src/math/utils/stats/gaussianWithNoise.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,eAAO,MAAM,iBAAiB,MAAO,MAAM,KAAK,aAAa,aAO5D,CAAC"}
|
package/lib/playground.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
export declare const playground: () => void;
|
|
2
|
+
/***
|
|
3
|
+
*
|
|
4
|
+
* !!TODO
|
|
5
|
+
* - j'ai l'impression que opposite(3).simplify() et numberNode(-3) ne passent pas "equals", j'ai du mal à comprendre pourquoi alors que opposite(3) se simplifie bien en numberNode
|
|
6
|
+
*/
|
|
2
7
|
//# sourceMappingURL=playground.d.ts.map
|
package/lib/playground.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAwCA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"playground.d.ts","sourceRoot":"","sources":["../src/playground.ts"],"names":[],"mappings":"AAwCA,eAAO,MAAM,UAAU,YAEtB,CAAC;AAEF;;;;GAIG"}
|
package/lib/playground.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
export const playground = () => {
|
|
1
|
+
export const playground = () => {
|
|
2
|
+
// console.log(opposite(3).simplify());
|
|
3
|
+
};
|
|
4
|
+
/***
|
|
5
|
+
*
|
|
6
|
+
* !!TODO
|
|
7
|
+
* - j'ai l'impression que opposite(3).simplify() et numberNode(-3) ne passent pas "equals", j'ai du mal à comprendre pourquoi alors que opposite(3) se simplifie bien en numberNode
|
|
8
|
+
*/
|