math-exercises 2.0.34 → 2.0.36

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 (109) hide show
  1. package/lib/exercises/calculLitteral/simplifying/distributeAndSimplify.d.ts +14 -0
  2. package/lib/exercises/calculLitteral/simplifying/distributeAndSimplify.d.ts.map +1 -0
  3. package/lib/exercises/calculLitteral/simplifying/distributeAndSimplify.js +67 -0
  4. package/lib/exercises/calculLitteral/simplifying/index.d.ts +1 -0
  5. package/lib/exercises/calculLitteral/simplifying/index.d.ts.map +1 -1
  6. package/lib/exercises/calculLitteral/simplifying/index.js +1 -0
  7. package/lib/exercises/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts +10 -0
  8. package/lib/exercises/equaDiff/equaDiffCheckSolutionFirstOrder.d.ts.map +1 -0
  9. package/lib/exercises/equaDiff/equaDiffCheckSolutionFirstOrder.js +101 -0
  10. package/lib/exercises/equaDiff/index.d.ts +1 -0
  11. package/lib/exercises/equaDiff/index.d.ts.map +1 -1
  12. package/lib/exercises/equaDiff/index.js +1 -0
  13. package/lib/exercises/exercise.d.ts +1 -0
  14. package/lib/exercises/exercise.d.ts.map +1 -1
  15. package/lib/exercises/functions/trinoms/factorizedFormFromRoots.d.ts +8 -0
  16. package/lib/exercises/functions/trinoms/factorizedFormFromRoots.d.ts.map +1 -0
  17. package/lib/exercises/functions/trinoms/factorizedFormFromRoots.js +67 -0
  18. package/lib/exercises/functions/trinoms/index.d.ts +5 -0
  19. package/lib/exercises/functions/trinoms/index.d.ts.map +1 -1
  20. package/lib/exercises/functions/trinoms/index.js +5 -0
  21. package/lib/exercises/functions/trinoms/rootsReading.d.ts +9 -0
  22. package/lib/exercises/functions/trinoms/rootsReading.d.ts.map +1 -0
  23. package/lib/exercises/functions/trinoms/rootsReading.js +67 -0
  24. package/lib/exercises/functions/trinoms/summitAbscissFromDevForm.d.ts +9 -0
  25. package/lib/exercises/functions/trinoms/summitAbscissFromDevForm.d.ts.map +1 -0
  26. package/lib/exercises/functions/trinoms/summitAbscissFromDevForm.js +54 -0
  27. package/lib/exercises/functions/trinoms/summitAbscissFromRoots.d.ts +9 -0
  28. package/lib/exercises/functions/trinoms/summitAbscissFromRoots.d.ts.map +1 -0
  29. package/lib/exercises/functions/trinoms/summitAbscissFromRoots.js +59 -0
  30. package/lib/exercises/functions/trinoms/summitReading.d.ts +9 -0
  31. package/lib/exercises/functions/trinoms/summitReading.d.ts.map +1 -0
  32. package/lib/exercises/functions/trinoms/summitReading.js +59 -0
  33. package/lib/exercises/geometry/vectors/equalCaracteristicFromGraph.d.ts +9 -0
  34. package/lib/exercises/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -0
  35. package/lib/exercises/geometry/vectors/equalCaracteristicFromGraph.js +194 -0
  36. package/lib/exercises/geometry/vectors/index.d.ts +1 -0
  37. package/lib/exercises/geometry/vectors/index.d.ts.map +1 -1
  38. package/lib/exercises/geometry/vectors/index.js +1 -0
  39. package/lib/exercises/matrices/index.d.ts +1 -0
  40. package/lib/exercises/matrices/index.d.ts.map +1 -1
  41. package/lib/exercises/matrices/index.js +2 -0
  42. package/lib/exercises/matrices/matrixGeneralTerm.d.ts +10 -0
  43. package/lib/exercises/matrices/matrixGeneralTerm.d.ts.map +1 -0
  44. package/lib/exercises/matrices/matrixGeneralTerm.js +57 -0
  45. package/lib/exercises/matrices/productCell.d.ts +10 -0
  46. package/lib/exercises/matrices/productCell.d.ts.map +1 -0
  47. package/lib/exercises/matrices/productCell.js +57 -0
  48. package/lib/exercises/probaStat/index.d.ts +3 -0
  49. package/lib/exercises/probaStat/index.d.ts.map +1 -1
  50. package/lib/exercises/probaStat/index.js +3 -0
  51. package/lib/exercises/probaStat/issuesCountingForCards.d.ts +7 -0
  52. package/lib/exercises/probaStat/issuesCountingForCards.d.ts.map +1 -0
  53. package/lib/exercises/probaStat/issuesCountingForCards.js +78 -0
  54. package/lib/exercises/probaStat/probaFromTableNoContext.d.ts +13 -0
  55. package/lib/exercises/probaStat/probaFromTableNoContext.d.ts.map +1 -0
  56. package/lib/exercises/probaStat/probaFromTableNoContext.js +115 -0
  57. package/lib/exercises/probaStat/probaFromTableWithContext.d.ts +13 -0
  58. package/lib/exercises/probaStat/probaFromTableWithContext.d.ts.map +1 -0
  59. package/lib/exercises/probaStat/probaFromTableWithContext.js +121 -0
  60. package/lib/exercises/python/index.d.ts +1 -0
  61. package/lib/exercises/python/index.d.ts.map +1 -0
  62. package/lib/exercises/python/index.js +1 -0
  63. package/lib/exercises/sequences/arithmetic/index.d.ts +4 -0
  64. package/lib/exercises/sequences/arithmetic/index.d.ts.map +1 -1
  65. package/lib/exercises/sequences/arithmetic/index.js +4 -0
  66. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts +8 -0
  67. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -0
  68. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +71 -0
  69. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts +8 -0
  70. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromGraph.d.ts.map +1 -0
  71. package/lib/exercises/sequences/arithmetic/recognizeArithmeticFromGraph.js +87 -0
  72. package/lib/exercises/sequences/arithmetic/recognizeReasonFromFirstTerms.d.ts +8 -0
  73. package/lib/exercises/sequences/arithmetic/recognizeReasonFromFirstTerms.d.ts.map +1 -0
  74. package/lib/exercises/sequences/arithmetic/recognizeReasonFromFirstTerms.js +44 -0
  75. package/lib/exercises/sequences/arithmetic/recognizeReasonFromGraph.d.ts +8 -0
  76. package/lib/exercises/sequences/arithmetic/recognizeReasonFromGraph.d.ts.map +1 -0
  77. package/lib/exercises/sequences/arithmetic/recognizeReasonFromGraph.js +58 -0
  78. package/lib/exercises/utils/getDistinctQuestions.d.ts.map +1 -1
  79. package/lib/exercises/utils/getDistinctQuestions.js +1 -0
  80. package/lib/geogebra/geogebraConstructor.d.ts +2 -0
  81. package/lib/geogebra/geogebraConstructor.d.ts.map +1 -1
  82. package/lib/geogebra/geogebraConstructor.js +2 -0
  83. package/lib/index.d.ts +72 -0
  84. package/lib/index.d.ts.map +1 -1
  85. package/lib/math/geometry/point.d.ts +1 -0
  86. package/lib/math/geometry/point.d.ts.map +1 -1
  87. package/lib/math/geometry/point.js +3 -0
  88. package/lib/math/matrices/matrix.d.ts +3 -0
  89. package/lib/math/matrices/matrix.d.ts.map +1 -1
  90. package/lib/math/matrices/matrix.js +10 -2
  91. package/lib/math/polynomials/trinom.d.ts +2 -0
  92. package/lib/math/polynomials/trinom.d.ts.map +1 -1
  93. package/lib/math/polynomials/trinom.js +32 -0
  94. package/lib/math/utils/random/randTupleInt.d.ts +1 -1
  95. package/lib/math/utils/random/randTupleInt.js +1 -1
  96. package/lib/math/utils/random/randfloat.d.ts +5 -0
  97. package/lib/math/utils/random/randfloat.d.ts.map +1 -0
  98. package/lib/math/utils/random/randfloat.js +18 -0
  99. package/lib/math/utils/sum.d.ts +8 -0
  100. package/lib/math/utils/sum.d.ts.map +1 -0
  101. package/lib/math/utils/sum.js +17 -0
  102. package/lib/tree/nodes/algebraicNode.d.ts +1 -0
  103. package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
  104. package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
  105. package/lib/tree/nodes/operators/powerNode.js +3 -1
  106. package/lib/utils/doWhile.d.ts +2 -0
  107. package/lib/utils/doWhile.d.ts.map +1 -0
  108. package/lib/utils/doWhile.js +11 -0
  109. package/package.json +1 -1
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.summitReading = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const colors_1 = require("../../../geogebra/colors");
7
+ const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
8
+ const point_1 = require("../../../math/geometry/point");
9
+ const trinom_1 = require("../../../math/polynomials/trinom");
10
+ const randint_1 = require("../../../math/utils/random/randint");
11
+ const getSummitReadingQuestion = () => {
12
+ const trinom = trinom_1.TrinomConstructor.randomCanonical();
13
+ const commands = [
14
+ `f(x) = ${trinom.toString()}`,
15
+ `SetColor(f, "${(0, colors_1.randomColor)()}")`,
16
+ ];
17
+ const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
18
+ isGridSimple: true,
19
+ });
20
+ const answer = trinom.getSommet().toCoords();
21
+ const question = {
22
+ answer,
23
+ instruction: `Déterminer les coordonnées du sommet de la parabole représentée ci-dessous :`,
24
+ keys: ["leftParenthesis", "semicolon", "rightParenthesis"],
25
+ commands: ggb.commands,
26
+ options: ggb.getOptions(),
27
+ coords: trinom.getCoords(),
28
+ answerFormat: "tex",
29
+ identifiers: { a: trinom.a, b: trinom.b, c: trinom.c },
30
+ };
31
+ return question;
32
+ };
33
+ const getPropositions = (n, { answer, a, b, c }) => {
34
+ const propositions = [];
35
+ const trinom = new trinom_1.Trinom(a, b, c);
36
+ const alpha = trinom.getAlpha();
37
+ const beta = trinom.getBeta();
38
+ (0, exercise_1.addValidProp)(propositions, answer);
39
+ (0, exercise_1.tryToAddWrongProp)(propositions, new point_1.Point("S", beta.toTree(), alpha.toTree()).toCoords());
40
+ while (propositions.length < n) {
41
+ (0, exercise_1.tryToAddWrongProp)(propositions, new point_1.Point("S", (0, randint_1.randint)(-10, 10).toTree(), (0, randint_1.randint)(-10, 10).toTree()).toCoords());
42
+ }
43
+ return (0, exercise_1.shuffleProps)(propositions, n);
44
+ };
45
+ const isAnswerValid = (ans, { answer }) => {
46
+ return ans === answer;
47
+ };
48
+ exports.summitReading = {
49
+ id: "summitReading",
50
+ label: "Déterminer graphiquement les coordonnées du sommet d'une parabole",
51
+ levels: ["1rePro", "1reSpé"],
52
+ isSingleStep: true,
53
+ sections: ["Second degré"],
54
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getSummitReadingQuestion, nb),
55
+ qcmTimer: 60,
56
+ freeTimer: 60,
57
+ getPropositions,
58
+ isAnswerValid,
59
+ };
@@ -0,0 +1,9 @@
1
+ import { MathExercise } from "../../../exercises/exercise";
2
+ type Identifiers = {
3
+ caracAsked: string;
4
+ uPoints: number[][];
5
+ vPoints: number[][];
6
+ };
7
+ export declare const equalCaracteristicFromGraph: MathExercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=equalCaracteristicFromGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"equalCaracteristicFromGraph.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/equalCaracteristicFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;CACrB,CAAC;AAwLF,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,WAAW,CAajE,CAAC"}
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.equalCaracteristicFromGraph = void 0;
4
+ const exercise_1 = require("../../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../../exercises/utils/getDistinctQuestions");
6
+ const geogebraConstructor_1 = require("../../../geogebra/geogebraConstructor");
7
+ const randfloat_1 = require("../../../math/utils/random/randfloat");
8
+ const coinFlip_1 = require("../../../utils/coinFlip");
9
+ const random_1 = require("../../../utils/random");
10
+ /**
11
+ *
12
+ * Soient deux cercles C1 et C2 de rayon 3 et de centres (-4,0) et (4,0)
13
+ * on construit u dans C1 et v dans C2
14
+ */
15
+ const getEqualCaracteristicFromGraphQuestion = () => {
16
+ let points = [];
17
+ // const caracAsked = random(["sens", "direction", "norme"]);
18
+ let instruction = "";
19
+ const caracAsked = (0, random_1.random)(["opposes"]);
20
+ // ["sens", "norme", "direction", "egaux", "opposes"]
21
+ const isTrue = (0, coinFlip_1.coinFlip)();
22
+ let uPoints = [];
23
+ let vPoints = [];
24
+ //On construit u dans C1
25
+ const theta = Math.random() * 2 * Math.PI;
26
+ uPoints.push([3 * Math.cos(theta) - 4, 3 * Math.sin(theta)]);
27
+ uPoints.push([
28
+ 3 * Math.cos(theta + Math.PI) - 4,
29
+ 3 * Math.sin(theta + Math.PI),
30
+ ]);
31
+ let thetaPrime;
32
+ let sameDirection;
33
+ let sameNorm;
34
+ let sameSens;
35
+ let rho;
36
+ switch (caracAsked) {
37
+ case "direction":
38
+ instruction = "avoir la même direction";
39
+ thetaPrime = isTrue
40
+ ? theta
41
+ : theta + (0, randfloat_1.randfloat)(1 / 4, 1 / 3) * Math.PI * 2;
42
+ sameNorm = (0, coinFlip_1.coinFlip)();
43
+ rho = sameNorm ? 3 : (0, randfloat_1.randfloat)(1, 2.5);
44
+ vPoints.push([
45
+ rho * Math.cos(thetaPrime) + 4,
46
+ rho * Math.sin(thetaPrime),
47
+ ]);
48
+ vPoints.push([
49
+ rho * Math.cos(thetaPrime + Math.PI) + 4,
50
+ rho * Math.sin(thetaPrime + Math.PI),
51
+ ]);
52
+ if ((0, coinFlip_1.coinFlip)())
53
+ uPoints = [uPoints[1], uPoints[0]];
54
+ if ((0, coinFlip_1.coinFlip)())
55
+ [uPoints, vPoints] = [vPoints, uPoints];
56
+ break;
57
+ case "norme":
58
+ instruction = "avoir la même norme";
59
+ sameDirection = (0, coinFlip_1.coinFlip)();
60
+ thetaPrime = sameDirection ? theta : Math.random() * 2 * Math.PI;
61
+ if (isTrue) {
62
+ vPoints.push([3 * Math.cos(thetaPrime) + 4, 3 * Math.sin(thetaPrime)]);
63
+ vPoints.push([
64
+ 3 * Math.cos(thetaPrime + Math.PI) + 4,
65
+ 3 * Math.sin(thetaPrime + Math.PI),
66
+ ]);
67
+ }
68
+ else {
69
+ vPoints.push([Math.cos(thetaPrime) + 4, Math.sin(thetaPrime)]);
70
+ vPoints.push([
71
+ Math.cos(thetaPrime + Math.PI) + 4,
72
+ Math.sin(thetaPrime + Math.PI),
73
+ ]);
74
+ }
75
+ if ((0, coinFlip_1.coinFlip)())
76
+ uPoints = [uPoints[1], uPoints[0]];
77
+ if ((0, coinFlip_1.coinFlip)())
78
+ [uPoints, vPoints] = [vPoints, uPoints];
79
+ break;
80
+ case "sens":
81
+ instruction = "avoir le même sens";
82
+ sameDirection = (0, coinFlip_1.coinFlip)();
83
+ sameNorm = (0, coinFlip_1.coinFlip)();
84
+ thetaPrime =
85
+ isTrue || sameDirection
86
+ ? theta
87
+ : theta + (0, randfloat_1.randfloat)(1 / 4, 1 / 3) * Math.PI * 2;
88
+ rho = sameNorm ? 3 : (0, randfloat_1.randfloat)(1, 2.5);
89
+ vPoints.push([
90
+ rho * Math.cos(thetaPrime) + 4,
91
+ rho * Math.sin(thetaPrime),
92
+ ]);
93
+ vPoints.push([
94
+ rho * Math.cos(thetaPrime + Math.PI) + 4,
95
+ rho * Math.sin(thetaPrime + Math.PI),
96
+ ]);
97
+ if (!isTrue)
98
+ vPoints = [vPoints[1], vPoints[0]];
99
+ if ((0, coinFlip_1.coinFlip)())
100
+ [uPoints, vPoints] = [vPoints, uPoints];
101
+ break;
102
+ case "egaux":
103
+ instruction = "être égaux";
104
+ sameDirection = isTrue || (0, coinFlip_1.coinFlip)();
105
+ sameNorm = isTrue || (0, coinFlip_1.coinFlip)();
106
+ sameSens = isTrue || (sameDirection && sameNorm ? false : (0, coinFlip_1.coinFlip)());
107
+ thetaPrime = sameDirection
108
+ ? theta
109
+ : theta + (0, randfloat_1.randfloat)(1 / 4, 1 / 3) * Math.PI * 2;
110
+ rho = sameNorm ? 3 : (0, randfloat_1.randfloat)(1, 2);
111
+ vPoints.push([
112
+ rho * Math.cos(thetaPrime) + 4,
113
+ rho * Math.sin(thetaPrime),
114
+ ]);
115
+ vPoints.push([
116
+ rho * Math.cos(thetaPrime + Math.PI) + 4,
117
+ rho * Math.sin(thetaPrime + Math.PI),
118
+ ]);
119
+ if (!sameSens)
120
+ vPoints = [vPoints[1], vPoints[0]];
121
+ if ((0, coinFlip_1.coinFlip)())
122
+ [uPoints, vPoints] = [vPoints, uPoints];
123
+ break;
124
+ case "opposes":
125
+ instruction = "être opposés";
126
+ sameDirection = isTrue || (0, coinFlip_1.coinFlip)();
127
+ sameNorm = isTrue || (0, coinFlip_1.coinFlip)();
128
+ sameSens = !isTrue || (sameDirection && sameNorm ? false : (0, coinFlip_1.coinFlip)());
129
+ thetaPrime = sameDirection
130
+ ? theta
131
+ : theta + (0, randfloat_1.randfloat)(1 / 4, 1 / 3) * Math.PI * 2;
132
+ rho = sameNorm ? 3 : (0, randfloat_1.randfloat)(1, 2.5);
133
+ vPoints.push([
134
+ rho * Math.cos(thetaPrime) + 4,
135
+ rho * Math.sin(thetaPrime),
136
+ ]);
137
+ vPoints.push([
138
+ rho * Math.cos(thetaPrime + Math.PI) + 4,
139
+ rho * Math.sin(thetaPrime + Math.PI),
140
+ ]);
141
+ if (!sameSens)
142
+ vPoints = [vPoints[1], vPoints[0]];
143
+ if ((0, coinFlip_1.coinFlip)())
144
+ [uPoints, vPoints] = [vPoints, uPoints];
145
+ break;
146
+ }
147
+ const commands = [
148
+ `u = Vector((${uPoints[0][0]},${uPoints[0][1]}), (${uPoints[1][0]},${uPoints[1][1]}))`,
149
+ `v = Vector((${vPoints[0][0]},${vPoints[0][1]}), (${vPoints[1][0]},${vPoints[1][1]}))`,
150
+ 'SetCaption(u, "$\\overrightarrow u$")',
151
+ 'SetCaption(v, "$\\overrightarrow v$")',
152
+ "ShowLabel(u, true)",
153
+ "ShowLabel(v,true)",
154
+ ];
155
+ const ggb = new geogebraConstructor_1.GeogebraConstructor(commands, {
156
+ isGridSimple: true,
157
+ hideAxes: true,
158
+ });
159
+ const answer = isTrue ? "Oui" : "Non";
160
+ const question = {
161
+ answer,
162
+ instruction: `Les vecteurs $\\overrightarrow{u}$ et $\\overrightarrow{v}$ suivants semblent-ils ${instruction} ?`,
163
+ keys: [],
164
+ commands: ggb.commands,
165
+ options: ggb.getOptions(),
166
+ coords: [-8, 8, -4, 4],
167
+ answerFormat: "tex",
168
+ identifiers: { caracAsked, uPoints, vPoints },
169
+ };
170
+ return question;
171
+ };
172
+ const getPropositions = (n, { answer }) => {
173
+ const propositions = [];
174
+ (0, exercise_1.addValidProp)(propositions, answer, "raw");
175
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Oui", "raw");
176
+ (0, exercise_1.tryToAddWrongProp)(propositions, "Non", "raw");
177
+ return (0, exercise_1.shuffleProps)(propositions, n);
178
+ };
179
+ const isAnswerValid = (ans, { answer }) => {
180
+ return ans === answer;
181
+ };
182
+ exports.equalCaracteristicFromGraph = {
183
+ id: "equalCaracteristicFromGraph",
184
+ label: "Direction, sens, norme, égalité, opposés",
185
+ levels: ["2nde"],
186
+ isSingleStep: true,
187
+ sections: ["Vecteurs"],
188
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getEqualCaracteristicFromGraphQuestion, nb),
189
+ qcmTimer: 60,
190
+ freeTimer: 60,
191
+ getPropositions,
192
+ isAnswerValid,
193
+ answerType: "QCM",
194
+ };
@@ -9,4 +9,5 @@ export * from "./alignementViaColinearity";
9
9
  export * from "./paralellismViaColinearity";
