math-exercises 3.0.173 → 3.0.174
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/functions/trinoms/parabole/parabolaVarTable.js +2 -2
- package/lib/exercises/math/functions/trinoms/parabole/paraboleSolveGraphEquation.js +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/roots/rootsFromDevForm.js +0 -1
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts +2 -0
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +68 -0
- package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.d.ts +15 -0
- package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.js +206 -0
- package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts +2 -0
- package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/trees/probaTreeSituations.js +108 -0
- package/lib/exercises/math/probaStat/trees/probabilityTree.d.ts +25 -0
- package/lib/exercises/math/probaStat/trees/probabilityTree.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/trees/probabilityTree.js +625 -0
- package/lib/exercises/math/probaStat/trees/treeInAnswer.d.ts +9 -0
- package/lib/exercises/math/probaStat/trees/treeInAnswer.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/trees/treeInAnswer.js +107 -0
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormula.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstRankOne.js +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts +4 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFirstTermRandom.js +66 -24
- package/lib/exercises/math/trigonometry/circle/index.d.ts +1 -0
- package/lib/exercises/math/trigonometry/circle/index.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/index.js +1 -0
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts +2 -0
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +94 -0
- package/lib/exercises/math/trigonometry/circle/trigoFunctionsFundamentalEquation.d.ts +10 -0
- package/lib/exercises/math/trigonometry/circle/trigoFunctionsFundamentalEquation.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/circle/trigoFunctionsFundamentalEquation.js +223 -0
- package/lib/exercises/math/trigonometry/functions/basicEquationCos.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/functions/basicEquationCos.js +2 -1
- package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.d.ts +10 -0
- package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.js +208 -0
- package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.d.ts +0 -6
- package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/functions/equationSinOnRandomInterval.js +162 -99
- package/lib/exercises/math/trigonometry/functions/index.d.ts +3 -0
- package/lib/exercises/math/trigonometry/functions/index.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/functions/index.js +3 -0
- package/lib/exercises/math/trigonometry/functions/readPeriodicityOnFunctionGraph.d.ts +12 -0
- package/lib/exercises/math/trigonometry/functions/readPeriodicityOnFunctionGraph.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/functions/readPeriodicityOnFunctionGraph.js +159 -0
- package/lib/exercises/math/trigonometry/functions/sinInequationMainInterval.d.ts +10 -0
- package/lib/exercises/math/trigonometry/functions/sinInequationMainInterval.d.ts.map +1 -0
- package/lib/exercises/math/trigonometry/functions/sinInequationMainInterval.js +224 -0
- package/lib/exercises/math/trigonometry/trigoFundamentalEquation.js +1 -1
- package/lib/exercises/vea/treeTableVEA.d.ts +2 -0
- package/lib/exercises/vea/treeTableVEA.d.ts.map +1 -0
- package/lib/exercises/vea/treeTableVEA.js +7 -0
- package/lib/index.d.ts +19 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.d.ts +1 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +16 -0
- package/lib/utils/latex/poundify.d.ts +2 -0
- package/lib/utils/latex/poundify.d.ts.map +1 -0
- package/lib/utils/latex/poundify.js +3 -0
- package/package.json +1 -1
|
@@ -65,9 +65,9 @@ const getParabolaVarTableQuestion = () => {
|
|
|
65
65
|
const identifiers = {
|
|
66
66
|
coeffs: trinom.coefficients,
|
|
67
67
|
initTable: [
|
|
68
|
-
["$x$", "
|
|
68
|
+
["$x$", "", "\\ ", "", "\\ ", ""],
|
|
69
69
|
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
70
|
-
["$f(x)$", "\\ ", "
|
|
70
|
+
["$f(x)$", "\\ ", "", "", "", "\\ "],
|
|
71
71
|
["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
|
|
72
72
|
],
|
|
73
73
|
};
|
|
@@ -94,7 +94,7 @@ const getGGBOptions = (identifiers) => {
|
|
|
94
94
|
});
|
|
95
95
|
};
|
|
96
96
|
const getKeys = () => {
|
|
97
|
-
return ["S", "equal", "
|
|
97
|
+
return ["S", "equal", "lbrace", "semicolon", "rbrace", "varnothing"];
|
|
98
98
|
};
|
|
99
99
|
const isAnswerValid = (ans, { answer }) => {
|
|
100
100
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;
|
|
1
|
+
{"version":3,"file":"rootsFromDevForm.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/roots/rootsFromDevForm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAcT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAoMF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,WAAW,CAclD,CAAC"}
|
|
@@ -157,7 +157,6 @@ const isAnswerValid = (ans, { a, b, c }) => {
|
|
|
157
157
|
}
|
|
158
158
|
};
|
|
159
159
|
const isArrayOfNodesValid = (arrAns, arrAnswer) => {
|
|
160
|
-
//tried with toAllValidTexs() but there is always an unhandled case
|
|
161
160
|
function isNodesEqual(node1, node2) {
|
|
162
161
|
return [1, 1_000, 1_000_000].every((factor) => substract(multiply(factor, node1), multiply(factor, node2)).evaluate() === 0);
|
|
163
162
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildTreeFromSituation.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/buildTreeFromSituation.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// import {
|
|
2
|
+
// Exercise,
|
|
3
|
+
// QuestionGenerator,
|
|
4
|
+
// GetHint,
|
|
5
|
+
// GetCorrection,
|
|
6
|
+
// GetInstruction,
|
|
7
|
+
// GetKeys,
|
|
8
|
+
// GetQuestionFromIdentifiers,
|
|
9
|
+
// GetAnswerTreeTable,
|
|
10
|
+
// TreeDiagramVEA,
|
|
11
|
+
// } from '../../../../exercises/exercise.js';
|
|
12
|
+
// import { getDistinctQuestions } from '../../../../exercises/utils/getDistinctQuestions.js';
|
|
13
|
+
// import { treeTableVEA } from '../../../../exercises/vea/treeTableVEA.js';
|
|
14
|
+
// import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
15
|
+
export {};
|
|
16
|
+
// type Identifiers = {
|
|
17
|
+
// situationId: string
|
|
18
|
+
// };
|
|
19
|
+
// const getAnswerTreeTable : GetAnswerTreeTable<Identifiers> = (identifiers)=>{
|
|
20
|
+
// }
|
|
21
|
+
// const getInstruction : GetInstruction<Identifiers> = (identifiers)=>{
|
|
22
|
+
// const {} = identifiers
|
|
23
|
+
// }
|
|
24
|
+
// const getHint : GetHint<Identifiers> = (identifiers)=>{
|
|
25
|
+
// }
|
|
26
|
+
// const getCorrection : GetCorrection<Identifiers> = (identifiers)=>{
|
|
27
|
+
// }
|
|
28
|
+
// const getKeys : GetKeys<Identifiers> = (identifiers)=>{
|
|
29
|
+
// return []
|
|
30
|
+
// }
|
|
31
|
+
// const isAnswerTreeTableValid: TreeDiagramVEA<Identifiers> = (ans, {answerTreeTable})=>{
|
|
32
|
+
// try {
|
|
33
|
+
// return treeTableVEA(ans, answerTreeTable)
|
|
34
|
+
// } catch(err){
|
|
35
|
+
// return handleVEAError(err)
|
|
36
|
+
// }
|
|
37
|
+
// }
|
|
38
|
+
// const getBuildTreeFromSituationQuestion: QuestionGenerator<Identifiers> = (ops)=>{
|
|
39
|
+
// const identifiers: Identifiers = {}
|
|
40
|
+
// return getQuestionFromIdentifiers(identifiers);
|
|
41
|
+
// }
|
|
42
|
+
// const getQuestionFromIdentifiers: GetQuestionFromIdentifiers<Identifiers> = (identifiers)=>{
|
|
43
|
+
// return {
|
|
44
|
+
// answerTreeTable: getAnswerTreeTable(identifiers),
|
|
45
|
+
// instruction: getInstruction(identifiers),
|
|
46
|
+
// keys: getKeys(identifiers),
|
|
47
|
+
// answerFormat: 'tex',
|
|
48
|
+
// identifiers,
|
|
49
|
+
// hint: getHint(identifiers),
|
|
50
|
+
// correction: getCorrection(identifiers)
|
|
51
|
+
// }
|
|
52
|
+
// }
|
|
53
|
+
// export const buildTreeFromSituation: Exercise<Identifiers> = {
|
|
54
|
+
// id: 'buildTreeFromSituation',
|
|
55
|
+
// label: "undefined",
|
|
56
|
+
// isSingleStep: true,
|
|
57
|
+
// generator: (nb, opts) => getDistinctQuestions(()=>getBuildTreeFromSituationQuestion(opts), nb),
|
|
58
|
+
// qcmTimer: 60,
|
|
59
|
+
// freeTimer: 60,
|
|
60
|
+
// isAnswerTreeTableValid,
|
|
61
|
+
// subject: "Mathématiques",
|
|
62
|
+
// getInstruction,
|
|
63
|
+
// getHint,
|
|
64
|
+
// getCorrection,
|
|
65
|
+
// getAnswerTreeTable,
|
|
66
|
+
// getQuestionFromIdentifiers,
|
|
67
|
+
// hasHintAndCorrection: true
|
|
68
|
+
// };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
initTree: string[][][][];
|
|
5
|
+
valueDatas: {
|
|
6
|
+
isComp: boolean;
|
|
7
|
+
value: NodeIdentifiers;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
type Options = {
|
|
11
|
+
probaType?: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const fillProbaTreeWithComplementaryProbabilities: Exercise<Identifiers, Options>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=fillProbaTreeWithComplementaryProbabilities.d.ts.map
|
package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fillProbaTreeWithComplementaryProbabilities.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EACL,eAAe,EAEhB,MAAM,qCAAqC,CAAC;AAM7C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC;IACzB,UAAU,EAAE;QACV,MAAM,EAAE,OAAO,CAAC;QAChB,KAAK,EAAE,eAAe,CAAC;KACxB,EAAE,CAAC;CACL,CAAC;AA6KF,KAAK,OAAO,GAAG;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AA4BF,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAChE,WAAW,EACX,OAAO,CAuBR,CAAC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { treeTableVEA } from "../../../../exercises/vea/treeTableVEA.js";
|
|
4
|
+
import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
|
|
5
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
6
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
7
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
8
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
9
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
10
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
11
|
+
const getAnswerTreeTable = (identifiers) => {
|
|
12
|
+
const { valueDatas } = identifiers;
|
|
13
|
+
const reified = valueDatas.map((d) => reifyAlgebraic(d.value));
|
|
14
|
+
const missingData = reified.map((d) => substract(1, d).simplify());
|
|
15
|
+
const datas = [
|
|
16
|
+
[
|
|
17
|
+
(valueDatas[0].isComp ? missingData : reified)[0].toTex(),
|
|
18
|
+
(valueDatas[0].isComp ? reified : missingData)[0].toTex(),
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
(valueDatas[1].isComp ? missingData : reified)[1].toTex(),
|
|
22
|
+
(valueDatas[1].isComp ? reified : missingData)[1].toTex(),
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
(valueDatas[2].isComp ? missingData : reified)[2].toTex(),
|
|
26
|
+
(valueDatas[2].isComp ? reified : missingData)[2].toTex(),
|
|
27
|
+
],
|
|
28
|
+
];
|
|
29
|
+
return [
|
|
30
|
+
[
|
|
31
|
+
[
|
|
32
|
+
[`$${datas[0][0]}$`, "$A$"],
|
|
33
|
+
[`$${datas[0][1]}$`, "$\\overline{A}$"],
|
|
34
|
+
],
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
[
|
|
38
|
+
[`$${datas[1][0]}$`, "$B$"],
|
|
39
|
+
[`$${datas[1][1]}$`, "$\\overline{B}$"],
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
[`$${datas[2][0]}$`, "$B$"],
|
|
43
|
+
[`$${datas[2][1]}$`, "$\\overline{B}$"],
|
|
44
|
+
],
|
|
45
|
+
],
|
|
46
|
+
];
|
|
47
|
+
};
|
|
48
|
+
const getInstruction = () => {
|
|
49
|
+
return `Compléter les probabilités manquantes dans l'arbre pondéré suivant :
|
|
50
|
+
|
|
51
|
+
`;
|
|
52
|
+
};
|
|
53
|
+
const getHint = () => {
|
|
54
|
+
return `Dans un arbre pondéré, la somme des probabilités des branches issues d'un même noeud est égale à $1$.`;
|
|
55
|
+
};
|
|
56
|
+
const getCorrection = (identifiers) => {
|
|
57
|
+
const { valueDatas } = identifiers;
|
|
58
|
+
const events = valueDatas.map((d, i) => {
|
|
59
|
+
if (i === 0)
|
|
60
|
+
return d.isComp ? "P(A)" : "P\\left(\\overline{A}\\right)";
|
|
61
|
+
if (i === 1)
|
|
62
|
+
return d.isComp ? "P_A(B)" : "P_A\\left(\\overline{B}\\right)";
|
|
63
|
+
else
|
|
64
|
+
return d.isComp
|
|
65
|
+
? "P_{\\overline{A}}(B)"
|
|
66
|
+
: "P_{\\overline{A}}\\left(\\overline{B}\\right)";
|
|
67
|
+
});
|
|
68
|
+
const probas = valueDatas.map((d) => reifyAlgebraic(d.value));
|
|
69
|
+
return `Dans un arbre pondéré, la somme des probabilités des branches issues d'un même noeud est égale à $1$.
|
|
70
|
+
|
|
71
|
+
On a donc :
|
|
72
|
+
|
|
73
|
+
$$
|
|
74
|
+
${events[0]} = 1 - ${probas[0].toTex()} = ${substract(1, probas[0])
|
|
75
|
+
.simplify()
|
|
76
|
+
.toTex()}
|
|
77
|
+
$$
|
|
78
|
+
|
|
79
|
+
$$
|
|
80
|
+
${events[1]} = 1 - ${probas[1].toTex()} = ${substract(1, probas[1])
|
|
81
|
+
.simplify()
|
|
82
|
+
.toTex()}
|
|
83
|
+
$$
|
|
84
|
+
|
|
85
|
+
$$
|
|
86
|
+
${events[2]} = 1 - ${probas[2].toTex()} = ${substract(1, probas[2])
|
|
87
|
+
.simplify()
|
|
88
|
+
.toTex()}
|
|
89
|
+
$$
|
|
90
|
+
`;
|
|
91
|
+
};
|
|
92
|
+
const getKeys = () => {
|
|
93
|
+
return [];
|
|
94
|
+
};
|
|
95
|
+
const isAnswerTreeTableValid = (ans, { answerTreeTable }) => {
|
|
96
|
+
try {
|
|
97
|
+
return treeTableVEA(ans, answerTreeTable);
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
return handleVEAError(err);
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const getFillProbaTreeWithComplementaryProbabilitiesQuestion = (ops) => {
|
|
104
|
+
const type = ops?.probaType === "Fractions"
|
|
105
|
+
? "frac"
|
|
106
|
+
: ops?.probaType === "Décimales"
|
|
107
|
+
? "dec"
|
|
108
|
+
: random(["frac", "dec"]);
|
|
109
|
+
const valueDatas = [
|
|
110
|
+
{
|
|
111
|
+
isComp: coinFlip(),
|
|
112
|
+
value: type === "frac"
|
|
113
|
+
? RationalConstructor.randomIrreductibleProba().toTree()
|
|
114
|
+
: randfloat(0.1, 1, 1).toTree(),
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
isComp: coinFlip(),
|
|
118
|
+
value: type === "frac"
|
|
119
|
+
? RationalConstructor.randomIrreductibleProba().toTree()
|
|
120
|
+
: randfloat(0.1, 1, 1).toTree(),
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
isComp: coinFlip(),
|
|
124
|
+
value: type === "frac"
|
|
125
|
+
? RationalConstructor.randomIrreductibleProba().toTree()
|
|
126
|
+
: randfloat(0.1, 1, 1).toTree(),
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
const initTree = [
|
|
130
|
+
[
|
|
131
|
+
[
|
|
132
|
+
[!valueDatas[0].isComp ? valueDatas[0].value.toTex() : "", "$A$"],
|
|
133
|
+
[
|
|
134
|
+
valueDatas[0].isComp ? valueDatas[0].value.toTex() : "",
|
|
135
|
+
"$\\overline{A}$",
|
|
136
|
+
],
|
|
137
|
+
],
|
|
138
|
+
],
|
|
139
|
+
[
|
|
140
|
+
[
|
|
141
|
+
[!valueDatas[1].isComp ? valueDatas[1].value.toTex() : "", "$B$"],
|
|
142
|
+
[
|
|
143
|
+
valueDatas[1].isComp ? valueDatas[1].value.toTex() : "",
|
|
144
|
+
"$\\overline{B}$",
|
|
145
|
+
],
|
|
146
|
+
],
|
|
147
|
+
[
|
|
148
|
+
[!valueDatas[2].isComp ? valueDatas[2].value.toTex() : "", "$B$"],
|
|
149
|
+
[
|
|
150
|
+
valueDatas[2].isComp ? valueDatas[2].value.toTex() : "",
|
|
151
|
+
"$\\overline{B}$",
|
|
152
|
+
],
|
|
153
|
+
],
|
|
154
|
+
],
|
|
155
|
+
];
|
|
156
|
+
const identifiers = {
|
|
157
|
+
initTree,
|
|
158
|
+
valueDatas: valueDatas.map((d) => {
|
|
159
|
+
return {
|
|
160
|
+
isComp: d.isComp,
|
|
161
|
+
value: d.value.toIdentifiers(),
|
|
162
|
+
};
|
|
163
|
+
}),
|
|
164
|
+
};
|
|
165
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
166
|
+
};
|
|
167
|
+
const options = [
|
|
168
|
+
{
|
|
169
|
+
id: "probaType",
|
|
170
|
+
label: "Format des probabilités",
|
|
171
|
+
target: GeneratorOptionTarget.generation,
|
|
172
|
+
type: GeneratorOptionType.select,
|
|
173
|
+
defaultValue: "Aléatoire",
|
|
174
|
+
values: ["Fractions", "Décimales", "Aléatoire"],
|
|
175
|
+
},
|
|
176
|
+
];
|
|
177
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
178
|
+
return {
|
|
179
|
+
answerTreeTable: getAnswerTreeTable(identifiers),
|
|
180
|
+
instruction: getInstruction(identifiers),
|
|
181
|
+
keys: getKeys(identifiers),
|
|
182
|
+
answerFormat: "tex",
|
|
183
|
+
identifiers,
|
|
184
|
+
hint: getHint(identifiers),
|
|
185
|
+
correction: getCorrection(identifiers),
|
|
186
|
+
initTreeTable: identifiers.initTree,
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
export const fillProbaTreeWithComplementaryProbabilities = {
|
|
190
|
+
id: "fillProbaTreeWithComplementaryProbabilities",
|
|
191
|
+
label: "Compléter un arbre pondéré par les probabilités des événements contraires",
|
|
192
|
+
isSingleStep: true,
|
|
193
|
+
generator: (nb, opts) => getDistinctQuestions(() => getFillProbaTreeWithComplementaryProbabilitiesQuestion(opts), nb),
|
|
194
|
+
qcmTimer: 60,
|
|
195
|
+
freeTimer: 60,
|
|
196
|
+
isAnswerTreeTableValid,
|
|
197
|
+
subject: "Mathématiques",
|
|
198
|
+
getInstruction,
|
|
199
|
+
getHint,
|
|
200
|
+
getCorrection,
|
|
201
|
+
getAnswerTreeTable,
|
|
202
|
+
getQuestionFromIdentifiers,
|
|
203
|
+
hasHintAndCorrection: true,
|
|
204
|
+
answerType: "treeDiagram",
|
|
205
|
+
options,
|
|
206
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probaTreeSituations.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/probaTreeSituations.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// import { randint } from "../../../../math/utils/random/randint.js";
|
|
2
|
+
// import { AlgebraicNode } from "../../../../tree/nodes/algebraicNode.js";
|
|
3
|
+
// import { PercentNode } from "../../../../tree/nodes/numbers/percentNode.js";
|
|
4
|
+
// import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
5
|
+
export {};
|
|
6
|
+
// // C1 : Test de dépistage. Un virus a contaminé 10% de la population d'un pays. Un test de dépistage est développé. Le test des positif chez 95% des individus ccntaminés et il est négatif chez 92% des individus sains. On choisit un individu au hasard dans la population et on note C l'événement "l'individu est contaminé" et T l'événement "le test est positif".
|
|
7
|
+
// // C2 : Dragées. Pour son mariage, Amélie a conmmandé des dragées. 30% des dragées sont à l'amande et le reste au chocolat. 60% des dragées à l'amande et 20% des dragées au chocolat sont blanches, les aurtes sont roses. On choisit une dragée au hasard et on note A l'événement "la dragée est à l'amande" et B l'événement "la dragée est blanche".
|
|
8
|
+
// // C3 : Controle qualité. Une entreprise produit* des micro-processeurs. Elle dispose de deux sites de production, A et B. 2% des micro-processeurs produits sur le site A et 5% des micro-processeurs produits sur le site B sont déféctueux. On choisit au hasard un micro-processeur sur l'ensemble de la production, et on note A l'événement "le micro-processeur a été produit sur le site A" et D l'événement "le micro-processeur est défectueux".
|
|
9
|
+
// // C4 : Match à domicile. Sur l'enemble des matchs joués cette année, la célèbre équipe de l'OMG a joué 55% de ces mathcs à domicile. Elle a gagné 75% des matchs joués à domicile et 60% des matchs joués à l'extérieur. on choisit un match au hasard parmi ceux joués cette année et on note D l'événement "le matche a été joué à domicile" et G "l'équipe a gagné le match".
|
|
10
|
+
// // C5 : Accidents jeunes conduteurs. Dans une compagnie d'assurance, on constate que 5% des assurés sont des jeunes conducteurs (moins de 3 ans de permis). Au cours de l'année précédente, 20% des jeunes conducteurs ont eu un sinistre, et 8% des autres conducteurs ont eu un sinistre. on choisit un assuré au hasard de cette compagnie et on note les événements J : "L'assuré est un jeune conducteur" et S : "L'assuré a connu un sinistre au cours de l'année précédente"..
|
|
11
|
+
// // C6 : Choix spécialité maths/genre. Parmi les élèves de terminale d'un lycée, 58% des sont des filles. 70% des filles et 55% des garçons suivent la spécialité maths. On choisit un élève de terminale au hasard dans ce lycée et on note F l'événement "l'élève est une fille" et M l'événement "l'élève suit la spécialité maths".
|
|
12
|
+
// type VirusParams = {
|
|
13
|
+
// pContamine: AlgebraicNode;
|
|
14
|
+
// pPosContamine: AlgebraicNode;
|
|
15
|
+
// pNegSain: AlgebraicNode;
|
|
16
|
+
// };
|
|
17
|
+
// const buildVirusParams = (): VirusParams => {
|
|
18
|
+
// const pContamine = randint(1, 20).toTree();
|
|
19
|
+
// const pPosContamine = randint(88, 98).toTree();
|
|
20
|
+
// const pNegSain = randint(88, 98).toTree();
|
|
21
|
+
// return {
|
|
22
|
+
// pContamine,
|
|
23
|
+
// pNegSain,
|
|
24
|
+
// pPosContamine,
|
|
25
|
+
// };
|
|
26
|
+
// };
|
|
27
|
+
// const virusSituation = (params: VirusParams) => {
|
|
28
|
+
// const { pContamine, pNegSain, pPosContamine } = params;
|
|
29
|
+
// return {
|
|
30
|
+
// id: "virus",
|
|
31
|
+
// context: `Un virus a contaminé $${pContamine.toTex()}\\%$ de la population d'un pays. Un test de dépistage est développé. Le test est positif chez $${pPosContamine.toTex()}\\%$ des individus ccntaminés, et il est négatif chez $${pNegSain.toTex()}\\%$ des individus sains.
|
|
32
|
+
// On choisit un individu au hasard dans la population et on note $C$ l'événement "l'individu est contaminé" et $T$ l'événement "le test est positif".`,
|
|
33
|
+
// keys: ["C", "T", "\\overline{C}", "\\overline{T}", "percent"],
|
|
34
|
+
// tree: [
|
|
35
|
+
// [
|
|
36
|
+
// [
|
|
37
|
+
// [`$${pContamine.toTex()}\\%$`, "$C$"],
|
|
38
|
+
// [
|
|
39
|
+
// `$${substract(1, pContamine).simplify().toTex()}\\%$`,
|
|
40
|
+
// "$\\overline{C}$",
|
|
41
|
+
// ],
|
|
42
|
+
// ],
|
|
43
|
+
// ],
|
|
44
|
+
// [
|
|
45
|
+
// [
|
|
46
|
+
// [`$${pPosContamine.toTex()}\\%$`, "$T$"],
|
|
47
|
+
// [
|
|
48
|
+
// `$${substract(1, pPosContamine).simplify().toTex()}\\%$`,
|
|
49
|
+
// "$\\overline{T}$",
|
|
50
|
+
// ],
|
|
51
|
+
// ],
|
|
52
|
+
// [
|
|
53
|
+
// [`$${substract(1, pNegSain).simplify().toTex()}\\%$`, "$T$"],
|
|
54
|
+
// [`$${pNegSain.toTex()}\\%$`, "$\\overline{T}$"],
|
|
55
|
+
// ],
|
|
56
|
+
// ],
|
|
57
|
+
// ],
|
|
58
|
+
// };
|
|
59
|
+
// };
|
|
60
|
+
// type DrageeParams = {
|
|
61
|
+
// pContamine: AlgebraicNode;
|
|
62
|
+
// pPosContamine: AlgebraicNode;
|
|
63
|
+
// pNegSain: AlgebraicNode;
|
|
64
|
+
// };
|
|
65
|
+
// const buildDrageeParams = (): VirusParams => {
|
|
66
|
+
// const pAmande = randint(1, 20).toTree();
|
|
67
|
+
// const pBlancheAmande = randint(88, 98).toTree();
|
|
68
|
+
// const pBlancheChocolat = randint(88, 98).toTree();
|
|
69
|
+
// return {
|
|
70
|
+
// pContamine,
|
|
71
|
+
// pNegSain,
|
|
72
|
+
// pPosContamine,
|
|
73
|
+
// };
|
|
74
|
+
// };
|
|
75
|
+
// const virusSituation = (params: VirusParams) => {
|
|
76
|
+
// const { pContamine, pNegSain, pPosContamine } = params;
|
|
77
|
+
// return {
|
|
78
|
+
// id: "virus",
|
|
79
|
+
// context: `Un virus a contaminé $${pContamine.toTex()}\\%$ de la population d'un pays. Un test de dépistage est développé. Le test est positif chez $${pPosContamine.toTex()}\\%$ des individus ccntaminés, et il est négatif chez $${pNegSain.toTex()}\\%$ des individus sains.
|
|
80
|
+
// On choisit un individu au hasard dans la population et on note $C$ l'événement "l'individu est contaminé" et $T$ l'événement "le test est positif".`,
|
|
81
|
+
// context: `Pour son mariage, Amélie a commandé des dragées. 30% des dragées sont à l'amande et le reste au chocolat. 60% des dragées à l'amande et 20% des dragées au chocolat sont blanches, les aurtes sont roses. On choisit une dragée au hasard et on note A l'événement "la dragée est à l'amande" et B l'événement "la dragée est blanche".`,
|
|
82
|
+
// keys: ["C", "T", "\\overline{C}", "\\overline{T}", "percent"],
|
|
83
|
+
// tree: [
|
|
84
|
+
// [
|
|
85
|
+
// [
|
|
86
|
+
// [`$${pContamine.toTex()}\\%$`, "$C$"],
|
|
87
|
+
// [
|
|
88
|
+
// `$${substract(1, pContamine).simplify().toTex()}\\%$`,
|
|
89
|
+
// "$\\overline{C}$",
|
|
90
|
+
// ],
|
|
91
|
+
// ],
|
|
92
|
+
// ],
|
|
93
|
+
// [
|
|
94
|
+
// [
|
|
95
|
+
// [`$${pPosContamine.toTex()}\\%$`, "$T$"],
|
|
96
|
+
// [
|
|
97
|
+
// `$${substract(1, pPosContamine).simplify().toTex()}\\%$`,
|
|
98
|
+
// "$\\overline{T}$",
|
|
99
|
+
// ],
|
|
100
|
+
// ],
|
|
101
|
+
// [
|
|
102
|
+
// [`$${substract(1, pNegSain).simplify().toTex()}\\%$`, "$T$"],
|
|
103
|
+
// [`$${pNegSain.toTex()}\\%$`, "$\\overline{T}$"],
|
|
104
|
+
// ],
|
|
105
|
+
// ],
|
|
106
|
+
// ],
|
|
107
|
+
// };
|
|
108
|
+
// };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
2
|
+
import { Exercise } from "../../../exercise.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
A: NodeIdentifiers;
|
|
5
|
+
B: NodeIdentifiers;
|
|
6
|
+
AC: NodeIdentifiers;
|
|
7
|
+
AD: NodeIdentifiers;
|
|
8
|
+
BC: NodeIdentifiers;
|
|
9
|
+
BD: NodeIdentifiers;
|
|
10
|
+
probaName: string;
|
|
11
|
+
useContraryNames?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type Options = {
|
|
14
|
+
allowApproximate?: string;
|
|
15
|
+
eventTypes?: string[];
|
|
16
|
+
probaType?: string;
|
|
17
|
+
eventsNames?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const probabilityTree: Exercise<Identifiers, Options>;
|
|
20
|
+
export declare const probabilityTreeIntersection: Exercise<Identifiers, Options>;
|
|
21
|
+
export declare const probabilityTreeTotalProbability: Exercise<Identifiers, Options>;
|
|
22
|
+
export declare const probabilityTreeReadProbability: Exercise<Identifiers, Options>;
|
|
23
|
+
export declare const probabilityTreeInversionProbability: Exercise<Identifiers, Options>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=probabilityTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/probabilityTree.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,OAAO,EACL,QAAQ,EAkBT,MAAM,sBAAsB,CAAC;AAG9B,KAAK,WAAW,GAAG;IAIjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;IACnB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAuhBF,KAAK,OAAO,GAAG;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAwDF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe1D,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwBtE,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwB1E,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA2BzE,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CACxD,WAAW,EACX,OAAO,CA0BR,CAAC"}
|