math-exercises 3.0.175 → 3.0.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/exercise.d.ts +9 -0
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +33 -1
- package/lib/exercises/math/probaStat/index.d.ts +1 -1
- package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/index.js +1 -2
- package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.js +0 -1
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts +0 -7
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +154 -125
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts +2 -2
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts +2 -2
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts +2 -2
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts +2 -2
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts +2 -2
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts +2 -2
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts +2 -2
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts +3 -3
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +1 -1
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts +6 -0
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +199 -68
- package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.js +12 -12
- package/lib/exercises/math/probaStat/trees/index.d.ts +3 -1
- package/lib/exercises/math/probaStat/trees/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/trees/index.js +5 -1
- package/lib/exercises/math/probaStat/trees/probaTreeSituationTotalProbaFormula.d.ts +2 -0
- package/lib/exercises/math/probaStat/trees/probaTreeSituationTotalProbaFormula.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/trees/probaTreeSituationTotalProbaFormula.js +80 -0
- package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts +60 -0
- package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/trees/probaTreeSituations.js +344 -108
- package/lib/exercises/math/probaStat/trees/treeInInstruction.js +10 -10
- package/lib/exercises/math/sequences/limits/index.d.ts +1 -1
- package/lib/exercises/math/sequences/limits/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/limits/index.js +2 -1
- package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.js +2 -2
- package/lib/exercises/vea/percentVEA.d.ts +2 -0
- package/lib/exercises/vea/percentVEA.d.ts.map +1 -0
- package/lib/exercises/vea/percentVEA.js +1 -0
- package/lib/index.d.ts +31 -19
- package/lib/index.d.ts.map +1 -1
- package/lib/server.js +22 -0
- package/lib/tests/exoTest.d.ts.map +1 -1
- package/lib/tests/exoTest.js +2 -0
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +14 -2
- package/lib/types/keyIds.d.ts +1 -1
- package/lib/types/keyIds.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RandomVariableSituationParams } from "./utils/randomVariableSituations.js";
|
|
3
3
|
type Identifiers = {
|
|
4
|
-
params:
|
|
4
|
+
params: RandomVariableSituationParams;
|
|
5
5
|
};
|
|
6
6
|
export declare const randomVariableSituationValues: Exercise<Identifiers>;
|
|
7
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randomVariableSituationValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/randomVariable/randomVariableSituationValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"randomVariableSituationValues.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/randomVariable/randomVariableSituationValues.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,OAAO,EAGL,6BAA6B,EAC9B,MAAM,qCAAqC,CAAC;AAE7C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,6BAA6B,CAAC;CACvC,CAAC;AAuPF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,CAqB/D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RandomVariableSituationParams } from "./utils/randomVariableSituations.js";
|
|
3
3
|
type Identifiers = {
|
|
4
|
-
params:
|
|
4
|
+
params: RandomVariableSituationParams;
|
|
5
5
|
};
|
|
6
6
|
export declare const randomVariableSituationVariance: Exercise<Identifiers>;
|
|
7
7
|
export {};
|
package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randomVariableSituationVariance.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,
|
|
1
|
+
{"version":3,"file":"randomVariableSituationVariance.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAMrC,OAAO,EAGL,6BAA6B,EAC9B,MAAM,qCAAqC,CAAC;AAE7C,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,6BAA6B,CAAC;CACvC,CAAC;AA4GF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAqBjE,CAAC"}
|
|
@@ -23,7 +23,7 @@ type CardsParams = {
|
|
|
23
23
|
gFigure: number;
|
|
24
24
|
gOther: number;
|
|
25
25
|
};
|
|
26
|
-
export type
|
|
26
|
+
export type RandomVariableSituationParams = (UrneParams & {
|
|
27
27
|
id: "urne";
|
|
28
28
|
}) | (CoinParams & {
|
|
29
29
|
id: "coin";
|
|
@@ -32,10 +32,10 @@ export type SituationParams = (UrneParams & {
|
|
|
32
32
|
}) | (CardsParams & {
|
|
33
33
|
id: "cards";
|
|
34
34
|
});
|
|
35
|
-
export declare const getRandomVariableSituation: (params:
|
|
35
|
+
export declare const getRandomVariableSituation: (params: RandomVariableSituationParams) => {
|
|
36
36
|
getContext: () => string;
|
|
37
37
|
getVA: () => RandomVariable;
|
|
38
38
|
};
|
|
39
|
-
export declare const buildRandomVariableSituation: () =>
|
|
39
|
+
export declare const buildRandomVariableSituation: () => RandomVariableSituationParams;
|
|
40
40
|
export {};
|
|
41
41
|
//# sourceMappingURL=randomVariableSituations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"randomVariableSituations.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAU1E,KAAK,UAAU,GAAG;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAqDF,KAAK,UAAU,GAAG;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmEF,KAAK,kBAAkB,GAAG;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAkCF,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA4BF,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"randomVariableSituations.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAU1E,KAAK,UAAU,GAAG;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAqDF,KAAK,UAAU,GAAG;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAmEF,KAAK,kBAAkB,GAAG;IACxB,CAAC,EAAE,MAAM,CAAC;IACV,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAkCF,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA4BF,MAAM,MAAM,6BAA6B,GACrC,CAAC,UAAU,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7B,CAAC,UAAU,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7B,CAAC,kBAAkB,GAAG;IAAE,EAAE,EAAE,cAAc,CAAA;CAAE,CAAC,GAC7C,CAAC,WAAW,GAAG;IAAE,EAAE,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AAIpC,eAAO,MAAM,0BAA0B,GACrC,QAAQ,6BAA6B;;;CActC,CAAC;AAEF,eAAO,MAAM,4BAA4B,QACnC,6BAkBH,CAAC"}
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { ProbaTreeSituationParams } from "./probaTreeSituations.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
params: ProbaTreeSituationParams;
|
|
5
|
+
};
|
|
6
|
+
export declare const buildTreeFromSituation: Exercise<Identifiers>;
|
|
1
7
|
export {};
|
|
2
8
|
//# sourceMappingURL=buildTreeFromSituation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTreeFromSituation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/buildTreeFromSituation.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"buildTreeFromSituation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/buildTreeFromSituation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAOrC,OAAO,EAGL,wBAAwB,EACzB,MAAM,0BAA0B,CAAC;AAElC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,wBAAwB,CAAC;CAClC,CAAC;AAoMF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAiBxD,CAAC"}
|
|
@@ -1,68 +1,199 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
1
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
2
|
+
import { treeTableVEA } from "../../../../exercises/vea/treeTableVEA.js";
|
|
3
|
+
import { reifyAlgebraic } from "../../../../tree/nodes/nodeConstructor.js";
|
|
4
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
5
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
6
|
+
import { buildProbaTreeSituation, getProbaTreeSituation, } from "./probaTreeSituations.js";
|
|
7
|
+
const getAnswerTreeTable = (identifiers) => {
|
|
8
|
+
const { params } = identifiers;
|
|
9
|
+
const situation = getProbaTreeSituation(params);
|
|
10
|
+
return situation.tree;
|
|
11
|
+
};
|
|
12
|
+
const getInstruction = (identifiers) => {
|
|
13
|
+
const { params } = identifiers;
|
|
14
|
+
const situation = getProbaTreeSituation(params);
|
|
15
|
+
return (situation.context +
|
|
16
|
+
`
|
|
17
|
+
|
|
18
|
+
Modéliser cette situation par un arbre pondéré.`);
|
|
19
|
+
};
|
|
20
|
+
const getHint = () => {
|
|
21
|
+
return `Utilise les données de l'énoncé, ainsi que le fait que la somme des probabilités des branches issues d'un même noeud est égale à $1$.`;
|
|
22
|
+
};
|
|
23
|
+
const getCorrection = (identifiers) => {
|
|
24
|
+
const { params } = identifiers;
|
|
25
|
+
const situation = getProbaTreeSituation(params);
|
|
26
|
+
let mainEventProba;
|
|
27
|
+
let firstCondProba;
|
|
28
|
+
let secondCondProba;
|
|
29
|
+
const mainEvent = situation.mainEvent;
|
|
30
|
+
const secondEvent = situation.secondEvent;
|
|
31
|
+
switch (params.id) {
|
|
32
|
+
case "virus":
|
|
33
|
+
{
|
|
34
|
+
const { pContamineIds, pNegSainIds, pPosContamineIds } = params;
|
|
35
|
+
const pContamine = reifyAlgebraic(pContamineIds);
|
|
36
|
+
const pPosContamine = reifyAlgebraic(pPosContamineIds);
|
|
37
|
+
const pNegSain = reifyAlgebraic(pNegSainIds);
|
|
38
|
+
return `D'après l'énoncé, on a :
|
|
39
|
+
|
|
40
|
+
$$
|
|
41
|
+
P(C) = ${pContamine.toTex()}\\%
|
|
42
|
+
$$
|
|
43
|
+
|
|
44
|
+
$$
|
|
45
|
+
P_C(T) = ${pPosContamine.toTex()}\\%
|
|
46
|
+
$$
|
|
47
|
+
|
|
48
|
+
$$
|
|
49
|
+
P_{\\overline{C}}\\left(\\overline{T}\\right) = ${pNegSain.toTex()}\\%
|
|
50
|
+
$$
|
|
51
|
+
|
|
52
|
+
On en déduit les probabilités manquantes :
|
|
53
|
+
|
|
54
|
+
$$
|
|
55
|
+
P\\left(\\overline{C}\\right) = ${substract(100, pContamine)
|
|
56
|
+
.simplify()
|
|
57
|
+
.toTex()}\\%
|
|
58
|
+
$$
|
|
59
|
+
|
|
60
|
+
$$
|
|
61
|
+
P_{C}(\\overline{T}) = ${substract(100, pPosContamine).simplify().toTex()}\\%
|
|
62
|
+
$$
|
|
63
|
+
|
|
64
|
+
$$
|
|
65
|
+
P_{\\overline{C}}(T) = ${substract(100, pNegSain).simplify().toTex()}\\%
|
|
66
|
+
$$
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
|
+
case "car":
|
|
71
|
+
{
|
|
72
|
+
const { pAutreSinistreIds, pJeuneIds, pJeuneSinistreIds } = params;
|
|
73
|
+
secondCondProba = reifyAlgebraic(pAutreSinistreIds);
|
|
74
|
+
mainEventProba = reifyAlgebraic(pJeuneIds);
|
|
75
|
+
firstCondProba = reifyAlgebraic(pJeuneSinistreIds);
|
|
76
|
+
}
|
|
77
|
+
break;
|
|
78
|
+
case "dragee":
|
|
79
|
+
mainEventProba = reifyAlgebraic(params.pAmandeIds);
|
|
80
|
+
firstCondProba = reifyAlgebraic(params.pBlancheAmandeIds);
|
|
81
|
+
secondCondProba = reifyAlgebraic(params.pBlancheChocolatIds);
|
|
82
|
+
break;
|
|
83
|
+
case "lycee":
|
|
84
|
+
mainEventProba = reifyAlgebraic(params.pFIds);
|
|
85
|
+
firstCondProba = reifyAlgebraic(params.pFMathsIds);
|
|
86
|
+
secondCondProba = reifyAlgebraic(params.pGMathsIds);
|
|
87
|
+
break;
|
|
88
|
+
case "match":
|
|
89
|
+
mainEventProba = reifyAlgebraic(params.pDomicileIds);
|
|
90
|
+
firstCondProba = reifyAlgebraic(params.pVDomicileIds);
|
|
91
|
+
secondCondProba = reifyAlgebraic(params.pVExterieurIds);
|
|
92
|
+
break;
|
|
93
|
+
case "usine":
|
|
94
|
+
mainEventProba = reifyAlgebraic(params.pAIds);
|
|
95
|
+
firstCondProba = reifyAlgebraic(params.pDefAIds);
|
|
96
|
+
secondCondProba = reifyAlgebraic(params.pDefBIds);
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
return `D'après l'énoncé, on a :
|
|
100
|
+
|
|
101
|
+
$$
|
|
102
|
+
P(${situation.mainEvent}) = ${mainEventProba.toTex()}\\%
|
|
103
|
+
$$
|
|
104
|
+
|
|
105
|
+
$$
|
|
106
|
+
P_{${mainEvent}}(${secondEvent}) = ${firstCondProba.toTex()}\\%
|
|
107
|
+
$$
|
|
108
|
+
|
|
109
|
+
$$
|
|
110
|
+
P_{\\overline{${mainEvent}}}(${secondEvent}) = ${secondCondProba.toTex()}\\%
|
|
111
|
+
$$
|
|
112
|
+
|
|
113
|
+
On en déduit les probabilités manquantes :
|
|
114
|
+
|
|
115
|
+
$$
|
|
116
|
+
P\\left(\\overline{${mainEvent}}\\right) = ${substract(100, mainEventProba)
|
|
117
|
+
.simplify()
|
|
118
|
+
.toTex()}\\%
|
|
119
|
+
$$
|
|
120
|
+
|
|
121
|
+
$$
|
|
122
|
+
P_{${mainEvent}}(\\overline{${secondEvent}}) = ${substract(100, firstCondProba)
|
|
123
|
+
.simplify()
|
|
124
|
+
.toTex()}\\%
|
|
125
|
+
$$
|
|
126
|
+
|
|
127
|
+
$$
|
|
128
|
+
P_{\\overline{${mainEvent}}}(\\overline{${secondEvent}}) = ${substract(100, secondCondProba)
|
|
129
|
+
.simplify()
|
|
130
|
+
.toTex()}\\%
|
|
131
|
+
$$
|
|
132
|
+
`;
|
|
133
|
+
};
|
|
134
|
+
const getKeys = (identifiers) => {
|
|
135
|
+
const { params } = identifiers;
|
|
136
|
+
const situation = getProbaTreeSituation(params);
|
|
137
|
+
return situation.keys;
|
|
138
|
+
};
|
|
139
|
+
const isAnswerTreeTableValid = (ans, { answerTreeTable }) => {
|
|
140
|
+
try {
|
|
141
|
+
return treeTableVEA(ans, answerTreeTable);
|
|
142
|
+
}
|
|
143
|
+
catch (err) {
|
|
144
|
+
return handleVEAError(err);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
const getBuildTreeFromSituationQuestion = () => {
|
|
148
|
+
const params = buildProbaTreeSituation();
|
|
149
|
+
const identifiers = {
|
|
150
|
+
params,
|
|
151
|
+
};
|
|
152
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
153
|
+
};
|
|
154
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
155
|
+
return {
|
|
156
|
+
answerTreeTable: getAnswerTreeTable(identifiers),
|
|
157
|
+
instruction: getInstruction(identifiers),
|
|
158
|
+
keys: getKeys(identifiers),
|
|
159
|
+
answerFormat: "tex",
|
|
160
|
+
identifiers,
|
|
161
|
+
hint: getHint(identifiers),
|
|
162
|
+
correction: getCorrection(identifiers),
|
|
163
|
+
initTreeTable: [
|
|
164
|
+
[
|
|
165
|
+
[
|
|
166
|
+
["", ""],
|
|
167
|
+
["", ""],
|
|
168
|
+
],
|
|
169
|
+
],
|
|
170
|
+
[
|
|
171
|
+
[
|
|
172
|
+
["", ""],
|
|
173
|
+
["", ""],
|
|
174
|
+
],
|
|
175
|
+
[
|
|
176
|
+
["", ""],
|
|
177
|
+
["", ""],
|
|
178
|
+
],
|
|
179
|
+
],
|
|
180
|
+
],
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
export const buildTreeFromSituation = {
|
|
184
|
+
id: "buildTreeFromSituation",
|
|
185
|
+
label: "Modéliser une situation par un arbre pondéré",
|
|
186
|
+
isSingleStep: true,
|
|
187
|
+
generator: (nb, opts) => getDistinctQuestions(() => getBuildTreeFromSituationQuestion(opts), nb),
|
|
188
|
+
qcmTimer: 60,
|
|
189
|
+
freeTimer: 60,
|
|
190
|
+
isAnswerTreeTableValid,
|
|
191
|
+
subject: "Mathématiques",
|
|
192
|
+
getInstruction,
|
|
193
|
+
getHint,
|
|
194
|
+
getCorrection,
|
|
195
|
+
getAnswerTreeTable,
|
|
196
|
+
getQuestionFromIdentifiers,
|
|
197
|
+
answerType: "treeDiagram",
|
|
198
|
+
hasHintAndCorrection: true,
|
|
199
|
+
};
|
|
@@ -29,18 +29,18 @@ const getAnswerTreeTable = (identifiers) => {
|
|
|
29
29
|
return [
|
|
30
30
|
[
|
|
31
31
|
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
32
|
+
[`${datas[0][0]}`, "A"],
|
|
33
|
+
[`${datas[0][1]}`, "\\overline{A}"],
|
|
34
34
|
],
|
|
35
35
|
],
|
|
36
36
|
[
|
|
37
37
|
[
|
|
38
|
-
[
|
|
39
|
-
[
|
|
38
|
+
[`${datas[1][0]}`, "B"],
|
|
39
|
+
[`${datas[1][1]}`, "\\overline{B}"],
|
|
40
40
|
],
|
|
41
41
|
[
|
|
42
|
-
[
|
|
43
|
-
[
|
|
42
|
+
[`${datas[2][0]}`, "B"],
|
|
43
|
+
[`${datas[2][1]}`, "\\overline{B}"],
|
|
44
44
|
],
|
|
45
45
|
],
|
|
46
46
|
];
|
|
@@ -129,26 +129,26 @@ const getFillProbaTreeWithComplementaryProbabilitiesQuestion = (ops) => {
|
|
|
129
129
|
const initTree = [
|
|
130
130
|
[
|
|
131
131
|
[
|
|
132
|
-
[!valueDatas[0].isComp ? valueDatas[0].value.toTex() : "", "
|
|
132
|
+
[!valueDatas[0].isComp ? valueDatas[0].value.toTex() : "", "A"],
|
|
133
133
|
[
|
|
134
134
|
valueDatas[0].isComp ? valueDatas[0].value.toTex() : "",
|
|
135
|
-
"
|
|
135
|
+
"\\overline{A}",
|
|
136
136
|
],
|
|
137
137
|
],
|
|
138
138
|
],
|
|
139
139
|
[
|
|
140
140
|
[
|
|
141
|
-
[!valueDatas[1].isComp ? valueDatas[1].value.toTex() : "", "
|
|
141
|
+
[!valueDatas[1].isComp ? valueDatas[1].value.toTex() : "", "B"],
|
|
142
142
|
[
|
|
143
143
|
valueDatas[1].isComp ? valueDatas[1].value.toTex() : "",
|
|
144
|
-
"
|
|
144
|
+
"\\overline{B}",
|
|
145
145
|
],
|
|
146
146
|
],
|
|
147
147
|
[
|
|
148
|
-
[!valueDatas[2].isComp ? valueDatas[2].value.toTex() : "", "
|
|
148
|
+
[!valueDatas[2].isComp ? valueDatas[2].value.toTex() : "", "B"],
|
|
149
149
|
[
|
|
150
150
|
valueDatas[2].isComp ? valueDatas[2].value.toTex() : "",
|
|
151
|
-
"
|
|
151
|
+
"\\overline{B}",
|
|
152
152
|
],
|
|
153
153
|
],
|
|
154
154
|
],
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { probabilityTree, probabilityTreeIntersection, probabilityTreeTotalProbability, probabilityTreeReadProbability, probabilityTreeInversionProbability, } from "./probabilityTree.js";
|
|
2
|
+
export * from "./fillProbaTreeWithComplementaryProbabilities.js";
|
|
3
|
+
export * from "./buildTreeFromSituation.js";
|
|
2
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,eAAe,EACf,2BAA2B,EAC3B,+BAA+B,EAC/B,8BAA8B,EAC9B,mCAAmC,GACpC,MAAM,sBAAsB,CAAC;AAC9B,cAAc,kDAAkD,CAAC;AACjE,cAAc,6BAA6B,CAAC"}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export * from "./treeInInstruction.js";
|
|
1
|
+
// export * from "./treeInInstruction.js";
|
|
2
|
+
// export * from "./treeInAnswer.js";
|
|
3
|
+
export { probabilityTree, probabilityTreeIntersection, probabilityTreeTotalProbability, probabilityTreeReadProbability, probabilityTreeInversionProbability, } from "./probabilityTree.js";
|
|
4
|
+
export * from "./fillProbaTreeWithComplementaryProbabilities.js";
|
|
5
|
+
export * from "./buildTreeFromSituation.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probaTreeSituationTotalProbaFormula.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/probaTreeSituationTotalProbaFormula.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
// import {
|
|
2
|
+
// Exercise,
|
|
3
|
+
// Proposition,
|
|
4
|
+
// QCMGenerator,
|
|
5
|
+
// Question,
|
|
6
|
+
// QuestionGenerator,
|
|
7
|
+
// VEA,
|
|
8
|
+
// addValidProp,
|
|
9
|
+
// shuffleProps,
|
|
10
|
+
// GetAnswer,
|
|
11
|
+
// GetHint,
|
|
12
|
+
// GetCorrection,
|
|
13
|
+
// GetInstruction,
|
|
14
|
+
// GetKeys,
|
|
15
|
+
// GetQuestionFromIdentifiers,
|
|
16
|
+
// } from '../../../../exercises/exercise.js';
|
|
17
|
+
// import { getDistinctQuestions } from '../../../../exercises/utils/getDistinctQuestions.js';
|
|
18
|
+
// import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
19
|
+
export {};
|
|
20
|
+
// type Identifiers = {
|
|
21
|
+
// };
|
|
22
|
+
// const getPropositions: QCMGenerator<Identifiers> = (n, { answer }) => {
|
|
23
|
+
// const propositions: Proposition[] = [];
|
|
24
|
+
// addValidProp(propositions, answer);
|
|
25
|
+
// propWhile(propositions, n, () => {
|
|
26
|
+
// throw Error("QCM not implemented")
|
|
27
|
+
// })
|
|
28
|
+
// return shuffleProps(propositions, n);
|
|
29
|
+
// };
|
|
30
|
+
// const getAnswer : GetAnswer<Identifiers> = (identifiers)=>{
|
|
31
|
+
// }
|
|
32
|
+
// const getInstruction : GetInstruction<Identifiers> = (identifiers)=>{
|
|
33
|
+
// }
|
|
34
|
+
// const getHint : GetHint<Identifiers> = (identifiers)=>{
|
|
35
|
+
// }
|
|
36
|
+
// const getCorrection : GetCorrection<Identifiers> = (identifiers)=>{
|
|
37
|
+
// }
|
|
38
|
+
// const getKeys : GetKeys<Identifiers> = (identifiers)=>{
|
|
39
|
+
// return []
|
|
40
|
+
// }
|
|
41
|
+
// const isAnswerValid: VEA<Identifiers> = (ans, {answer})=>{
|
|
42
|
+
// try {
|
|
43
|
+
// throw Error("VEA not implemented")
|
|
44
|
+
// } catch(err){
|
|
45
|
+
// return handleVEAError(err)
|
|
46
|
+
// }
|
|
47
|
+
// }
|
|
48
|
+
// const getProbaTreeSituationTotalProbaFormulaQuestion: QuestionGenerator<Identifiers> = (ops)=>{
|
|
49
|
+
// const identifiers: Identifiers = {}
|
|
50
|
+
// return getQuestionFromIdentifiers(identifiers);
|
|
51
|
+
// }
|
|
52
|
+
// const getQuestionFromIdentifiers: GetQuestionFromIdentifiers<Identifiers> = (identifiers)=>{
|
|
53
|
+
// return {
|
|
54
|
+
// answer: getAnswer(identifiers),
|
|
55
|
+
// instruction: getInstruction(identifiers),
|
|
56
|
+
// keys: getKeys(identifiers),
|
|
57
|
+
// answerFormat: 'tex',
|
|
58
|
+
// identifiers,
|
|
59
|
+
// hint: getHint(identifiers),
|
|
60
|
+
// correction: getCorrection(identifiers)
|
|
61
|
+
// }
|
|
62
|
+
// }
|
|
63
|
+
// export const probaTreeSituationTotalProbaFormula: Exercise<Identifiers> = {
|
|
64
|
+
// id: 'probaTreeSituationTotalProbaFormula',
|
|
65
|
+
// connector: "",
|
|
66
|
+
// label: undefined,
|
|
67
|
+
// isSingleStep: true,
|
|
68
|
+
// generator: (nb, opts) => getDistinctQuestions(()=>getProbaTreeSituationTotalProbaFormulaQuestion(opts), nb),
|
|
69
|
+
// qcmTimer: 60,
|
|
70
|
+
// freeTimer: 60,
|
|
71
|
+
// getPropositions,
|
|
72
|
+
// isAnswerValid,
|
|
73
|
+
// subject: "Mathématiques",
|
|
74
|
+
// getInstruction,
|
|
75
|
+
// getHint,
|
|
76
|
+
// getCorrection,
|
|
77
|
+
// getAnswer,
|
|
78
|
+
// getQuestionFromIdentifiers,
|
|
79
|
+
// hasHintAndCorrection: true
|
|
80
|
+
// };
|
|
@@ -1,2 +1,62 @@
|
|
|
1
|
+
import { AlgebraicNode } from "../../../../tree/nodes/algebraicNode.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
import { KeyId } from "../../../../types/keyIds.js";
|
|
4
|
+
import { KeyProps } from "../../../../types/keyProps.js";
|
|
5
|
+
type ProbaTreeSituation = {
|
|
6
|
+
id: string;
|
|
7
|
+
context: string;
|
|
8
|
+
keys: (KeyId | KeyProps)[];
|
|
9
|
+
tree: string[][][][];
|
|
10
|
+
mainEvent: string;
|
|
11
|
+
secondEvent: string;
|
|
12
|
+
mainEventProba: AlgebraicNode;
|
|
13
|
+
firstCondProba: AlgebraicNode;
|
|
14
|
+
secondCondProba: AlgebraicNode;
|
|
15
|
+
};
|
|
16
|
+
type VirusParams = {
|
|
17
|
+
pContamineIds: NodeIdentifiers;
|
|
18
|
+
pPosContamineIds: NodeIdentifiers;
|
|
19
|
+
pNegSainIds: NodeIdentifiers;
|
|
20
|
+
};
|
|
21
|
+
type DrageeParams = {
|
|
22
|
+
pAmandeIds: NodeIdentifiers;
|
|
23
|
+
pBlancheAmandeIds: NodeIdentifiers;
|
|
24
|
+
pBlancheChocolatIds: NodeIdentifiers;
|
|
25
|
+
};
|
|
26
|
+
type UsineParams = {
|
|
27
|
+
pAIds: NodeIdentifiers;
|
|
28
|
+
pDefAIds: NodeIdentifiers;
|
|
29
|
+
pDefBIds: NodeIdentifiers;
|
|
30
|
+
};
|
|
31
|
+
type MatchParams = {
|
|
32
|
+
pDomicileIds: NodeIdentifiers;
|
|
33
|
+
pVDomicileIds: NodeIdentifiers;
|
|
34
|
+
pVExterieurIds: NodeIdentifiers;
|
|
35
|
+
};
|
|
36
|
+
type CarParams = {
|
|
37
|
+
pJeuneIds: NodeIdentifiers;
|
|
38
|
+
pJeuneSinistreIds: NodeIdentifiers;
|
|
39
|
+
pAutreSinistreIds: NodeIdentifiers;
|
|
40
|
+
};
|
|
41
|
+
type LyceeParams = {
|
|
42
|
+
pFIds: NodeIdentifiers;
|
|
43
|
+
pFMathsIds: NodeIdentifiers;
|
|
44
|
+
pGMathsIds: NodeIdentifiers;
|
|
45
|
+
};
|
|
46
|
+
export type ProbaTreeSituationParams = (VirusParams & {
|
|
47
|
+
id: "virus";
|
|
48
|
+
}) | (DrageeParams & {
|
|
49
|
+
id: "dragee";
|
|
50
|
+
}) | (UsineParams & {
|
|
51
|
+
id: "usine";
|
|
52
|
+
}) | (MatchParams & {
|
|
53
|
+
id: "match";
|
|
54
|
+
}) | (LyceeParams & {
|
|
55
|
+
id: "lycee";
|
|
56
|
+
}) | (CarParams & {
|
|
57
|
+
id: "car";
|
|
58
|
+
});
|
|
59
|
+
export declare const getProbaTreeSituation: (params: ProbaTreeSituationParams) => ProbaTreeSituation;
|
|
60
|
+
export declare const buildProbaTreeSituation: () => ProbaTreeSituationParams;
|
|
1
61
|
export {};
|
|
2
62
|
//# sourceMappingURL=probaTreeSituations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probaTreeSituations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/probaTreeSituations.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"probaTreeSituations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/probaTreeSituations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAGnD,KAAK,kBAAkB,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,CAAC,KAAK,GAAG,QAAQ,CAAC,EAAE,CAAC;IAC3B,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,aAAa,CAAC;IAC9B,cAAc,EAAE,aAAa,CAAC;IAC9B,eAAe,EAAE,aAAa,CAAC;CAChC,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,aAAa,EAAE,eAAe,CAAC;IAC/B,gBAAgB,EAAE,eAAe,CAAC;IAClC,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AAsDF,KAAK,YAAY,GAAG;IAClB,UAAU,EAAE,eAAe,CAAC;IAC5B,iBAAiB,EAAE,eAAe,CAAC;IACnC,mBAAmB,EAAE,eAAe,CAAC;CACtC,CAAC;AAsDF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAkDF,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,eAAe,CAAC;IAC9B,aAAa,EAAE,eAAe,CAAC;IAC/B,cAAc,EAAE,eAAe,CAAC;CACjC,CAAC;AA0DF,KAAK,SAAS,GAAG;IACf,SAAS,EAAE,eAAe,CAAC;IAC3B,iBAAiB,EAAE,eAAe,CAAC;IACnC,iBAAiB,EAAE,eAAe,CAAC;CACpC,CAAC;AAuDF,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,EAAE,eAAe,CAAC;IAC5B,UAAU,EAAE,eAAe,CAAC;CAC7B,CAAC;AAkDF,MAAM,MAAM,wBAAwB,GAChC,CAAC,WAAW,GAAG;IAAE,EAAE,EAAE,OAAO,CAAA;CAAE,CAAC,GAC/B,CAAC,YAAY,GAAG;IAAE,EAAE,EAAE,QAAQ,CAAA;CAAE,CAAC,GACjC,CAAC,WAAW,GAAG;IAAE,EAAE,EAAE,OAAO,CAAA;CAAE,CAAC,GAC/B,CAAC,WAAW,GAAG;IAAE,EAAE,EAAE,OAAO,CAAA;CAAE,CAAC,GAC/B,CAAC,WAAW,GAAG;IAAE,EAAE,EAAE,OAAO,CAAA;CAAE,CAAC,GAC/B,CAAC,SAAS,GAAG;IAAE,EAAE,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAEhC,eAAO,MAAM,qBAAqB,GAAI,QAAQ,wBAAwB,uBAerE,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAAO,wBAsB1C,CAAC"}
|