10
10
  export * from "./parallelogramViaEqualVectors";
11
11
  export * from "./fourthParallelogramPoint";
12
+ export * from "./equalCaracteristicFromGraph";
12
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/geometry/vectors/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC;AACzC,cAAc,kCAAkC,CAAC;AACjD,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC"}
@@ -25,3 +25,4 @@ __exportStar(require("./alignementViaColinearity"), exports);
25
25
  __exportStar(require("./paralellismViaColinearity"), exports);
26
26
  __exportStar(require("./parallelogramViaEqualVectors"), exports);
27
27
  __exportStar(require("./fourthParallelogramPoint"), exports);
28
+ __exportStar(require("./equalCaracteristicFromGraph"), exports);
@@ -1,2 +1,3 @@
1
1
  export * from "./matrixInversibilityDomain";
2
+ export * from "./productCell";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/matrices/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/matrices/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC"}
@@ -15,3 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./matrixInversibilityDomain"), exports);
18
+ __exportStar(require("./productCell"), exports);
19
+ // export * from "./matrixGeneralTerm";
@@ -0,0 +1,10 @@
1
+ import { MathExercise } from "../../exercises/exercise";
2
+ type Identifiers = {
3
+ n: number;
4
+ p: number;
5
+ alpha: number;
6
+ beta: number;
7
+ };
8
+ export declare const matrixGeneralTerm: MathExercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=matrixGeneralTerm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"matrixGeneralTerm.d.ts","sourceRoot":"","sources":["../../../src/exercises/matrices/matrixGeneralTerm.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAsDF,eAAO,MAAM,iBAAiB,EAAE,YAAY,CAAC,WAAW,CAavD,CAAC"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.matrixGeneralTerm = void 0;
4
+ const exercise_1 = require("../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
6
+ const matrix_1 = require("../../math/matrices/matrix");
7
+ const randint_1 = require("../../math/utils/random/randint");
8
+ const addNode_1 = require("../../tree/nodes/operators/addNode");
9
+ const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
10
+ const variableNode_1 = require("../../tree/nodes/variables/variableNode");
11
+ const doWhile_1 = require("../../utils/doWhile");
12
+ //A d'ordre nxp avec a_(i,j) = alpha*i + beta*j
13
+ const getMatrixGeneralTermQuestion = () => {
14
+ const n = (0, randint_1.randint)(1, 5);
15
+ const p = (0, doWhile_1.doWhile)(() => (0, randint_1.randint)(1, 5), (res) => n === 1 && res === 1);
16
+ const alpha = (0, randint_1.randint)(-5, 6, [0]);
17
+ const beta = (0, randint_1.randint)(-5, 6, [0]);
18
+ const aij = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(alpha.toTree(), new variableNode_1.VariableNode("i")), new multiplyNode_1.MultiplyNode(beta.toTree(), new variableNode_1.VariableNode("j"))).simplify();
19
+ const elements = Array.from(Array(n), (_, rowIndex) => Array.from(Array(p), (__, colIndex) => (alpha * (rowIndex + 1) + beta * (colIndex + 1)).toTree()));
20
+ const matrix = new matrix_1.Matrix(elements);
21
+ const answer = matrix.toTex();
22
+ const question = {
23
+ answer,
24
+ instruction: `Soit $A = (a_{i,j})$ une matrice d'ordre $n \\times p$ telle que : $n = ${n}$, $p = ${p}$ et pour tout $1\\leq i \\leq n$ et $1\\leq j \\leq p$, $a_{i,j} = ${aij.toTex()}$. Quelle est l'expression de la matrice $A$ ? `,
25
+ keys: [],
26
+ answerFormat: "tex",
27
+ identifiers: { n, p, alpha, beta },
28
+ };
29
+ return question;
30
+ };
31
+ const getPropositions = (nb, { answer, n, p, alpha, beta }) => {
32
+ const propositions = [];
33
+ (0, exercise_1.addValidProp)(propositions, answer);
34
+ const transposedElements = Array.from(Array(p), (_, rowIndex) => Array.from(Array(n), (__, colIndex) => (alpha * (rowIndex + 1) + beta * (colIndex + 1)).toTree()));
35
+ const matrix = new matrix_1.Matrix(transposedElements);
36
+ (0, exercise_1.tryToAddWrongProp)(propositions, matrix.toTex());
37
+ while (propositions.length < nb) {
38
+ (0, exercise_1.tryToAddWrongProp)(propositions, matrix_1.MatrixConstructor.random(n, p).toTex());
39
+ }
40
+ return (0, exercise_1.shuffleProps)(propositions, nb);
41
+ };
42
+ const isAnswerValid = (ans, { answer }) => {
43
+ return ans === answer;
44
+ };
45
+ exports.matrixGeneralTerm = {
46
+ id: "matrixGeneralTerm",
47
+ label: "Déterminer l'expression d'une matrice",
48
+ levels: ["MathExp"],
49
+ isSingleStep: true,
50
+ sections: ["Matrices"],
51
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getMatrixGeneralTermQuestion, nb),
52
+ qcmTimer: 60,
53
+ freeTimer: 60,
54
+ getPropositions,
55
+ isAnswerValid,
56
+ answerType: "QCM",
57
+ };
@@ -0,0 +1,10 @@
1
+ import { MathExercise } from "../../exercises/exercise";
2
+ type Identifiers = {
3
+ AiCoeff: number;
4
+ AjCoeff: number;
5
+ BiCoeff: number;
6
+ BjCoeff: number;
7
+ };
8
+ export declare const productCell: MathExercise<Identifiers>;
9
+ export {};
10
+ //# sourceMappingURL=productCell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"productCell.d.ts","sourceRoot":"","sources":["../../../src/exercises/matrices/productCell.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AASlC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAqDF,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,WAAW,CAYjD,CAAC"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.productCell = void 0;
4
+ const exercise_1 = require("../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
6
+ const randint_1 = require("../../math/utils/random/randint");
7
+ const sum_1 = require("../../math/utils/sum");
8
+ const addNode_1 = require("../../tree/nodes/operators/addNode");
9
+ const multiplyNode_1 = require("../../tree/nodes/operators/multiplyNode");
10
+ const variableNode_1 = require("../../tree/nodes/variables/variableNode");
11
+ const doWhile_1 = require("../../utils/doWhile");
12
+ //$A=(a_{i,j})$ avec $a_{i,j}=2i-j$ et $B=(b_{i,j})$ avec $b_{i,j}=i+j$ calculer $c_{2,3}$ Réponse: $c_{2,3} = \sum_{k=1}^{3} (2 \cdot 2 - k) \cdot (k + 3)$ $ c_{2,3} = (2 \cdot 2 - 1) \cdot (1 + 3) + (2 \cdot 2 - 2) \cdot (2 + 3) + (2 \cdot 2 - 3) \cdot (3 + 3)$ $c_{2,3}=3\times 4+2\times 5+1\times 6 =28$. Si l'élève détermine l'expression des matrices A et B puis effectue le calcul des bons blocs pour obtenir le coefficient cela est intéressant aussi ! Bonne journée merci
13
+ // Les matrices A et B sont définies par combinaisons linéaires de leurs lignes/colonnes
14
+ // exp a_(i,j) = 2i+j
15
+ const getProductCellQuestion = () => {
16
+ const i = (0, randint_1.randint)(1, 4);
17
+ const j = (0, randint_1.randint)(1, 4);
18
+ const AiCoeff = (0, randint_1.randint)(-3, 4, [0]);
19
+ const AjCoeff = (0, randint_1.randint)(-3, 4, [0]);
20
+ const BiCoeff = (0, randint_1.randint)(-3, 4, [0]);
21
+ const BjCoeff = (0, doWhile_1.doWhile)(() => (0, randint_1.randint)(-3, 4, [0]), (x) => BiCoeff === AiCoeff && x === AjCoeff);
22
+ const aij = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(AiCoeff.toTree(), new variableNode_1.VariableNode("i")), new multiplyNode_1.MultiplyNode(AjCoeff.toTree(), new variableNode_1.VariableNode("j"))).simplify();
23
+ const bij = new addNode_1.AddNode(new multiplyNode_1.MultiplyNode(BiCoeff.toTree(), new variableNode_1.VariableNode("i")), new multiplyNode_1.MultiplyNode(BjCoeff.toTree(), new variableNode_1.VariableNode("j"))).simplify();
24
+ const answer = (0, sum_1.sum)(1, 3, (k) => (AiCoeff * i + AjCoeff * k) * (BiCoeff * k + BjCoeff * j)) + "";
25
+ const question = {
26
+ answer,
27
+ instruction: `Soient $A = \\left(a_{i,j}\\right)$ et $B = \\left(b_{i,j}\\right)$ deux matrices carrées d'ordre $3$, avec $a_{i,j} = ${aij.toTex()}$ et $b_{i,j} = ${bij.toTex()}$. Soit $C = AB$. Calculer $c_{${i},${j}}$.`,
28
+ keys: [],
29
+ answerFormat: "tex",
30
+ identifiers: { AiCoeff, AjCoeff, BiCoeff, BjCoeff },
31
+ };
32
+ return question;
33
+ };
34
+ const getPropositions = (n, { answer }) => {
35
+ const propositions = [];
36
+ (0, exercise_1.addValidProp)(propositions, answer);
37
+ while (propositions.length < n) {
38
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(-100, 100) + "");
39
+ }
40
+ return (0, exercise_1.shuffleProps)(propositions, n);
41
+ };
42
+ const isAnswerValid = (ans, { answer }) => {
43
+ return ans === answer;
44
+ };
45
+ exports.productCell = {
46
+ id: "productCell",
47
+ connector: "=",
48
+ label: "Calculer un coefficient du produit de deux matrices",
49
+ levels: ["MathExp"],
50
+ isSingleStep: true,
51
+ sections: ["Matrices"],
52
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getProductCellQuestion, nb),
53
+ qcmTimer: 60,
54
+ freeTimer: 60,
55
+ getPropositions,
56
+ isAnswerValid,
57
+ };
@@ -6,4 +6,7 @@ export * from "./probabilityTree";
6
6
  export * from "./stats1var";
