math-exercises 3.0.183 → 3.0.185
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/exercises/math/functions/composition/functionComposition.d.ts.map +1 -1
- package/lib/exercises/math/functions/composition/functionComposition.js +11 -22
- package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/approxExpAPlusB.js +91 -38
- package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/algebraic/rewriteExpUsingExpA.js +18 -3
- package/lib/exercises/math/functions/exponential/expKT/derivativeOfAExpKT.d.ts +8 -0
- package/lib/exercises/math/functions/exponential/expKT/derivativeOfAExpKT.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/expKT/derivativeOfAExpKT.js +108 -0
- package/lib/exercises/math/functions/exponential/expKT/drugConcentrationMaximum.d.ts +8 -0
- package/lib/exercises/math/functions/exponential/expKT/drugConcentrationMaximum.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/expKT/drugConcentrationMaximum.js +144 -0
- package/lib/exercises/math/functions/exponential/expKT/index.d.ts +3 -0
- package/lib/exercises/math/functions/exponential/expKT/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/expKT/index.js +2 -0
- package/lib/exercises/math/functions/exponential/expSimplifiying.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/expSimplifiying.js +94 -4
- package/lib/exercises/math/functions/exponential/index.d.ts +3 -0
- package/lib/exercises/math/functions/exponential/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponential/index.js +3 -0
- package/lib/exercises/math/functions/exponential/sign/expFunctionBasicSign.d.ts +9 -0
- package/lib/exercises/math/functions/exponential/sign/expFunctionBasicSign.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/sign/expFunctionBasicSign.js +101 -0
- package/lib/exercises/math/functions/exponential/sign/index.d.ts +2 -0
- package/lib/exercises/math/functions/exponential/sign/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/sign/index.js +1 -0
- package/lib/exercises/math/functions/exponential/variations/index.d.ts +3 -0
- package/lib/exercises/math/functions/exponential/variations/index.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/variations/index.js +2 -0
- package/lib/exercises/math/functions/exponential/variations/varSignTableOfAffineTimesExp.d.ts +7 -0
- package/lib/exercises/math/functions/exponential/variations/varSignTableOfAffineTimesExp.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/variations/varSignTableOfAffineTimesExp.js +144 -0
- package/lib/exercises/math/functions/exponential/variations/varSignTableOfExpMinusX.d.ts +7 -0
- package/lib/exercises/math/functions/exponential/variations/varSignTableOfExpMinusX.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponential/variations/varSignTableOfExpMinusX.js +139 -0
- package/lib/exercises/math/probaStat/independancy/independantSuccessiveEventsComputeTwoSuccess.d.ts +7 -0
- package/lib/exercises/math/probaStat/independancy/independantSuccessiveEventsComputeTwoSuccess.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/independancy/independantSuccessiveEventsComputeTwoSuccess.js +100 -0
- package/lib/exercises/math/probaStat/independancy/index.d.ts +1 -0
- package/lib/exercises/math/probaStat/independancy/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/independancy/index.js +1 -0
- package/lib/exercises/math/probaStat/trees/index.d.ts +4 -1
- package/lib/exercises/math/probaStat/trees/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/trees/index.js +4 -11
- package/lib/exercises/math/probaStat/trees/probabilityTree.d.ts +9 -3
- package/lib/exercises/math/probaStat/trees/probabilityTree.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/trees/probabilityTree.js +419 -45
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +3 -3
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindThresholdFromSituation.js +2 -2
- package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts +2 -0
- package/lib/exercises/math/sequences/arithmetic/situations/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/situations/index.js +2 -2
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoConsecutiveTerms.js +37 -39
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindExplicitFormulaFromTwoTerms.js +14 -4
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/situations/geometricFindExplicitFormulaFromSituation.js +12 -3
- package/lib/exercises/vea/treeTableVEA.d.ts.map +1 -1
- package/lib/exercises/vea/treeTableVEA.js +3 -0
- package/lib/index.d.ts +46 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/latexTester.js +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts +2 -0
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +150 -128
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticUtils.js +4 -1
- package/lib/tests/questionTest.d.ts.map +1 -1
- package/lib/tests/questionTest.js +1 -0
- package/lib/tests/singleExo.test.js +2 -2
- package/lib/tree/nodes/functions/expNode.d.ts +1 -1
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +3 -6
- package/lib/tree/nodes/operators/addNode.d.ts +1 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +2 -2
- package/lib/tree/nodes/operators/substractNode.d.ts +1 -1
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +2 -2
- package/lib/tree/utilities/nodeComparator.d.ts +7 -0
- package/lib/tree/utilities/nodeComparator.d.ts.map +1 -0
- package/lib/tree/utilities/nodeComparator.js +88 -0
- package/lib/tree/utilities/nodeInspector.d.ts +5 -0
- package/lib/tree/utilities/nodeInspector.d.ts.map +1 -0
- package/lib/tree/utilities/nodeInspector.js +15 -0
- package/lib/tree/utilities/nodeRewriter.d.ts +9 -0
- package/lib/tree/utilities/nodeRewriter.d.ts.map +1 -0
- package/lib/tree/utilities/nodeRewriter.js +172 -0
- package/lib/tree/utilities/nodeShuffler.d.ts +2 -4
- package/lib/tree/utilities/nodeShuffler.d.ts.map +1 -1
- package/lib/tree/utilities/nodeShuffler.js +13 -104
- package/lib/tree/utilities/nodeSimplifier.d.ts +1 -2
- package/lib/tree/utilities/nodeSimplifier.d.ts.map +1 -1
- package/lib/tree/utilities/nodeSimplifier.js +14 -88
- package/package.json +1 -1
package/lib/exercises/math/probaStat/independancy/independantSuccessiveEventsComputeTwoSuccess.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
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 { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { round } from "../../../../math/utils/round.js";
|
|
7
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
8
|
+
import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
9
|
+
import { square } from "../../../../tree/nodes/operators/powerNode.js";
|
|
10
|
+
import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
11
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
12
|
+
const getPropositions = (n, { answer }) => {
|
|
13
|
+
const propositions = [];
|
|
14
|
+
addValidProp(propositions, answer);
|
|
15
|
+
propWhile(propositions, n, () => {
|
|
16
|
+
tryToAddWrongProp(propositions, randfloat(0.1, 0.9, 4).frenchify());
|
|
17
|
+
});
|
|
18
|
+
return shuffleProps(propositions, n);
|
|
19
|
+
};
|
|
20
|
+
const getAnswer = (identifiers) => {
|
|
21
|
+
const { percent } = identifiers;
|
|
22
|
+
return round(square(frac(percent, 100)).evaluate(), 5).frenchify();
|
|
23
|
+
};
|
|
24
|
+
const getInstruction = (identifiers) => {
|
|
25
|
+
const { percent } = identifiers;
|
|
26
|
+
return `Dans une population, $${percent}\\%$ des personnes sont gauchères. On interroge au hasard deux individus et on suppose la population suffisamment importante pour considérer ces deux épreuves indépendantes.
|
|
27
|
+
|
|
28
|
+
Quelle est la probabilité que les deux personnes interrogées soient gauchères ?`;
|
|
29
|
+
};
|
|
30
|
+
const getHint = () => {
|
|
31
|
+
return `Si $A$ et $B$ sont deux évènements indépendants, alors :
|
|
32
|
+
|
|
33
|
+
$$
|
|
34
|
+
P(A\\cap B) = P(A)\\times P(B)
|
|
35
|
+
$$`;
|
|
36
|
+
};
|
|
37
|
+
const getCorrection = (identifiers) => {
|
|
38
|
+
const { percent } = identifiers;
|
|
39
|
+
const dec = round(frac(percent, 100).evaluate(), 5);
|
|
40
|
+
return `On note $G_1$ l'évènement "la première personne est gauchère" et $G_2$ l'évènement "la deuxième personne est gauchère". La probabilité recherchée s'écrit alors : $P(G_1\\cap G_2)$.
|
|
41
|
+
|
|
42
|
+
D'après l'énoncé, les évènements $G_1$ et $G_2$ sont indépendants.
|
|
43
|
+
|
|
44
|
+
On a donc :
|
|
45
|
+
|
|
46
|
+
${alignTex([
|
|
47
|
+
["P(G_1\\cap G_2)", "=", "P(G_1)\\times P(G_2)"],
|
|
48
|
+
["", "=", multiply(dec, dec).toTex()],
|
|
49
|
+
["", "=", multiply(dec, dec).simplify().toTex()],
|
|
50
|
+
])}
|
|
51
|
+
|
|
52
|
+
`;
|
|
53
|
+
};
|
|
54
|
+
const getKeys = () => {
|
|
55
|
+
return ["percent"];
|
|
56
|
+
};
|
|
57
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
58
|
+
try {
|
|
59
|
+
return rationalVEA(ans, answer);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
return handleVEAError(err);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const getIndependantSuccessiveEventsComputeTwoSuccessQuestion = () => {
|
|
66
|
+
const percent = randint(2, 50);
|
|
67
|
+
const identifiers = {
|
|
68
|
+
percent,
|
|
69
|
+
};
|
|
70
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
71
|
+
};
|
|
72
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
73
|
+
return {
|
|
74
|
+
answer: getAnswer(identifiers),
|
|
75
|
+
instruction: getInstruction(identifiers),
|
|
76
|
+
keys: getKeys(identifiers),
|
|
77
|
+
answerFormat: "tex",
|
|
78
|
+
identifiers,
|
|
79
|
+
hint: getHint(identifiers),
|
|
80
|
+
correction: getCorrection(identifiers),
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
export const independantSuccessiveEventsComputeTwoSuccess = {
|
|
84
|
+
id: "independantSuccessiveEventsComputeTwoSuccess",
|
|
85
|
+
connector: "=",
|
|
86
|
+
label: "Utiliser l'indépendance pour calculer $P(S=2)$ dans le cas de la répétition de $2$ épreuves indépendantes",
|
|
87
|
+
isSingleStep: true,
|
|
88
|
+
generator: (nb, opts) => getDistinctQuestions(() => getIndependantSuccessiveEventsComputeTwoSuccessQuestion(opts), nb),
|
|
89
|
+
qcmTimer: 60,
|
|
90
|
+
freeTimer: 60,
|
|
91
|
+
getPropositions,
|
|
92
|
+
isAnswerValid,
|
|
93
|
+
subject: "Mathématiques",
|
|
94
|
+
getInstruction,
|
|
95
|
+
getHint,
|
|
96
|
+
getCorrection,
|
|
97
|
+
getAnswer,
|
|
98
|
+
getQuestionFromIdentifiers,
|
|
99
|
+
hasHintAndCorrection: true,
|
|
100
|
+
};
|
|
@@ -4,4 +4,5 @@ export * from "./independancyFindCap.js";
|
|
|
4
4
|
export * from "./independancyFindCup.js";
|
|
5
5
|
export * from "./independancyFromEffectifTable.js";
|
|
6
6
|
export * from "./independancyFromProbaTree.js";
|
|
7
|
+
export * from "./independantSuccessiveEventsComputeTwoSuccess.js";
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/independancy/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/independancy/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mDAAmD,CAAC"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export { probabilityTree, } from "./probabilityTree.js";
|
|
1
|
+
export { probabilityTree, probabilityTreeIntersection, probabilityTreeTotalProbability, probabilityTreeReadProbability, probabilityTreeInversionProbability, } from "./probabilityTree.js";
|
|
2
|
+
export * from "./fillProbaTreeWithComplementaryProbabilities.js";
|
|
3
|
+
export * from "./buildTreeFromSituation.js";
|
|
4
|
+
export * from "./probaTreeSituationTotalProbaFormula.js";
|
|
2
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,2BAA2B,EAC3B,+BAA+B,EAC/B,8BAA8B,EAC9B,mCAAmC,GACpC,MAAM,sBAAsB,CAAC;AAC9B,cAAc,kDAAkD,CAAC;AACjE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0CAA0C,CAAC"}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
// probabilityTreeTotalProbability,
|
|
6
|
-
// probabilityTreeReadProbability,
|
|
7
|
-
// probabilityTreeInversionProbability,
|
|
8
|
-
} from "./probabilityTree.js";
|
|
9
|
-
// export * from "./fillProbaTreeWithComplementaryProbabilities.js";
|
|
10
|
-
// export * from "./buildTreeFromSituation.js";
|
|
11
|
-
// export * from "./probaTreeSituationTotalProbaFormula.js";
|
|
1
|
+
export { probabilityTree, probabilityTreeIntersection, probabilityTreeTotalProbability, probabilityTreeReadProbability, probabilityTreeInversionProbability, } from "./probabilityTree.js";
|
|
2
|
+
export * from "./fillProbaTreeWithComplementaryProbabilities.js";
|
|
3
|
+
export * from "./buildTreeFromSituation.js";
|
|
4
|
+
export * from "./probaTreeSituationTotalProbaFormula.js";
|
|
@@ -8,12 +8,18 @@ type Identifiers = {
|
|
|
8
8
|
BC: NodeIdentifiers;
|
|
9
9
|
BD: NodeIdentifiers;
|
|
10
10
|
probaName: string;
|
|
11
|
+
useContraryNames?: boolean;
|
|
11
12
|
};
|
|
12
13
|
type Options = {
|
|
13
|
-
allowApproximate
|
|
14
|
-
eventTypes
|
|
15
|
-
probaType
|
|
14
|
+
allowApproximate?: string;
|
|
15
|
+
eventTypes?: string[];
|
|
16
|
+
probaType?: string;
|
|
17
|
+
eventsNames?: string;
|
|
16
18
|
};
|
|
17
19
|
export declare const probabilityTree: Exercise<Identifiers, Options>;
|
|
20
|
+
export declare const probabilityTreeIntersection: Exercise<Identifiers, Options>;
|
|
21
|
+
export declare const probabilityTreeTotalProbability: Exercise<Identifiers, Options>;
|
|
22
|
+
export declare const probabilityTreeReadProbability: Exercise<Identifiers, Options>;
|
|
23
|
+
export declare const probabilityTreeInversionProbability: Exercise<Identifiers, Options>;
|
|
18
24
|
export {};
|
|
19
25
|
//# sourceMappingURL=probabilityTree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/probabilityTree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"probabilityTree.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/trees/probabilityTree.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,eAAe,EAChB,MAAM,qCAAqC,CAAC;AAQ7C,OAAO,EACL,QAAQ,EAkBT,MAAM,sBAAsB,CAAC;AAG9B,KAAK,WAAW,GAAG;IAIjB,CAAC,EAAE,eAAe,CAAC;IACnB,CAAC,EAAE,eAAe,CAAC;IACnB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAuhBF,KAAK,OAAO,GAAG;IACb,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAwDF,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAe1D,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwBtE,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAwB1E,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CA2BzE,CAAC;AAEF,eAAO,MAAM,mCAAmC,EAAE,QAAQ,CACxD,WAAW,EACX,OAAO,CA0BR,CAAC"}
|