math-exercises 3.0.174 → 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/exercises/vea/varLineVEA.d.ts.map +1 -1
- package/lib/exercises/vea/varLineVEA.js +9 -6
- 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,108 +1,344 @@
|
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
1
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
2
|
+
import { reifyAlgebraic, } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
import { substract } from "../../../../tree/nodes/operators/substractNode.js";
|
|
4
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
5
|
+
const buildVirusParams = () => {
|
|
6
|
+
const pContamineIds = randint(1, 20).toTree().toIdentifiers();
|
|
7
|
+
const pPosContamine = randint(88, 98);
|
|
8
|
+
const pNegSainIds = randint(88, 98, [pPosContamine]).toTree().toIdentifiers();
|
|
9
|
+
return {
|
|
10
|
+
pContamineIds,
|
|
11
|
+
pNegSainIds,
|
|
12
|
+
pPosContamineIds: pPosContamine.toTree().toIdentifiers(),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const getVirusSituation = (params) => {
|
|
16
|
+
const { pContamineIds, pNegSainIds, pPosContamineIds } = params;
|
|
17
|
+
const pContamine = reifyAlgebraic(pContamineIds);
|
|
18
|
+
const pPosContamine = reifyAlgebraic(pPosContamineIds);
|
|
19
|
+
const pNegSain = reifyAlgebraic(pNegSainIds);
|
|
20
|
+
return {
|
|
21
|
+
id: "virus",
|
|
22
|
+
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 contaminés, et il est négatif chez $${pNegSain.toTex()}\\%$ des individus sains.
|
|
23
|
+
|
|
24
|
+
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".`,
|
|
25
|
+
mainEvent: "C",
|
|
26
|
+
secondEvent: "T",
|
|
27
|
+
mainEventProba: pContamine,
|
|
28
|
+
firstCondProba: pPosContamine,
|
|
29
|
+
secondCondProba: substract(100, pNegSain).simplify(),
|
|
30
|
+
keys: ["C", "T", "overlineC", "overlineT", "percent"],
|
|
31
|
+
tree: [
|
|
32
|
+
[
|
|
33
|
+
[
|
|
34
|
+
[`${pContamine.toTex()}\\%`, "C"],
|
|
35
|
+
[
|
|
36
|
+
`${substract(100, pContamine).simplify().toTex()}\\%`,
|
|
37
|
+
"\\overline{C}",
|
|
38
|
+
],
|
|
39
|
+
],
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
[
|
|
43
|
+
[`${pPosContamine.toTex()}\\%`, "T"],
|
|
44
|
+
[
|
|
45
|
+
`${substract(100, pPosContamine).simplify().toTex()}\\%`,
|
|
46
|
+
"\\overline{T}",
|
|
47
|
+
],
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
[`${substract(100, pNegSain).simplify().toTex()}\\%`, "T"],
|
|
51
|
+
[`${pNegSain.toTex()}\\%`, "\\overline{T}"],
|
|
52
|
+
],
|
|
53
|
+
],
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
const buildDrageeParams = () => {
|
|
58
|
+
const pAmande = randint(10, 60);
|
|
59
|
+
const pBlancheAmande = randint(40, 90, [pAmande]);
|
|
60
|
+
const pBlancheChocolat = randint(20, 80, [pAmande, pBlancheAmande]);
|
|
61
|
+
return {
|
|
62
|
+
pAmandeIds: pAmande.toTree().toIdentifiers(),
|
|
63
|
+
pBlancheAmandeIds: pBlancheAmande.toTree().toIdentifiers(),
|
|
64
|
+
pBlancheChocolatIds: pBlancheChocolat.toTree().toIdentifiers(),
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
const getDrageeSituation = (params) => {
|
|
68
|
+
const { pAmandeIds, pBlancheAmandeIds, pBlancheChocolatIds } = params;
|
|
69
|
+
const pAmande = reifyAlgebraic(pAmandeIds);
|
|
70
|
+
const pBlancheAmande = reifyAlgebraic(pBlancheAmandeIds);
|
|
71
|
+
const pBlancheChocolat = reifyAlgebraic(pBlancheChocolatIds);
|
|
72
|
+
return {
|
|
73
|
+
id: "dragee",
|
|
74
|
+
context: `Pour son mariage, Amélie a commandé des dragées. $${pAmande.toTex()}\\%$ des dragées sont à l'amande et le reste au chocolat. $${pBlancheAmande.toTex()}\\%$ des dragées à l'amande et $${pBlancheChocolat.toTex()}\\%$ des dragées au chocolat sont blanches, les autres sont roses.
|
|
75
|
+
|
|
76
|
+
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".`,
|
|
77
|
+
mainEvent: "A",
|
|
78
|
+
secondEvent: "B",
|
|
79
|
+
mainEventProba: pAmande,
|
|
80
|
+
firstCondProba: pBlancheAmande,
|
|
81
|
+
secondCondProba: pBlancheChocolat,
|
|
82
|
+
keys: ["A", "B", "overlineA", "overlineB", "percent"],
|
|
83
|
+
tree: [
|
|
84
|
+
[
|
|
85
|
+
[
|
|
86
|
+
[`${pAmande.toTex()}\\%`, "A"],
|
|
87
|
+
[`${substract(100, pAmande).simplify().toTex()}\\%`, "\\overline{A}"],
|
|
88
|
+
],
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
[
|
|
92
|
+
[`${pBlancheAmande.toTex()}\\%`, "B"],
|
|
93
|
+
[
|
|
94
|
+
`${substract(100, pBlancheAmande).simplify().toTex()}\\%`,
|
|
95
|
+
"\\overline{B}",
|
|
96
|
+
],
|
|
97
|
+
],
|
|
98
|
+
[
|
|
99
|
+
[`${pBlancheChocolat.toTex()}\\%`, "B"],
|
|
100
|
+
[
|
|
101
|
+
`${substract(100, pBlancheChocolat).simplify().toTex()}\\%`,
|
|
102
|
+
"\\overline{B}",
|
|
103
|
+
],
|
|
104
|
+
],
|
|
105
|
+
],
|
|
106
|
+
],
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
const buildUsineParams = () => {
|
|
110
|
+
const pA = randint(30, 80);
|
|
111
|
+
const pDefA = randint(1, 10, [pA]);
|
|
112
|
+
const pDefB = randint(1, 10, [pA, pDefA]);
|
|
113
|
+
return {
|
|
114
|
+
pAIds: pA.toTree().toIdentifiers(),
|
|
115
|
+
pDefAIds: pDefA.toTree().toIdentifiers(),
|
|
116
|
+
pDefBIds: pDefB.toTree().toIdentifiers(),
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
const getUsineSituation = (params) => {
|
|
120
|
+
const { pAIds, pDefAIds, pDefBIds } = params;
|
|
121
|
+
const pA = reifyAlgebraic(pAIds);
|
|
122
|
+
const pDefA = reifyAlgebraic(pDefAIds);
|
|
123
|
+
const pDefB = reifyAlgebraic(pDefBIds);
|
|
124
|
+
return {
|
|
125
|
+
id: "usine",
|
|
126
|
+
context: `Une entreprise produit des micro-processeurs. Elle dispose de deux sites de production, $A$ et $B$. $${pA.toTex()}\\%$ de la production provient du site $A$. $${pDefA.toTex()}\\%$ des micro-processeurs produits sur le site $A$ et $${pDefB.toTex()}\\%$ des micro-processeurs produits sur le site $B$ sont déféctueux.
|
|
127
|
+
|
|
128
|
+
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".
|
|
129
|
+
|
|
130
|
+
`,
|
|
131
|
+
mainEvent: "A",
|
|
132
|
+
secondEvent: "D",
|
|
133
|
+
mainEventProba: pA,
|
|
134
|
+
firstCondProba: pDefA,
|
|
135
|
+
secondCondProba: pDefB,
|
|
136
|
+
keys: ["A", "D", "overlineA", "overlineD", "percent"],
|
|
137
|
+
tree: [
|
|
138
|
+
[
|
|
139
|
+
[
|
|
140
|
+
[`${pA.toTex()}\\%`, "A"],
|
|
141
|
+
[`${substract(100, pA).simplify().toTex()}\\%`, "\\overline{A}"],
|
|
142
|
+
],
|
|
143
|
+
],
|
|
144
|
+
[
|
|
145
|
+
[
|
|
146
|
+
[`${pDefA.toTex()}\\%`, "D"],
|
|
147
|
+
[`${substract(100, pDefA).simplify().toTex()}\\%`, "\\overline{D}"],
|
|
148
|
+
],
|
|
149
|
+
[
|
|
150
|
+
[`${pDefB.toTex()}\\%`, "D"],
|
|
151
|
+
[`${substract(100, pDefB).simplify().toTex()}\\%`, "\\overline{D}"],
|
|
152
|
+
],
|
|
153
|
+
],
|
|
154
|
+
],
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const buildMatchParams = () => {
|
|
158
|
+
const pDomicile = randint(30, 70);
|
|
159
|
+
const pVDomicile = randint(10, 80, [pDomicile]);
|
|
160
|
+
const pVExterieur = randint(10, 80, [pDomicile, pVDomicile]);
|
|
161
|
+
return {
|
|
162
|
+
pDomicileIds: pDomicile.toTree().toIdentifiers(),
|
|
163
|
+
pVDomicileIds: pVDomicile.toTree().toIdentifiers(),
|
|
164
|
+
pVExterieurIds: pVExterieur.toTree().toIdentifiers(),
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
const geMatchSituation = (params) => {
|
|
168
|
+
const { pDomicileIds, pVDomicileIds, pVExterieurIds } = params;
|
|
169
|
+
const pDomicile = reifyAlgebraic(pDomicileIds);
|
|
170
|
+
const pVDomicile = reifyAlgebraic(pVDomicileIds);
|
|
171
|
+
const pVExterieur = reifyAlgebraic(pVExterieurIds);
|
|
172
|
+
return {
|
|
173
|
+
id: "match",
|
|
174
|
+
context: `Sur l'enemble des matchs joués cette année, la célèbre équipe de l'OMG a joué $${pDomicile.toTex()}\\%$ de ces matchs à domicile. Elle a gagné $${pVDomicile.toTex()}\\%$ des matchs joués à domicile et $${pVExterieur.toTex()}\\%$ des matchs joués à l'extérieur.
|
|
175
|
+
|
|
176
|
+
On choisit un match au hasard parmi ceux joués cette année et on note $D$ l'événement "le match a été joué à domicile" et $G$ "l'équipe a gagné le match".
|
|
177
|
+
`,
|
|
178
|
+
mainEvent: "D",
|
|
179
|
+
secondEvent: "G",
|
|
180
|
+
mainEventProba: pDomicile,
|
|
181
|
+
firstCondProba: pVDomicile,
|
|
182
|
+
secondCondProba: pVExterieur,
|
|
183
|
+
keys: ["D", "G", "overlineD", "overlineG", "percent"],
|
|
184
|
+
tree: [
|
|
185
|
+
[
|
|
186
|
+
[
|
|
187
|
+
[`${pDomicile.toTex()}\\%`, "D"],
|
|
188
|
+
[
|
|
189
|
+
`${substract(100, pDomicile).simplify().toTex()}\\%`,
|
|
190
|
+
"\\overline{D}",
|
|
191
|
+
],
|
|
192
|
+
],
|
|
193
|
+
],
|
|
194
|
+
[
|
|
195
|
+
[
|
|
196
|
+
[`${pVDomicile.toTex()}\\%`, "G"],
|
|
197
|
+
[
|
|
198
|
+
`${substract(100, pVDomicile).simplify().toTex()}\\%`,
|
|
199
|
+
"\\overline{G}",
|
|
200
|
+
],
|
|
201
|
+
],
|
|
202
|
+
[
|
|
203
|
+
[`${pVExterieur.toTex()}\\%`, "G"],
|
|
204
|
+
[
|
|
205
|
+
`${substract(100, pVExterieur).simplify().toTex()}\\%`,
|
|
206
|
+
"\\overline{G}",
|
|
207
|
+
],
|
|
208
|
+
],
|
|
209
|
+
],
|
|
210
|
+
],
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
const buildCarParams = () => {
|
|
214
|
+
const pJeune = randint(10, 40);
|
|
215
|
+
const pJeuneSinistre = randint(50, 80);
|
|
216
|
+
const pAutreSinistre = randint(30, 50, [pJeuneSinistre, pJeune]);
|
|
217
|
+
return {
|
|
218
|
+
pJeuneIds: pJeune.toTree().toIdentifiers(),
|
|
219
|
+
pJeuneSinistreIds: pJeuneSinistre.toTree().toIdentifiers(),
|
|
220
|
+
pAutreSinistreIds: pAutreSinistre.toTree().toIdentifiers(),
|
|
221
|
+
};
|
|
222
|
+
};
|
|
223
|
+
const getCarSituation = (params) => {
|
|
224
|
+
const { pJeuneIds, pJeuneSinistreIds, pAutreSinistreIds } = params;
|
|
225
|
+
const pJeune = reifyAlgebraic(pJeuneIds);
|
|
226
|
+
const pJeuneSinistre = reifyAlgebraic(pJeuneSinistreIds);
|
|
227
|
+
const pAutreSinistre = reifyAlgebraic(pAutreSinistreIds);
|
|
228
|
+
return {
|
|
229
|
+
id: "car",
|
|
230
|
+
context: `Dans une compagnie d'assurance, on constate que $${pJeune.toTex()}\\%$ des assurés sont des jeunes conducteurs (moins de $3$ ans de permis). Au cours de l'année précédente, $${pJeuneSinistre.toTex()}\\%$ des jeunes conducteurs ont eu un sinistre, et $${pAutreSinistre.toTex()}\\%$ des autres conducteurs ont eu un sinistre.
|
|
231
|
+
|
|
232
|
+
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".
|
|
233
|
+
`,
|
|
234
|
+
mainEvent: "J",
|
|
235
|
+
secondEvent: "S",
|
|
236
|
+
mainEventProba: pJeune,
|
|
237
|
+
firstCondProba: pJeuneSinistre,
|
|
238
|
+
secondCondProba: pAutreSinistre,
|
|
239
|
+
keys: ["J", "S", "overlineJ", "overlineS", "percent"],
|
|
240
|
+
tree: [
|
|
241
|
+
[
|
|
242
|
+
[
|
|
243
|
+
[`${pJeune.toTex()}\\%`, "J"],
|
|
244
|
+
[`${substract(100, pJeune).simplify().toTex()}\\%`, "\\overline{J}"],
|
|
245
|
+
],
|
|
246
|
+
],
|
|
247
|
+
[
|
|
248
|
+
[
|
|
249
|
+
[`${pJeuneSinistre.toTex()}\\%`, "S"],
|
|
250
|
+
[
|
|
251
|
+
`${substract(100, pJeuneSinistre).simplify().toTex()}\\%`,
|
|
252
|
+
"\\overline{S}",
|
|
253
|
+
],
|
|
254
|
+
],
|
|
255
|
+
[
|
|
256
|
+
[`${pAutreSinistre.toTex()}\\%`, "S"],
|
|
257
|
+
[
|
|
258
|
+
`${substract(100, pAutreSinistre).simplify().toTex()}\\%`,
|
|
259
|
+
"\\overline{S}",
|
|
260
|
+
],
|
|
261
|
+
],
|
|
262
|
+
],
|
|
263
|
+
],
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
const buildLyceeParams = () => {
|
|
267
|
+
const pF = randint(40, 60);
|
|
268
|
+
const pFMaths = randint(50, 80, [pF]);
|
|
269
|
+
const pGMaths = randint(30, 70, [pF, pFMaths]);
|
|
270
|
+
return {
|
|
271
|
+
pFIds: pF.toTree().toIdentifiers(),
|
|
272
|
+
pFMathsIds: pFMaths.toTree().toIdentifiers(),
|
|
273
|
+
pGMathsIds: pGMaths.toTree().toIdentifiers(),
|
|
274
|
+
};
|
|
275
|
+
};
|
|
276
|
+
const getLyceeSituation = (params) => {
|
|
277
|
+
const { pFIds, pFMathsIds, pGMathsIds } = params;
|
|
278
|
+
const pF = reifyAlgebraic(pFIds);
|
|
279
|
+
const pFMaths = reifyAlgebraic(pFMathsIds);
|
|
280
|
+
const pGMaths = reifyAlgebraic(pGMathsIds);
|
|
281
|
+
return {
|
|
282
|
+
id: "lycee",
|
|
283
|
+
context: `Parmi les élèves de terminale d'un lycée, $${pF.toTex()}\\%$ sont des filles. $${pFMaths.toTex()}\\%$ des filles et $${pGMaths.toTex()}\\%$ des garçons suivent la spécialité maths.
|
|
284
|
+
|
|
285
|
+
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".`,
|
|
286
|
+
mainEvent: "F",
|
|
287
|
+
secondEvent: "M",
|
|
288
|
+
mainEventProba: pF,
|
|
289
|
+
firstCondProba: pFMaths,
|
|
290
|
+
secondCondProba: pGMaths,
|
|
291
|
+
keys: ["F", "M", "overlineF", "overlineM", "percent"],
|
|
292
|
+
tree: [
|
|
293
|
+
[
|
|
294
|
+
[
|
|
295
|
+
[`${pF.toTex()}\\%`, "F"],
|
|
296
|
+
[`${substract(100, pF).simplify().toTex()}\\%`, "\\overline{F}"],
|
|
297
|
+
],
|
|
298
|
+
],
|
|
299
|
+
[
|
|
300
|
+
[
|
|
301
|
+
[`${pFMaths.toTex()}\\%`, "M"],
|
|
302
|
+
[`${substract(100, pFMaths).simplify().toTex()}\\%`, "\\overline{M}"],
|
|
303
|
+
],
|
|
304
|
+
[
|
|
305
|
+
[`${pGMaths.toTex()}\\%`, "M"],
|
|
306
|
+
[`${substract(100, pGMaths).simplify().toTex()}\\%`, "\\overline{M}"],
|
|
307
|
+
],
|
|
308
|
+
],
|
|
309
|
+
],
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
export const getProbaTreeSituation = (params) => {
|
|
313
|
+
switch (params.id) {
|
|
314
|
+
case "virus":
|
|
315
|
+
return getVirusSituation(params);
|
|
316
|
+
case "dragee":
|
|
317
|
+
return getDrageeSituation(params);
|
|
318
|
+
case "usine":
|
|
319
|
+
return getUsineSituation(params);
|
|
320
|
+
case "match":
|
|
321
|
+
return geMatchSituation(params);
|
|
322
|
+
case "lycee":
|
|
323
|
+
return getLyceeSituation(params);
|
|
324
|
+
case "car":
|
|
325
|
+
return getCarSituation(params);
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
export const buildProbaTreeSituation = () => {
|
|
329
|
+
const id = random(["virus", "usine", "dragee", "match", "car", "lycee"]);
|
|
330
|
+
switch (id) {
|
|
331
|
+
case "virus":
|
|
332
|
+
return { ...buildVirusParams(), id: "virus" };
|
|
333
|
+
case "usine":
|
|
334
|
+
return { ...buildUsineParams(), id: "usine" };
|
|
335
|
+
case "dragee":
|
|
336
|
+
return { ...buildDrageeParams(), id: "dragee" };
|
|
337
|
+
case "match":
|
|
338
|
+
return { ...buildMatchParams(), id: "match" };
|
|
339
|
+
case "lycee":
|
|
340
|
+
return { ...buildLyceeParams(), id: "lycee" };
|
|
341
|
+
case "car":
|
|
342
|
+
return { ...buildCarParams(), id: "car" };
|
|
343
|
+
}
|
|
344
|
+
};
|
|
@@ -42,7 +42,7 @@ const isAnswerValid = () => {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
const getTreeInInstructionQuestion = () => {
|
|
45
|
-
const steps = randint(2, 4);
|
|
45
|
+
// const steps = randint(2, 4);
|
|
46
46
|
const randomBlock = () => {
|
|
47
47
|
const branches = randint(2, 4);
|
|
48
48
|
const isDecimal = coinFlip();
|
|
@@ -65,15 +65,15 @@ const getTreeInInstructionQuestion = () => {
|
|
|
65
65
|
for (let i = 0; i < firstBlockLength; i++) {
|
|
66
66
|
tree[1].push(randomBlock());
|
|
67
67
|
}
|
|
68
|
-
if (steps === 3) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
68
|
+
// if (steps === 3) {
|
|
69
|
+
// tree.push([]);
|
|
70
|
+
// tree[1].forEach((block) => {
|
|
71
|
+
// const length = block.length;
|
|
72
|
+
// for (let i = 0; i < length; i++) {
|
|
73
|
+
// tree[2].push(randomBlock());
|
|
74
|
+
// }
|
|
75
|
+
// });
|
|
76
|
+
// }
|
|
77
77
|
const identifiers = {
|
|
78
78
|
tree,
|
|
79
79
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/limits/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/limits/index.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
2
|
+
// export * from "./sequenceLimitReading.js";
|
|
@@ -192,7 +192,7 @@ export const cosInequationMainInterval = {
|
|
|
192
192
|
id: "cosInequationMainInterval",
|
|
193
193
|
label: "Résoudre une inéquation du type $\\cos(x)\\leq k$ sur $]-\\pi; \\pi]$",
|
|
194
194
|
isSingleStep: true,
|
|
195
|
-
generator: (nb, opts) => getDistinctQuestions(() => getCosInequationMainIntervalQuestion(opts), nb,
|
|
195
|
+
generator: (nb, opts) => getDistinctQuestions(() => getCosInequationMainIntervalQuestion(opts), nb, 15),
|
|
196
196
|
qcmTimer: 60,
|
|
197
197
|
freeTimer: 60,
|
|
198
198
|
getPropositions,
|
|
@@ -204,5 +204,5 @@ export const cosInequationMainInterval = {
|
|
|
204
204
|
getAnswer,
|
|
205
205
|
getQuestionFromIdentifiers,
|
|
206
206
|
hasHintAndCorrection: true,
|
|
207
|
-
maxAllowedQuestions:
|
|
207
|
+
maxAllowedQuestions: 15,
|
|
208
208
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"percentVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/percentVEA.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"varLineVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/varLineVEA.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,EAAE,EAAE,EAAE,aAAa,MAAM,EAAE,EAAE,
|
|
1
|
+
{"version":3,"file":"varLineVEA.d.ts","sourceRoot":"","sources":["../../../src/exercises/vea/varLineVEA.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,EAAE,EAAE,EAAE,aAAa,MAAM,EAAE,EAAE,YAoClE,CAAC"}
|
|
@@ -29,19 +29,22 @@ export const varLineVEA = (ans, answerTable) => {
|
|
|
29
29
|
return false;
|
|
30
30
|
for (let i = 0; i < flattenedAns.length; i++) {
|
|
31
31
|
const value = flattenedAns[i];
|
|
32
|
-
if (
|
|
33
|
-
if (
|
|
32
|
+
if (flattenedAnswerTable[i] === "\\nearrow") {
|
|
33
|
+
if (value !== "\\nearrow")
|
|
34
34
|
return false;
|
|
35
35
|
continue;
|
|
36
36
|
}
|
|
37
|
-
else if (
|
|
38
|
-
if (
|
|
37
|
+
else if (flattenedAnswerTable[i] === "\\searrow") {
|
|
38
|
+
if (value !== "\\searrow")
|
|
39
39
|
return false;
|
|
40
40
|
continue;
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
|
|
44
|
-
rationalVEA(value, flattenedAnswerTable[i])
|
|
43
|
+
const isValid = (!isValue(value) && !isValue(flattenedAnswerTable[i])) ||
|
|
44
|
+
rationalVEA(value, flattenedAnswerTable[i]);
|
|
45
|
+
if (!isValid)
|
|
46
|
+
return false;
|
|
47
|
+
continue;
|
|
45
48
|
}
|
|
46
49
|
}
|
|
47
50
|
return true;
|