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.
Files changed (63) hide show
  1. package/lib/exercises/exercise.d.ts +9 -0
  2. package/lib/exercises/exercise.d.ts.map +1 -1
  3. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
  4. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +33 -1
  5. package/lib/exercises/math/probaStat/index.d.ts +1 -1
  6. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  7. package/lib/exercises/math/probaStat/index.js +1 -2
  8. package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.d.ts.map +1 -1
  9. package/lib/exercises/math/probaStat/randomVariable/decideWhichGameIsLessRisky.js +0 -1
  10. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts +0 -7
  11. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -1
  12. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +154 -125
  13. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts +2 -2
  14. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationAverage.d.ts.map +1 -1
  15. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts +2 -2
  16. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationComputeProbability.d.ts.map +1 -1
  17. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts +2 -2
  18. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationIsGameFavorable.d.ts.map +1 -1
  19. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts +2 -2
  20. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
  21. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +1 -1
  22. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts +2 -2
  23. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationStandardDeviation.d.ts.map +1 -1
  24. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts +2 -2
  25. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationValues.d.ts.map +1 -1
  26. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts +2 -2
  27. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationVariance.d.ts.map +1 -1
  28. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts +3 -3
  29. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
  30. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +1 -1
  31. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts +6 -0
  32. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
  33. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +199 -68
  34. package/lib/exercises/math/probaStat/trees/fillProbaTreeWithComplementaryProbabilities.js +12 -12
  35. package/lib/exercises/math/probaStat/trees/index.d.ts +3 -1
  36. package/lib/exercises/math/probaStat/trees/index.d.ts.map +1 -1
  37. package/lib/exercises/math/probaStat/trees/index.js +5 -1
  38. package/lib/exercises/math/probaStat/trees/probaTreeSituationTotalProbaFormula.d.ts +2 -0
  39. package/lib/exercises/math/probaStat/trees/probaTreeSituationTotalProbaFormula.d.ts.map +1 -0
  40. package/lib/exercises/math/probaStat/trees/probaTreeSituationTotalProbaFormula.js +80 -0
  41. package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts +60 -0
  42. package/lib/exercises/math/probaStat/trees/probaTreeSituations.d.ts.map +1 -1
  43. package/lib/exercises/math/probaStat/trees/probaTreeSituations.js +344 -108
  44. package/lib/exercises/math/probaStat/trees/treeInInstruction.js +10 -10
  45. package/lib/exercises/math/sequences/limits/index.d.ts +1 -1
  46. package/lib/exercises/math/sequences/limits/index.d.ts.map +1 -1
  47. package/lib/exercises/math/sequences/limits/index.js +2 -1
  48. package/lib/exercises/math/trigonometry/functions/cosInequationMainInterval.js +2 -2
  49. package/lib/exercises/vea/percentVEA.d.ts +2 -0
  50. package/lib/exercises/vea/percentVEA.d.ts.map +1 -0
  51. package/lib/exercises/vea/percentVEA.js +1 -0
  52. package/lib/exercises/vea/varLineVEA.d.ts.map +1 -1
  53. package/lib/exercises/vea/varLineVEA.js +9 -6
  54. package/lib/index.d.ts +31 -19
  55. package/lib/index.d.ts.map +1 -1
  56. package/lib/server.js +22 -0
  57. package/lib/tests/exoTest.d.ts.map +1 -1
  58. package/lib/tests/exoTest.js +2 -0
  59. package/lib/tests/questionTest.d.ts.map +1 -1
  60. package/lib/tests/questionTest.js +14 -2
  61. package/lib/types/keyIds.d.ts +1 -1
  62. package/lib/types/keyIds.d.ts.map +1 -1
  63. package/package.json +1 -1
@@ -1,108 +1,344 @@
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
- // };
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
- 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
- }
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 * from "./sequenceLimitReading.js";
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":"AAAA,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/sequences/limits/index.ts"],"names":[],"mappings":""}
@@ -1 +1,2 @@
1
- export * from "./sequenceLimitReading.js";
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, 20),
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: 20,
207
+ maxAllowedQuestions: 15,
208
208
  };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=percentVEA.d.ts.map
@@ -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,YAmClE,CAAC"}
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 (value === "\\nearrow") {
33
- if (flattenedAnswerTable[i] !== "\\nearrow")
32
+ if (flattenedAnswerTable[i] === "\\nearrow") {
33
+ if (value !== "\\nearrow")
34
34
  return false;
35
35
  continue;
36
36
  }
37
- else if (value === "\\searrow") {
38
- if (flattenedAnswerTable[i] !== "\\searrow")
37
+ else if (flattenedAnswerTable[i] === "\\searrow") {
38
+ if (value !== "\\searrow")
39
39
  return false;
40
40
  continue;
41
41
  }
42
42
  else {
43
- return ((!isValue(value) && !isValue(flattenedAnswerTable[i])) ||
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;