math-exercises 3.0.178 → 3.0.179
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/derivation/derivative/derivativeEquationSolving1.d.ts +14 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +283 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts +15 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +296 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +3 -3
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts +14 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.js +346 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts +15 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.js +435 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts +13 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +326 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts +14 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.js +181 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts +10 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.js +272 -0
- package/lib/exercises/math/derivation/problems/index.d.ts +5 -0
- package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/index.js +4 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts +8 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.js +171 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts +15 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +328 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts +13 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +275 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts +8 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts.map +1 -0
- package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.js +137 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +478 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.js +499 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts +10 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.js +240 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts +12 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.js +436 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts +12 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.js +219 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts +13 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.js +273 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts +18 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.js +295 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts +13 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +388 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts +9 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.js +308 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +439 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +547 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts +15 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +537 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts +15 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +639 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts +14 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +530 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts +10 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableProductFExp.js +451 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts +11 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -0
- package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +514 -0
- package/lib/exercises/math/functions/composition/index.d.ts +0 -1
- package/lib/exercises/math/functions/composition/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/composition/index.js +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.d.ts +0 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/index.js +1 -1
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts.map +1 -1
- package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.js +4 -11
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +32 -17
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts +13 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.js +195 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts +9 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.js +220 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts +15 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/conditionalProbability.js +332 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts +8 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.js +222 -0
- package/lib/exercises/math/probaStat/conditional/index.d.ts +5 -0
- package/lib/exercises/math/probaStat/conditional/index.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/conditional/index.js +4 -0
- package/lib/exercises/math/probaStat/index.d.ts +1 -2
- 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/probaFromTableWithContext.d.ts +1 -0
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +26 -199
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +6 -2
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +6 -5
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +4 -27
- package/lib/exercises/math/probaStat/twoEventsSituations.d.ts +29 -0
- package/lib/exercises/math/probaStat/twoEventsSituations.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/twoEventsSituations.js +145 -0
- package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts +4 -1
- package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/explicitFormulaUsage.js +47 -7
- package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +1 -1
- package/lib/exercises/math/sequences/geometric/index.d.ts +0 -3
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +3 -3
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts +0 -1
- package/lib/exercises/math/sequences/geometric/situations/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/situations/index.js +1 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts +5 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
- package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +89 -9
- package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/associatePoint.js +55 -6
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +5 -6
- package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.js +1 -3
- package/lib/exercises/vea/polynomialVEA.d.ts +2 -0
- package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -0
- package/lib/exercises/vea/polynomialVEA.js +17 -0
- package/lib/exercises/vea/valueTableVEA.d.ts +8 -0
- package/lib/exercises/vea/valueTableVEA.d.ts.map +1 -0
- package/lib/exercises/vea/valueTableVEA.js +12 -0
- package/lib/index.d.ts +27 -47
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.d.ts.map +1 -1
- package/lib/latexTester.js +1 -1
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts +19 -0
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts.map +1 -0
- package/lib/math/utils/polynomial/polynomialInterpolationUtils.js +53 -0
- package/lib/math/utils/polynomial/polynomialUtils.d.ts +37 -0
- package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -0
- package/lib/math/utils/polynomial/polynomialUtils.js +223 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +6 -6
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +1 -1
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +2 -1
- package/lib/tree/utilities/nodeUtils.d.ts +6 -0
- package/lib/tree/utilities/nodeUtils.d.ts.map +1 -0
- package/lib/tree/utilities/nodeUtils.js +24 -0
- package/lib/utils/strings/prependArticle.d.ts +2 -0
- package/lib/utils/strings/prependArticle.d.ts.map +1 -0
- package/lib/utils/strings/prependArticle.js +1 -0
- package/package.json +1 -1
|
@@ -102,7 +102,7 @@ const getScalarProductOrthoInSquareQuestion = () => {
|
|
|
102
102
|
//puis on reverse tout possiblement
|
|
103
103
|
const isFirstVecOnAB = coinFlip();
|
|
104
104
|
const vecs = {
|
|
105
|
-
AB: { projLength: c, reps: ["AB", "DC"] },
|
|
105
|
+
AB: { projLength: c, reps: ["AB", "DC"] }, //base
|
|
106
106
|
AC: { projLength: c, reps: ["AC"] },
|
|
107
107
|
AD: { projLength: c, reps: ["AD", "IK", "BC"] },
|
|
108
108
|
AJ: { projLength: isFirstVecOnAB ? c : c / 2, reps: ["AJ", "LC"] },
|
|
@@ -141,7 +141,7 @@ const getScalarProductOrthoInSquareQuestion = () => {
|
|
|
141
141
|
};
|
|
142
142
|
return getQuestionFromIdentifiers(identifiers);
|
|
143
143
|
};
|
|
144
|
-
// const getHint: GetHint<Identifiers> = (
|
|
144
|
+
// const getHint: GetHint<Identifiers> = () => {
|
|
145
145
|
// return `Utilise la définition du produit scalaire par projeté orthogonal : si $H$ est le projeté orthogonal du point $C$ sur la droite $(AB)$, alors :
|
|
146
146
|
// $$
|
|
147
147
|
// \\overline{AB}\\cdot\\overline{AC} = \\overline{AB}\\cdot\\overline{AH}
|
|
@@ -159,33 +159,48 @@ const getScalarProductOrthoInSquareQuestion = () => {
|
|
|
159
159
|
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
|
|
160
160
|
// const { areSameDirection, vec1Name, vec2Name, c } = identifiers;
|
|
161
161
|
// const vecs = [
|
|
162
|
-
// ["AB", "DC"],
|
|
162
|
+
// ["AB", "DC"], //base
|
|
163
163
|
// ["AC"],
|
|
164
|
-
// ["AD", "IK", "BC"],
|
|
164
|
+
// ["AD", "IK", "BC"], //base
|
|
165
165
|
// ["AJ", "LC"],
|
|
166
166
|
// ["AO", "LK", "OC", "IJ"],
|
|
167
167
|
// ["AK", "IC"],
|
|
168
|
-
// ["AI", "IB", "LO", "OJ", "DK", "KC"],
|
|
169
|
-
// ["AL", "LD", "IO", "OK", "BJ", "JC"],
|
|
168
|
+
// ["AI", "IB", "LO", "OJ", "DK", "KC"], //base
|
|
169
|
+
// ["AL", "LD", "IO", "OK", "BJ", "JC"], //base
|
|
170
170
|
// ];
|
|
171
|
+
// const baseIndexes = [0, 2, 6, 7];
|
|
172
|
+
// if (!areSameDirection) return `plus tard`;
|
|
173
|
+
// const reversedVecs = vecs.map((e) =>
|
|
174
|
+
// e.map((f) => f.split("").reverse().join("")),
|
|
175
|
+
// );
|
|
176
|
+
// const reversedFirst = vec1Name.split("").reverse().join("");
|
|
171
177
|
// const index1 = vecs.findIndex(
|
|
172
|
-
// (e) =>
|
|
173
|
-
// e.includes(vec1Name) || e.includes(vec1Name.split("").reverse().join("")),
|
|
178
|
+
// (e) => e.includes(vec1Name) || e.includes(reversedFirst),
|
|
174
179
|
// );
|
|
175
180
|
// const firstIsReversed = !vecs[index1].includes(vec1Name);
|
|
181
|
+
// const reversedSecond = vec2Name.split("").reverse().join("");
|
|
176
182
|
// const index2 = vecs.findIndex(
|
|
177
|
-
// (e) =>
|
|
178
|
-
// e.includes(vec2Name) || e.includes(vec2Name.split("").reverse().join("")),
|
|
183
|
+
// (e) => e.includes(vec2Name) || e.includes(reversedSecond),
|
|
179
184
|
// );
|
|
180
185
|
// const secondIsReversed = !vecs[index2].includes(vec2Name);
|
|
181
|
-
// if (vec1Name[0] === vec2Name[0])
|
|
182
|
-
//
|
|
183
|
-
//
|
|
184
|
-
//
|
|
185
|
-
//
|
|
186
|
-
//
|
|
187
|
-
//
|
|
186
|
+
// if (vec1Name[0] === vec2Name[0]) {
|
|
187
|
+
// const firstIsBase = baseIndexes.includes(index1);
|
|
188
|
+
// return `Le projeté orthogonal de $${
|
|
189
|
+
// firstIsBase ? vec2Name[1] : vec1Name[1]
|
|
190
|
+
// }$ sur la droite $(${firstIsBase ? vec1Name : vec2Name})$ est $${"a"}$.
|
|
191
|
+
// On a donc :
|
|
192
|
+
// immédiat`;
|
|
188
193
|
// }
|
|
194
|
+
// const sameOrigin =
|
|
195
|
+
// vecs[index2].find((e) => e[0] === vec1Name[0]) ||
|
|
196
|
+
// reversedVecs[index2].find((e) => e[0] === vec1Name[0]);
|
|
197
|
+
// if (sameOrigin)
|
|
198
|
+
// return `on prend $${vec1Name}$ et $${sameOrigin}$. eet ${sameOrigin[1]} à projeter sur ${vec1Name}`;
|
|
199
|
+
// const sameOrigin2 =
|
|
200
|
+
// vecs[index1].find((e) => e[0] === vec2Name[0]) ||
|
|
201
|
+
// reversedVecs[index1].find((e) => e[0] === vec2Name[0]);
|
|
202
|
+
// if (sameOrigin2)
|
|
203
|
+
// return `on prend $${vec2Name}$ et $${sameOrigin2}$. ${vec2Name[1]} à projeter sur ${sameOrigin2}`;
|
|
189
204
|
// return `On a :
|
|
190
205
|
// ${alignTex([[]])}
|
|
191
206
|
// `;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
situationIndex: number;
|
|
4
|
+
aCapB: number;
|
|
5
|
+
aCapBBarre: number;
|
|
6
|
+
aBarreCapB: number;
|
|
7
|
+
aBarreCapBBarre: number;
|
|
8
|
+
knowing: "A" | "\\overline{A}" | "B" | "\\overline{B}";
|
|
9
|
+
asked: "A" | "\\overline{A}" | "B" | "\\overline{B}";
|
|
10
|
+
};
|
|
11
|
+
export declare const conditionalProbaFromTableWithContext: Exercise<Identifiers>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=conditionalProbaFromTableWithContext.d.ts.map
|
package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionalProbaFromTableWithContext.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAarC,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,GAAG,GAAG,eAAe,GAAG,GAAG,GAAG,eAAe,CAAC;IACvD,KAAK,EAAE,GAAG,GAAG,eAAe,GAAG,GAAG,GAAG,eAAe,CAAC;CACtD,CAAC;AA+NF,eAAO,MAAM,oCAAoC,EAAE,QAAQ,CAAC,WAAW,CAsBtE,CAAC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { rationalVEA } from "../../../../exercises/vea/rationalVEA.js";
|
|
4
|
+
import { RationalConstructor } from "../../../../math/numbers/rationals/rational.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
7
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
8
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
9
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
10
|
+
import { dollarize } from "../../../../utils/latex/dollarize.js";
|
|
11
|
+
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
12
|
+
import { twoEventsSituations } from "../twoEventsSituations.js";
|
|
13
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
14
|
+
const propositions = [];
|
|
15
|
+
const { aBarreCapB, aBarreCapBBarre, aCapB, aCapBBarre, knowing, asked } = identifiers;
|
|
16
|
+
const total = aBarreCapB + aBarreCapBBarre + aCapB + aCapBBarre;
|
|
17
|
+
let cap;
|
|
18
|
+
switch (knowing) {
|
|
19
|
+
case "A":
|
|
20
|
+
cap = asked === "B" ? aCapB : aCapBBarre;
|
|
21
|
+
break;
|
|
22
|
+
case "\\overline{A}":
|
|
23
|
+
cap = asked === "B" ? aBarreCapB : aBarreCapBBarre;
|
|
24
|
+
break;
|
|
25
|
+
case "B":
|
|
26
|
+
cap = asked === "A" ? aCapB : aBarreCapB;
|
|
27
|
+
break;
|
|
28
|
+
case "\\overline{B}":
|
|
29
|
+
default:
|
|
30
|
+
cap = asked === "A" ? aCapBBarre : aBarreCapBBarre;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
addValidProp(propositions, answer);
|
|
34
|
+
tryToAddWrongProp(propositions, frac(cap, total).simplify().toTex());
|
|
35
|
+
propWhile(propositions, n, () => {
|
|
36
|
+
tryToAddWrongProp(propositions, RationalConstructor.randomIrreductibleProba().toTree().toTex());
|
|
37
|
+
});
|
|
38
|
+
return shuffleProps(propositions, n);
|
|
39
|
+
};
|
|
40
|
+
const getAnswer = (identifiers) => {
|
|
41
|
+
const { aBarreCapB, aBarreCapBBarre, aCapB, aCapBBarre, knowing, asked } = identifiers;
|
|
42
|
+
let total;
|
|
43
|
+
let cap;
|
|
44
|
+
switch (knowing) {
|
|
45
|
+
case "A":
|
|
46
|
+
total = aCapB + aCapBBarre;
|
|
47
|
+
cap = asked === "B" ? aCapB : aCapBBarre;
|
|
48
|
+
break;
|
|
49
|
+
case "\\overline{A}":
|
|
50
|
+
total = aBarreCapB + aBarreCapBBarre;
|
|
51
|
+
cap = asked === "B" ? aBarreCapB : aBarreCapBBarre;
|
|
52
|
+
break;
|
|
53
|
+
case "B":
|
|
54
|
+
total = aCapB + aBarreCapB;
|
|
55
|
+
cap = asked === "A" ? aCapB : aBarreCapB;
|
|
56
|
+
break;
|
|
57
|
+
case "\\overline{B}":
|
|
58
|
+
default:
|
|
59
|
+
total = aCapBBarre + aBarreCapBBarre;
|
|
60
|
+
cap = asked === "A" ? aCapBBarre : aBarreCapBBarre;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
return frac(cap, total).simplify().toTex();
|
|
64
|
+
};
|
|
65
|
+
const getInstruction = (identifiers) => {
|
|
66
|
+
const { situationIndex, aBarreCapB, aBarreCapBBarre, aCapB, aCapBBarre, knowing, asked, } = identifiers;
|
|
67
|
+
const situation = twoEventsSituations[situationIndex];
|
|
68
|
+
return `${situation.instruction.context} :
|
|
69
|
+
|
|
70
|
+
${mdTable([
|
|
71
|
+
[
|
|
72
|
+
" ",
|
|
73
|
+
situation.instruction.table.B,
|
|
74
|
+
situation.instruction.table["\\overline{B}"],
|
|
75
|
+
"Total",
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
situation.instruction.table.A,
|
|
79
|
+
dollarize(aCapB),
|
|
80
|
+
dollarize(aCapBBarre),
|
|
81
|
+
dollarize(aCapB + aCapBBarre),
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
situation.instruction.table["\\overline{A}"],
|
|
85
|
+
dollarize(aBarreCapB),
|
|
86
|
+
dollarize(aBarreCapBBarre),
|
|
87
|
+
dollarize(aBarreCapB + aBarreCapBBarre),
|
|
88
|
+
],
|
|
89
|
+
[
|
|
90
|
+
"Total",
|
|
91
|
+
dollarize(aCapB + aBarreCapB),
|
|
92
|
+
dollarize(aCapBBarre + aBarreCapBBarre),
|
|
93
|
+
dollarize(aCapB + aCapBBarre + aBarreCapB + aBarreCapBBarre),
|
|
94
|
+
],
|
|
95
|
+
])}
|
|
96
|
+
|
|
97
|
+
On choisit au hasard ${situation.events[knowing]}. Quelle est la probabilité que ce soit ${situation.events[asked]} ?`;
|
|
98
|
+
};
|
|
99
|
+
const getHint = (identifiers) => {
|
|
100
|
+
const { situationIndex } = identifiers;
|
|
101
|
+
const situation = twoEventsSituations[situationIndex];
|
|
102
|
+
return `Ici, il ne faut pas prendre le total des ${situation.population}s comme dénumérateur...`;
|
|
103
|
+
};
|
|
104
|
+
const getCorrection = (identifiers) => {
|
|
105
|
+
const { situationIndex, aBarreCapB, aBarreCapBBarre, aCapB, aCapBBarre, knowing, asked, } = identifiers;
|
|
106
|
+
const situation = twoEventsSituations[situationIndex];
|
|
107
|
+
let total;
|
|
108
|
+
let cap;
|
|
109
|
+
switch (knowing) {
|
|
110
|
+
case "A":
|
|
111
|
+
total = aCapB + aCapBBarre;
|
|
112
|
+
cap = asked === "B" ? aCapB : aCapBBarre;
|
|
113
|
+
break;
|
|
114
|
+
case "\\overline{A}":
|
|
115
|
+
total = aBarreCapB + aBarreCapBBarre;
|
|
116
|
+
cap = asked === "B" ? aBarreCapB : aBarreCapBBarre;
|
|
117
|
+
break;
|
|
118
|
+
case "B":
|
|
119
|
+
total = aCapB + aBarreCapB;
|
|
120
|
+
cap = asked === "A" ? aCapB : aBarreCapB;
|
|
121
|
+
break;
|
|
122
|
+
case "\\overline{B}":
|
|
123
|
+
default:
|
|
124
|
+
total = aCapBBarre + aBarreCapBBarre;
|
|
125
|
+
cap = asked === "A" ? aCapBBarre : aBarreCapBBarre;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
return `Le total correspondant au cas "${situation.events[knowing]}" est $${total}$. Parmi ces ${situation.population}s, ceux correspondant au cas "${situation.events[asked]}" est $${cap}$. Donc la probabilité recherchée vaut :
|
|
129
|
+
|
|
130
|
+
$$
|
|
131
|
+
${frac(cap, total).toSimplificationTex()}
|
|
132
|
+
$$`;
|
|
133
|
+
};
|
|
134
|
+
const getKeys = () => {
|
|
135
|
+
return [];
|
|
136
|
+
};
|
|
137
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
138
|
+
try {
|
|
139
|
+
return rationalVEA(ans, answer);
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
return handleVEAError(err);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
const getConditionalProbaFromTableWithContextQuestion = () => {
|
|
146
|
+
const situationIndex = randint(0, twoEventsSituations.length);
|
|
147
|
+
const aCapB = randint(1, 20);
|
|
148
|
+
const aCapBBarre = randint(1, 20, [aCapB]);
|
|
149
|
+
const aBarreCapB = randint(1, 20, [aCapB, aCapBBarre]);
|
|
150
|
+
const aBarreCapBBarre = randint(1, 20, [aCapB, aCapBBarre, aBarreCapB]);
|
|
151
|
+
const AEvents = ["A", "\\overline{A}"];
|
|
152
|
+
const BEvents = ["B", "\\overline{B}"];
|
|
153
|
+
const isKnowingA = coinFlip();
|
|
154
|
+
const knowing = (isKnowingA ? random(AEvents) : random(BEvents));
|
|
155
|
+
const asked = (isKnowingA ? random(BEvents) : random(AEvents));
|
|
156
|
+
const identifiers = {
|
|
157
|
+
aBarreCapB,
|
|
158
|
+
aBarreCapBBarre,
|
|
159
|
+
aCapB,
|
|
160
|
+
aCapBBarre,
|
|
161
|
+
situationIndex,
|
|
162
|
+
knowing,
|
|
163
|
+
asked,
|
|
164
|
+
};
|
|
165
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
166
|
+
};
|
|
167
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
168
|
+
return {
|
|
169
|
+
answer: getAnswer(identifiers),
|
|
170
|
+
instruction: getInstruction(identifiers),
|
|
171
|
+
keys: getKeys(identifiers),
|
|
172
|
+
answerFormat: "tex",
|
|
173
|
+
identifiers,
|
|
174
|
+
hint: getHint(identifiers),
|
|
175
|
+
correction: getCorrection(identifiers),
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
export const conditionalProbaFromTableWithContext = {
|
|
179
|
+
id: "conditionalProbaFromTableWithContext",
|
|
180
|
+
connector: "=",
|
|
181
|
+
label: "Calculer une probabilité conditionnelle dans un tableau à double entrée (avec contexte)",
|
|
182
|
+
isSingleStep: true,
|
|
183
|
+
generator: (nb, opts) => getDistinctQuestions(() => getConditionalProbaFromTableWithContextQuestion(opts), nb),
|
|
184
|
+
qcmTimer: 60,
|
|
185
|
+
freeTimer: 60,
|
|
186
|
+
getPropositions,
|
|
187
|
+
isAnswerValid,
|
|
188
|
+
subject: "Mathématiques",
|
|
189
|
+
getInstruction,
|
|
190
|
+
getHint,
|
|
191
|
+
getCorrection,
|
|
192
|
+
getAnswer,
|
|
193
|
+
getQuestionFromIdentifiers,
|
|
194
|
+
hasHintAndCorrection: true,
|
|
195
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
situationIndex: number;
|
|
4
|
+
dictShuffle: Record<string, string>;
|
|
5
|
+
pType: string;
|
|
6
|
+
};
|
|
7
|
+
export declare const conditionalProbaWriteFromFrench: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=conditionalProbaWriteFromFrench.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionalProbaWriteFromFrench.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.ts"],"names":[],"mappings":"AACA,OAAO,EACL,QAAQ,EAcT,MAAM,sBAAsB,CAAC;AAK9B,KAAK,WAAW,GAAG;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA8QF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAcjE,CAAC"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
2
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercise.js";
|
|
3
|
+
import { getDistinctQuestions } from "../../../utils/getDistinctQuestions.js";
|
|
4
|
+
import { shuffle } from "../../../../utils/alea/shuffle.js";
|
|
5
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
6
|
+
const situations = [
|
|
7
|
+
{
|
|
8
|
+
context: "Martine est à la plage pour faire de la pêche à pied. Elle ramasse un coquillage.",
|
|
9
|
+
strA: "C'est une moule.",
|
|
10
|
+
strB: "Il y a un petit crabe à l'intérieur.",
|
|
11
|
+
"(A)": "que ce soit une moule",
|
|
12
|
+
"(B)": "qu'il y ait un petit crabe à l'intérieur",
|
|
13
|
+
"(A \\cap B)": "que ce soit une moule avec un petit crabe à l'intérieur",
|
|
14
|
+
"_A(B)": "qu'il y ait un petit crabe à l'intérieur, sachant que c'est une moule",
|
|
15
|
+
"_B(A)": "que ce soit une moule, sachant qu'il y a un petit crabe à l'intérieur",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
context: "Pour payer sa baguette multi-graines, Ahmed prend un billet au hasard dans son portefeuille.",
|
|
19
|
+
strA: "C'est un billet de $10$ euros.",
|
|
20
|
+
strB: "Il est froissé.",
|
|
21
|
+
"(A)": "que ce soit un billet de $10$ euros",
|
|
22
|
+
"(B)": "qu'il soit froissé",
|
|
23
|
+
"(A \\cap B)": "que ce soit un billet froissé de $10$ euros",
|
|
24
|
+
"_A(B)": "qu'il soit froissé, sachant que c'est un billet de $10$ euros",
|
|
25
|
+
"_B(A)": "que ce soit un billet de $10$ euros, sachant qu'il est froissé",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
context: "Cynthia change de station de radio. Elle tombe sur un morceau de musique.",
|
|
29
|
+
strA: "C'est de la pop.",
|
|
30
|
+
strB: "Les paroles sont en anglais.",
|
|
31
|
+
"(A)": "que ce soit de la pop",
|
|
32
|
+
"(B)": "que les paroles soient en anglais",
|
|
33
|
+
"(A \\cap B)": "que ce soit un morceau de pop en anglais",
|
|
34
|
+
"_A(B)": "que les paroles soient en anglais, sachant que c'est de la pop",
|
|
35
|
+
"_B(A)": "que ce soit de la pop, sachant que les paroles sont en anglais",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
context: "À la maison, Henri et Raphaël jouent au Monopoly. Raphaël lance les dés.",
|
|
39
|
+
strA: "Le résultat du lancer est un double $6$.",
|
|
40
|
+
strB: "Les dés sont tombés par terre.",
|
|
41
|
+
"(A)": "que le résulat du lancer soit un double $6$",
|
|
42
|
+
"(B)": "que les dés soient tombés par terre",
|
|
43
|
+
"(A \\cap B)": "que les dés soient tombés par terre et aient donné un double $6$",
|
|
44
|
+
"_A(B)": "que les dés soient tombés par terre, sachant que le résultat du lancer est un double $6$",
|
|
45
|
+
"_B(A)": "que ce soit un double $6$, sachant que les dés sont tombés par terre",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
context: "Au hasard, la maîtresse ouvre le dictionnaire et pose son doigt sur un mot.",
|
|
49
|
+
strA: "C'est un mot de $7$ lettres.",
|
|
50
|
+
strB: 'Le mot se termine par la lettre "e".',
|
|
51
|
+
"(A)": "que ce soit un mot de $7$ lettres",
|
|
52
|
+
"(B)": 'que le mot se termine par un "e"',
|
|
53
|
+
"(A \\cap B)": 'que ce soit un mot de $7$ lettres qui se termine par un "e"',
|
|
54
|
+
"_A(B)": 'que ce soit un mot qui se termine par un "e", sachant que c\'est un mot de $7$ lettres',
|
|
55
|
+
"_B(A)": 'que ce soit un mot de $7$ lettres sachant qu\'il se termine par un "e"',
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
context: "Dans une émission TV, le présentateur demande son prénom à quelqu'un dans le public.",
|
|
59
|
+
strA: "Le prénom est Jean-Michel.",
|
|
60
|
+
strB: "La personne est un adulte.",
|
|
61
|
+
"(A)": "que le prénom soit Jean-Michel",
|
|
62
|
+
"(B)": "que la personne soit un adulte",
|
|
63
|
+
"(A \\cap B)": "que le prénom soit Jean-Michel et que la personne soit un adulte",
|
|
64
|
+
"_A(B)": "que la personne soit un adulte, sachant que son prénom est Jean-Michel",
|
|
65
|
+
"_B(A)": "que le prénom soit Jean-Michel, sachant que la personne est un adulte",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
context: "Il est $14$h$37$. Yohann et Sarah sont assis en classe. C'est un cours sur les probabilités.",
|
|
69
|
+
strA: "Yohann dort.",
|
|
70
|
+
strB: "Sarah est attentive.",
|
|
71
|
+
"(A)": "que Yohann dorme",
|
|
72
|
+
"(B)": "que Sarah soit attentive",
|
|
73
|
+
"(A \\cap B)": "que Yohann dorme tandis que Sarah est attentive",
|
|
74
|
+
"_A(B)": "que Sarah soit attentive, sachant que Yohann dort",
|
|
75
|
+
"_B(A)": "que Yohann dorme, sachant que Sarah est attentive",
|
|
76
|
+
},
|
|
77
|
+
];
|
|
78
|
+
const shuffleSituation = (situation, dictShuffle) => {
|
|
79
|
+
function replaceKey(strSrc, dictReplacement) {
|
|
80
|
+
return Object.keys(dictReplacement).reduce((acc, x) => {
|
|
81
|
+
return acc.replace(x, dictReplacement[x]);
|
|
82
|
+
}, strSrc);
|
|
83
|
+
}
|
|
84
|
+
const arrayOfTemporaryKeys = [
|
|
85
|
+
...Array(Object.keys(dictShuffle).length).keys(),
|
|
86
|
+
].map((i) => {
|
|
87
|
+
return `temporaryKey{${i}}`;
|
|
88
|
+
});
|
|
89
|
+
const dictReplacementOriginaltoTemporary = Object.fromEntries(Object.keys(dictShuffle).map((originalKey, i) => {
|
|
90
|
+
return [originalKey, arrayOfTemporaryKeys[i]];
|
|
91
|
+
}));
|
|
92
|
+
const dictReplacementTemporaryToShuffledOriginal = Object.fromEntries(Object.keys(dictShuffle).map((originalKey) => {
|
|
93
|
+
return [
|
|
94
|
+
dictReplacementOriginaltoTemporary[originalKey],
|
|
95
|
+
dictShuffle[originalKey],
|
|
96
|
+
];
|
|
97
|
+
}));
|
|
98
|
+
return Object.fromEntries(Object.entries(situation).map(([k, v]) => [
|
|
99
|
+
k === "(A \\cap B)"
|
|
100
|
+
? k
|
|
101
|
+
: replaceKey(replaceKey(k, dictReplacementOriginaltoTemporary), dictReplacementTemporaryToShuffledOriginal),
|
|
102
|
+
v,
|
|
103
|
+
]));
|
|
104
|
+
};
|
|
105
|
+
const getInstruction = (identifiers) => {
|
|
106
|
+
const { situationIndex, dictShuffle, pType } = identifiers;
|
|
107
|
+
const situation = shuffleSituation(situations[situationIndex], dictShuffle);
|
|
108
|
+
let instruction = `${situation.context}`;
|
|
109
|
+
instruction += `
|
|
110
|
+
|
|
111
|
+
Soit $A$ l'évenement :
|
|
112
|
+
|
|
113
|
+
> ${situation.strA}
|
|
114
|
+
|
|
115
|
+
Soit $B$ l'évenement :
|
|
116
|
+
|
|
117
|
+
> ${situation.strB}`;
|
|
118
|
+
instruction += `
|
|
119
|
+
|
|
120
|
+
Écrire en langage mathématique :
|
|
121
|
+
|
|
122
|
+
> La probabilité ${situation[pType]}.`;
|
|
123
|
+
return instruction;
|
|
124
|
+
};
|
|
125
|
+
const getAnswer = (identifiers) => {
|
|
126
|
+
const { pType } = identifiers;
|
|
127
|
+
switch (pType) {
|
|
128
|
+
case "(A \\cap B)":
|
|
129
|
+
return `P\\left(A\\cap B\\right)`;
|
|
130
|
+
case "_A(B)":
|
|
131
|
+
return `P_A\\left(B\\right)`;
|
|
132
|
+
case "_B(A)":
|
|
133
|
+
return `P_B\\left(A\\right)`;
|
|
134
|
+
default:
|
|
135
|
+
return "";
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
const getHint = () => {
|
|
139
|
+
return `Si $M$ et $N$ sont deux évenements, alors
|
|
140
|
+
|
|
141
|
+
$P(M \\cap N)$ est la probabilité de l'évènement "$M$ et $N$".
|
|
142
|
+
|
|
143
|
+
$P_M(N)$ est la probabilité de l'évènement $N$, sachant que l'évènement $M$ est réalisé.
|
|
144
|
+
|
|
145
|
+
$P_N(M)$ est la probabilité de l'évènement $M$, sachant que l'évènement $N$ est réalisé.`;
|
|
146
|
+
};
|
|
147
|
+
const getCorrection = (identifiers) => {
|
|
148
|
+
const { situationIndex, dictShuffle, pType } = identifiers;
|
|
149
|
+
const situation = shuffleSituation(situations[situationIndex], dictShuffle);
|
|
150
|
+
return `La probabilité ${situation[pType]}${pType === "_A(B)" || pType === "_B(A)" ? ", est" : " n'est pas"} une probabilité conditionnelle.
|
|
151
|
+
${(() => {
|
|
152
|
+
switch (pType) {
|
|
153
|
+
case "(A \\cap B)":
|
|
154
|
+
return `C'est la probabilité de l'évènement "$A$ et $B$", sans condition particulière.`;
|
|
155
|
+
case "_A(B)":
|
|
156
|
+
return `C'est la probabilité sachant A (donc conditionnelle), $P_A$, de l'évènement "$B$".`;
|
|
157
|
+
case "_B(A)":
|
|
158
|
+
return `C'est la probabilité sachant B (donc conditionnelle), $P_B$, de l'évènement "$A$".`;
|
|
159
|
+
}
|
|
160
|
+
})()}
|
|
161
|
+
Elle se note $P${pType}$.`;
|
|
162
|
+
};
|
|
163
|
+
const getConditionalProbaWriteFromFrenchQuestion = () => {
|
|
164
|
+
const pType = random(["(A \\cap B)", "_A(B)", "_B(A)"]);
|
|
165
|
+
const situationIndex = randint(0, situations.length);
|
|
166
|
+
const arrABShuffled = shuffle(["A", "B"]);
|
|
167
|
+
const dictShuffle = Object.fromEntries(["A", "B"].map((c, i) => [c, arrABShuffled[i]]));
|
|
168
|
+
const identifiers = { situationIndex, dictShuffle, pType };
|
|
169
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
170
|
+
};
|
|
171
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
172
|
+
const question = {
|
|
173
|
+
instruction: getInstruction(identifiers),
|
|
174
|
+
answer: getAnswer(identifiers),
|
|
175
|
+
keys: ["P", "cap", "underscore", "A", "B"],
|
|
176
|
+
answerFormat: "tex",
|
|
177
|
+
identifiers,
|
|
178
|
+
hint: getHint(identifiers),
|
|
179
|
+
correction: getCorrection(identifiers),
|
|
180
|
+
};
|
|
181
|
+
return question;
|
|
182
|
+
};
|
|
183
|
+
const getPropositions = (n, { answer }) => {
|
|
184
|
+
const propositions = [];
|
|
185
|
+
addValidProp(propositions, answer);
|
|
186
|
+
tryToAddWrongProp(propositions, `P\\left(A\\cap B\\right)`, "tex");
|
|
187
|
+
tryToAddWrongProp(propositions, `P_A\\left(B\\right)`, "tex");
|
|
188
|
+
tryToAddWrongProp(propositions, `P_B\\left(A\\right)`, "tex");
|
|
189
|
+
tryToAddWrongProp(propositions, `P(A)`, "tex");
|
|
190
|
+
tryToAddWrongProp(propositions, `P(B)`, "tex");
|
|
191
|
+
return shuffleProps(propositions, n);
|
|
192
|
+
};
|
|
193
|
+
const isAnswerValid = (ans, { answer, ...identifiers }) => {
|
|
194
|
+
const { pType } = identifiers;
|
|
195
|
+
switch (pType) {
|
|
196
|
+
case "(A \\cap B)":
|
|
197
|
+
return (`P\\left(A\\cap B\\right)`.trim() === ans ||
|
|
198
|
+
`P\\left(B\\cap A\\right)`.trim() === ans);
|
|
199
|
+
case "_A(B)":
|
|
200
|
+
return `P_A\\left(B\\right)`.trim() === ans.trim();
|
|
201
|
+
case "_B(A)":
|
|
202
|
+
return `P_B\\left(A\\right)`.trim() === ans.trim();
|
|
203
|
+
default:
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
export const conditionalProbaWriteFromFrench = {
|
|
208
|
+
id: "conditionalProbaWriteFromFrench",
|
|
209
|
+
connector: "=",
|
|
210
|
+
label: "Écrire une probabilité conditionnelle en langage mathématique",
|
|
211
|
+
isSingleStep: false,
|
|
212
|
+
generator: (nb) => getDistinctQuestions(getConditionalProbaWriteFromFrenchQuestion, nb),
|
|
213
|
+
qcmTimer: 60,
|
|
214
|
+
freeTimer: 60,
|
|
215
|
+
getPropositions,
|
|
216
|
+
isAnswerValid,
|
|
217
|
+
subject: "Mathématiques",
|
|
218
|
+
hasHintAndCorrection: true,
|
|
219
|
+
getQuestionFromIdentifiers,
|
|
220
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
flip: number;
|
|
4
|
+
pA?: number;
|
|
5
|
+
pB?: number;
|
|
6
|
+
pAB?: number;
|
|
7
|
+
pA_B?: number;
|
|
8
|
+
pB_A?: number;
|
|
9
|
+
};
|
|
10
|
+
type Options = {
|
|
11
|
+
probaType: string[];
|
|
12
|
+
};
|
|
13
|
+
export declare const conditionalProbability: Exercise<Identifiers, Options>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=conditionalProbability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditionalProbability.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/conditional/conditionalProbability.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,QAAQ,EAmBT,MAAM,sBAAsB,CAAC;AAO9B,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAoRF,KAAK,OAAO,GAAG;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB,CAAC;AAyDF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAiBjE,CAAC"}
|