7
7
  export * from "./stats2var";
8
8
  export * from "./independancy";
9
+ export * from "./issuesCountingForCards";
10
+ export * from "./probaFromTableNoContext";
11
+ export * from "./probaFromTableWithContext";
9
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exercises/probaStat/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC"}
@@ -22,3 +22,6 @@ __exportStar(require("./probabilityTree"), exports);
22
22
  __exportStar(require("./stats1var"), exports);
23
23
  __exportStar(require("./stats2var"), exports);
24
24
  __exportStar(require("./independancy"), exports);
25
+ __exportStar(require("./issuesCountingForCards"), exports);
26
+ __exportStar(require("./probaFromTableNoContext"), exports);
27
+ __exportStar(require("./probaFromTableWithContext"), exports);
@@ -0,0 +1,7 @@
1
+ import { MathExercise } from "../../exercises/exercise";
2
+ type Identifiers = {
3
+ questionType: string;
4
+ };
5
+ export declare const issuesCountingForCards: MathExercise<Identifiers>;
6
+ export {};
7
+ //# sourceMappingURL=issuesCountingForCards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issuesCountingForCards.d.ts","sourceRoot":"","sources":["../../../src/exercises/probaStat/issuesCountingForCards.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAQlC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAiEF,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,WAAW,CAa5D,CAAC"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.issuesCountingForCards = void 0;
4
+ const exercise_1 = require("../../exercises/exercise");
5
+ const getDistinctQuestions_1 = require("../../exercises/utils/getDistinctQuestions");
6
+ const randint_1 = require("../../math/utils/random/randint");
7
+ const probaLawFlip_1 = require("../../utils/probaLawFlip");
8
+ const random_1 = require("../../utils/random");
9
+ const randomEnumValue_1 = require("../../utils/randomEnumValue");
10
+ const cardsData_1 = require("../utils/cardsData");
11
+ const getIssuesCountingForCardsQuestion = () => {
12
+ const questionType = (0, probaLawFlip_1.probaLawFlip)([
13
+ ["oneCard", 0.25],
14
+ ["valueCard", 0.25],
15
+ ["suitCard", 0.25],
16
+ ["colorCard", 0.25],
17
+ ]);
18
+ let answer = "";
19
+ let target = "";
20
+ let value;
21
+ let color;
22
+ switch (questionType) {
23
+ case "oneCard":
24
+ value = (0, randomEnumValue_1.randomEnumValue)(cardsData_1.CardsValues);
25
+ color = (0, randomEnumValue_1.randomEnumValue)(cardsData_1.CardsColor);
26
+ target = `${value === "dame" ? "une" : "un"} ${value} de ${color}`;
27
+ answer = `1`;
28
+ break;
29
+ case "valueCard":
30
+ value = (0, randomEnumValue_1.randomEnumValue)(cardsData_1.CardsValues);
31
+ target = `${value === "dame" ? "une" : "un"} ${value}`;
32
+ answer = "4";
33
+ break;
34
+ case "colorCard":
35
+ color = (0, random_1.random)(["rouge", "noire"]);
36
+ target = `une carte ${color}`;
37
+ answer = `26`;
38
+ break;
39
+ case "suitCard":
40
+ color = (0, randomEnumValue_1.randomEnumValue)(cardsData_1.CardsColor);
41
+ target = `un ${color}`;
42
+ answer = `13`;
43
+ break;
44
+ }
45
+ const question = {
46
+ answer,
47
+ instruction: `On tire une carte dans un jeu de 52 cartes. Combien l'événement $A = $ "obtenir ${target}" compte-t-il d'issues ?`,
48
+ keys: [],
49
+ answerFormat: "tex",
50
+ identifiers: { questionType },
51
+ };
52
+ return question;
53
+ };
54
+ const getPropositions = (n, { answer }) => {
55
+ const propositions = [];
56
+ (0, exercise_1.addValidProp)(propositions, answer);
57
+ (0, exercise_1.tryToAddWrongProp)(propositions, "1");
58
+ while (propositions.length < n) {
59
+ (0, exercise_1.tryToAddWrongProp)(propositions, (0, randint_1.randint)(0, 52) + "");
60
+ }
61
+ return (0, exercise_1.shuffleProps)(propositions, n);
62
+ };
63
+ const isAnswerValid = (ans, { answer }) => {
64
+ return ans === answer;
65
+ };
66
+ exports.issuesCountingForCards = {
67
+ id: "issuesCountingForCards",
68
+ connector: "=",
69
+ label: "Compter le nombre d'issues d'un événement avec un jeu de cartes",
70
+ levels: ["3ème", "2nde", "2ndPro", "1rePro"],
71
+ isSingleStep: true,
72
+ sections: ["Probabilités"],
73
+ generator: (nb) => (0, getDistinctQuestions_1.getDistinctQuestions)(getIssuesCountingForCardsQuestion, nb),
74
+ qcmTimer: 60,
75
+ freeTimer: 60,
76
+ getPropositions,
77
+ isAnswerValid,
78
+ };
@@ -0,0 +1,13 @@
1
+ import { MathExercise } from "../../exercises/exercise";
2
+ type Identifiers = {
3
+ aCapB: number;
4
+ aCapBBarre: number;
5
+ aBarreCapB: number;
6
+ aBarreCapBBarre: number;
7
+ event: string;
8
+ type: string;
9
+ probaFrac: number[];
10
+ };
11
+ export declare const probaFromTableNoContext: MathExercise<Identifiers>;
12
+ export {};
13
+ //# sourceMappingURL=probaFromTableNoContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"probaFromTableNoContext.d.ts","sourceRoot":"","sources":["../../../src/exercises/probaStat/probaFromTableNoContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EASb,MAAM,0BAA0B,CAAC;AAOlC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAkHF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,WAAW,CAc7D,CAAC"}