math-exercises 3.0.178 → 3.0.180

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 (161) hide show
  1. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts +14 -0
  2. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -0
  3. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +283 -0
  4. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts +15 -0
  5. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -0
  6. package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +296 -0
  7. package/lib/exercises/math/derivation/derivative/exp/expDerivativeOne.js +3 -3
  8. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts +14 -0
  9. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.d.ts.map +1 -0
  10. package/lib/exercises/math/derivation/derivative/exp/expDerivativeProductFExp.js +346 -0
  11. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts +15 -0
  12. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.d.ts.map +1 -0
  13. package/lib/exercises/math/derivation/derivative/exp/expDerivativeQuotientFExp.js +435 -0
  14. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts +13 -0
  15. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -0
  16. package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +326 -0
  17. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts +14 -0
  18. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.d.ts.map +1 -0
  19. package/lib/exercises/math/derivation/derivativeNumber/signOfDerivativeNumberFromFunctionCurve.js +181 -0
  20. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts +10 -0
  21. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.d.ts.map +1 -0
  22. package/lib/exercises/math/derivation/derivativeNumber/valueTableImageAndDerivativeFromFunctionExpression.js +272 -0
  23. package/lib/exercises/math/derivation/problems/index.d.ts +5 -0
  24. package/lib/exercises/math/derivation/problems/index.d.ts.map +1 -0
  25. package/lib/exercises/math/derivation/problems/index.js +4 -0
  26. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts +8 -0
  27. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.d.ts.map +1 -0
  28. package/lib/exercises/math/derivation/problems/problemMaximizeBoxVolumeFindX.js +171 -0
  29. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts +15 -0
  30. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -0
  31. package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +328 -0
  32. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts +13 -0
  33. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -0
  34. package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +275 -0
  35. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts +8 -0
  36. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.d.ts.map +1 -0
  37. package/lib/exercises/math/derivation/problems/problemProjectileHeightFindAbscissa.js +137 -0
  38. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts +10 -0
  39. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.d.ts.map +1 -0
  40. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineY.js +478 -0
  41. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts +10 -0
  42. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.d.ts.map +1 -0
  43. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingLineYAndSlope.js +499 -0
  44. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts +10 -0
  45. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.d.ts.map +1 -0
  46. package/lib/exercises/math/derivation/tangent/derivativeEquationSolvingByManipulatingPoint.js +240 -0
  47. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts +12 -0
  48. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.d.ts.map +1 -0
  49. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingBuildingTangent.js +436 -0
  50. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts +12 -0
  51. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.d.ts.map +1 -0
  52. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingPoint.js +219 -0
  53. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts +13 -0
  54. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.d.ts.map +1 -0
  55. package/lib/exercises/math/derivation/tangent/derivativeReadingByManipulatingSecant.js +273 -0
  56. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts +18 -0
  57. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.d.ts.map +1 -0
  58. package/lib/exercises/math/derivation/tangent/placePointsOfDerivativeFromGraph.js +295 -0
  59. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts +13 -0
  60. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -0
  61. package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +388 -0
  62. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts +9 -0
  63. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.d.ts.map +1 -0
  64. package/lib/exercises/math/derivation/tangent/tangentEquationFromGraph.js +308 -0
  65. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts +14 -0
  66. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -0
  67. package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +439 -0
  68. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts +14 -0
  69. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -0
  70. package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +547 -0
  71. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts +15 -0
  72. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -0
  73. package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +537 -0
  74. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts +15 -0
  75. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -0
  76. package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +639 -0
  77. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts +14 -0
  78. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -0
  79. package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +530 -0
  80. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts +10 -0
  81. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.d.ts.map +1 -0
  82. package/lib/exercises/math/derivation/variations/signVarTableProductFExp.js +451 -0
  83. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts +11 -0
  84. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.d.ts.map +1 -0
  85. package/lib/exercises/math/derivation/variations/signVarTableQuotientFExp.js +514 -0
  86. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.d.ts.map +1 -1
  87. package/lib/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.js +4 -11
  88. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.d.ts.map +1 -1
  89. package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.js +32 -17
  90. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts +13 -0
  91. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.d.ts.map +1 -0
  92. package/lib/exercises/math/probaStat/conditional/conditionalProbaFromTableWithContext.js +195 -0
  93. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts +9 -0
  94. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.d.ts.map +1 -0
  95. package/lib/exercises/math/probaStat/conditional/conditionalProbaWriteFromFrench.js +220 -0
  96. package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts +15 -0
  97. package/lib/exercises/math/probaStat/conditional/conditionalProbability.d.ts.map +1 -0
  98. package/lib/exercises/math/probaStat/conditional/conditionalProbability.js +332 -0
  99. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts +8 -0
  100. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.d.ts.map +1 -0
  101. package/lib/exercises/math/probaStat/conditional/fillTableConditionalProbabilitySituation.js +222 -0
  102. package/lib/exercises/math/probaStat/conditional/index.d.ts +5 -0
  103. package/lib/exercises/math/probaStat/conditional/index.d.ts.map +1 -0
  104. package/lib/exercises/math/probaStat/conditional/index.js +4 -0
  105. package/lib/exercises/math/probaStat/index.d.ts +1 -2
  106. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  107. package/lib/exercises/math/probaStat/index.js +1 -2
  108. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts +1 -0
  109. package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
  110. package/lib/exercises/math/probaStat/probaFromTableWithContext.js +26 -199
  111. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.d.ts.map +1 -1
  112. package/lib/exercises/math/probaStat/randomVariable/randomVariableSituationProbabilityLaw.js +6 -2
  113. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -1
  114. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +6 -5
  115. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.d.ts.map +1 -1
  116. package/lib/exercises/math/probaStat/trees/buildTreeFromSituation.js +4 -27
  117. package/lib/exercises/math/probaStat/twoEventsSituations.d.ts +29 -0
  118. package/lib/exercises/math/probaStat/twoEventsSituations.d.ts.map +1 -0
  119. package/lib/exercises/math/probaStat/twoEventsSituations.js +145 -0
  120. package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts +4 -1
  121. package/lib/exercises/math/sequences/explicitFormulaUsage.d.ts.map +1 -1
  122. package/lib/exercises/math/sequences/explicitFormulaUsage.js +47 -7
  123. package/lib/exercises/math/sequences/geometric/geometricFindRandomTermFromTwoTerms.js +1 -1
  124. package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts +5 -1
  125. package/lib/exercises/math/sequences/recurrenceFormulaUsage.d.ts.map +1 -1
  126. package/lib/exercises/math/sequences/recurrenceFormulaUsage.js +89 -9
  127. package/lib/exercises/math/trigonometry/circle/associatePoint.d.ts.map +1 -1
  128. package/lib/exercises/math/trigonometry/circle/associatePoint.js +55 -6
  129. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.d.ts.map +1 -1
  130. package/lib/exercises/math/trigonometry/circle/selectQuadrantOnTrigoCircle.js +5 -6
  131. package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.d.ts.map +1 -1
  132. package/lib/exercises/math/trigonometry/functions/associateAngleSimplification.js +1 -3
  133. package/lib/exercises/vea/polynomialVEA.d.ts +2 -0
  134. package/lib/exercises/vea/polynomialVEA.d.ts.map +1 -0
  135. package/lib/exercises/vea/polynomialVEA.js +17 -0
  136. package/lib/exercises/vea/valueTableVEA.d.ts +8 -0
  137. package/lib/exercises/vea/valueTableVEA.d.ts.map +1 -0
  138. package/lib/exercises/vea/valueTableVEA.js +12 -0
  139. package/lib/index.d.ts +27 -11
  140. package/lib/index.d.ts.map +1 -1
  141. package/lib/latexTester.d.ts.map +1 -1
  142. package/lib/latexTester.js +1 -1
  143. package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts +19 -0
  144. package/lib/math/utils/polynomial/polynomialInterpolationUtils.d.ts.map +1 -0
  145. package/lib/math/utils/polynomial/polynomialInterpolationUtils.js +53 -0
  146. package/lib/math/utils/polynomial/polynomialUtils.d.ts +37 -0
  147. package/lib/math/utils/polynomial/polynomialUtils.d.ts.map +1 -0
  148. package/lib/math/utils/polynomial/polynomialUtils.js +223 -0
  149. package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
  150. package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +6 -6
  151. package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
  152. package/lib/tree/nodes/operators/multiplyNode.js +1 -1
  153. package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
  154. package/lib/tree/nodes/operators/substractNode.js +2 -1
  155. package/lib/tree/utilities/nodeUtils.d.ts +6 -0
  156. package/lib/tree/utilities/nodeUtils.d.ts.map +1 -0
  157. package/lib/tree/utilities/nodeUtils.js +24 -0
  158. package/lib/utils/strings/prependArticle.d.ts +2 -0
  159. package/lib/utils/strings/prependArticle.d.ts.map +1 -0
  160. package/lib/utils/strings/prependArticle.js +1 -0
  161. package/package.json +1 -1
@@ -0,0 +1,514 @@
1
+ import { GeneratorOptionType, GeneratorOptionTarget, } from "../../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
3
+ import { varSignTableVEA } from "../../../../exercises/vea/varSignTableVEA.js";
4
+ import { InequationSymbol, } from "../../../../math/inequations/inequation.js";
5
+ import { AffineConstructor } from "../../../../math/polynomials/affine.js";
6
+ import { Trinom, TrinomConstructor } from "../../../../math/polynomials/trinom.js";
7
+ import { randint } from "../../../../math/utils/random/randint.js";
8
+ import { exp } from "../../../../tree/nodes/functions/expNode.js";
9
+ import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
10
+ import { InequationSolutionNode } from "../../../../tree/nodes/inequations/inequationSolutionNode.js";
11
+ import { MinusInfinityNode, PlusInfinityNode, } from "../../../../tree/nodes/numbers/infiniteNode.js";
12
+ import { frac, isFractionNode, } from "../../../../tree/nodes/operators/fractionNode.js";
13
+ import { isMultiplyNode, multiply, } from "../../../../tree/nodes/operators/multiplyNode.js";
14
+ import { substract } from "../../../../tree/nodes/operators/substractNode.js";
15
+ import { ClosureType } from "../../../../tree/nodes/sets/closure.js";
16
+ import { IntervalNode } from "../../../../tree/nodes/sets/intervalNode.js";
17
+ import { isUnionIntervalNode, UnionIntervalNode, } from "../../../../tree/nodes/sets/unionIntervalNode.js";
18
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
19
+ import { zip } from "../../../../utils/arrays/arrayZip.js";
20
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
21
+ import { alignTex } from "../../../../utils/latex/alignTex.js";
22
+ const _simplifyMore = (node) => {
23
+ if (isMultiplyNode(node)) {
24
+ const nodeLeft = node.leftChild;
25
+ const nodeRight = node.rightChild;
26
+ try {
27
+ return multiply(nodeLeft.simplify({ forbidFactorize: true, towardsDistribute: true }), nodeRight.simplify({ forbidFactorize: true, towardsDistribute: true }));
28
+ }
29
+ catch (_) {
30
+ return node;
31
+ }
32
+ }
33
+ else {
34
+ return node;
35
+ }
36
+ };
37
+ const getInstructionNode = (a, b, c, isFOverExp) => {
38
+ const nodeF = getNodeF(a, b, c);
39
+ const nodeG = "x".toTree();
40
+ const nodeExpG = exp(nodeG);
41
+ return isFOverExp ? frac(nodeF, nodeExpG) : frac(nodeExpG, nodeF);
42
+ };
43
+ const getNodeF = (a, b, c) => {
44
+ if (a !== undefined) {
45
+ return TrinomConstructor.fromCoeffs([c, b, a]).toTree().simplify();
46
+ }
47
+ else if (b !== undefined) {
48
+ return AffineConstructor.fromCoeffs([c, b]).toTree().simplify();
49
+ }
50
+ else {
51
+ return c.toTree();
52
+ }
53
+ };
54
+ const getRootNodesOfDerivative = (a, b, c) => {
55
+ //get coeffs
56
+ let coeffs;
57
+ if (a !== undefined) {
58
+ coeffs = zip([c, b, a], [b, 2 * a, 0]).map(([c1, c2]) => c1 - c2);
59
+ }
60
+ else {
61
+ coeffs = zip([c, b], [b, 0]).map(([c1, c2]) => c1 - c2);
62
+ }
63
+ //get roots
64
+ if (coeffs.length === 3) {
65
+ const trinom = TrinomConstructor.fromCoeffs(coeffs);
66
+ return trinom.getRootsNode();
67
+ }
68
+ else {
69
+ const [c, b] = coeffs;
70
+ return [frac(opposite(c), b).simplify()];
71
+ }
72
+ };
73
+ const getTrinomInequationSolutionNode = (coeffs, ineqType) => {
74
+ const [c, b, a] = coeffs;
75
+ const ineq = new InequationSymbol(ineqType);
76
+ const trinom = new Trinom(a, b, c);
77
+ const roots = trinom.getRootsNode();
78
+ const aPositive = a > 0;
79
+ const insideInterval = new IntervalNode(roots[0], roots[1], ineq.isStrict ? ClosureType.OO : ClosureType.FF);
80
+ const outsideUnion = new UnionIntervalNode([
81
+ new IntervalNode(MinusInfinityNode, roots[0], ineq.isStrict ? ClosureType.OO : ClosureType.OF),
82
+ new IntervalNode(roots[1], PlusInfinityNode, ineq.isStrict ? ClosureType.OO : ClosureType.FO),
83
+ ]);
84
+ const tree = ineq.isSup
85
+ ? aPositive
86
+ ? outsideUnion
87
+ : insideInterval
88
+ : aPositive
89
+ ? insideInterval
90
+ : outsideUnion;
91
+ return new InequationSolutionNode(tree);
92
+ };
93
+ const getInstruction = (identifiers) => {
94
+ const { coeffsF, isFOverExp } = identifiers;
95
+ const [c, b, a] = coeffsF;
96
+ const nodeH = getInstructionNode(a, b, c, isFOverExp);
97
+ return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
98
+
99
+ $$
100
+ h(x) = ${nodeH.toTex()}
101
+ $$
102
+
103
+ Dresser le tableau de signes de $h'$ et de variations de $h$.
104
+
105
+ `;
106
+ };
107
+ const getInitTable = (identifiers) => {
108
+ const { coeffsF } = identifiers;
109
+ const [c, b, a] = coeffsF;
110
+ const nbRoots = getRootNodesOfDerivative(a, b, c).length;
111
+ if (nbRoots === 1) {
112
+ return [
113
+ ["$x$", "", "\\ ", "", "\\ ", ""],
114
+ //sign
115
+ ["$h'(x)$", "\\ ", "", "", "", "\\ "],
116
+ //var
117
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
118
+ ["$h(x)$", "\\ ", "", "", "", "\\ "],
119
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
120
+ ];
121
+ }
122
+ else {
123
+ return [
124
+ ["$x$", "", "\\ ", "", "\\ ", "", "\\ ", ""],
125
+ //sign
126
+ ["$h'(x)$", "\\ ", "", "", "", "", "", "\\ "],
127
+ //var
128
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
129
+ ["$h(x)$", "\\ ", "", "", "", "", "", "\\ "],
130
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
131
+ ];
132
+ }
133
+ };
134
+ const getAnswerTable = (identifiers) => {
135
+ const { coeffsF, isFOverExp } = identifiers;
136
+ const [c, b, a] = coeffsF;
137
+ const rootNodes = getRootNodesOfDerivative(a, b, c);
138
+ const nodeH = getInstructionNode(a, b, c, isFOverExp);
139
+ const nodeHPrime = nodeH.derivative();
140
+ if (rootNodes.length === 1) {
141
+ const [rootNode] = rootNodes;
142
+ const rootNodeMinus1 = substract(rootNode, 1);
143
+ const hPrimeRootMinus1 = nodeHPrime.evaluate({
144
+ x: rootNodeMinus1.evaluate(),
145
+ });
146
+ const [strSignHPrimeRootMinus1, strSignHPrimeRootPlus1] = hPrimeRootMinus1 > 0 ? ["+", "-"] : ["-", "+"];
147
+ const nodeHRoot = nodeH
148
+ .toDetailedEvaluation({
149
+ x: rootNode,
150
+ })
151
+ .simplify();
152
+ return [
153
+ ["$x$", "-\\infty", "\\ ", rootNode.toTex(), "\\ ", "+\\infty"],
154
+ //sign
155
+ [
156
+ "$h'(x)$",
157
+ "\\ ",
158
+ strSignHPrimeRootMinus1,
159
+ "0",
160
+ strSignHPrimeRootPlus1,
161
+ "\\ ",
162
+ ],
163
+ //var
164
+ ...(strSignHPrimeRootMinus1 === "+"
165
+ ? [
166
+ ["$\\ $", "\\ ", "\\ ", nodeHRoot.toTex(), "\\ ", "\\ "],
167
+ ["$h(x)$", "\\ ", "\\nearrow", "\\ ", "\\searrow", "\\ "],
168
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
169
+ ]
170
+ : [
171
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
172
+ ["$h(x)$", "\\ ", "\\searrow", "\\ ", "\\nearrow", "\\ "],
173
+ ["$\\ $", "\\ ", "\\ ", nodeHRoot.toTex(), "\\ ", "\\ "],
174
+ ]),
175
+ ];
176
+ }
177
+ else {
178
+ const [rootNode1, rootNode2] = rootNodes;
179
+ const root1Minus1 = substract(rootNode1, 1);
180
+ const hPrimeRoot1Minus1 = nodeHPrime.evaluate({
181
+ x: root1Minus1.evaluate(),
182
+ });
183
+ const [strSignHPrimeRoot1Minus1, strSignHPrimeRootAvg, strSignHPrimeRoot2Plus1,] = hPrimeRoot1Minus1 > 0 ? ["+", "-", "+"] : ["-", "+", "-"];
184
+ const [nodeHRoot1, nodeHRoot2] = [rootNode1, rootNode2].map((nodeX) => nodeH
185
+ .toDetailedEvaluation({
186
+ x: nodeX,
187
+ })
188
+ .simplify());
189
+ return [
190
+ [
191
+ "$x$",
192
+ "-\\infty",
193
+ "\\ ",
194
+ rootNode1.toTex(),
195
+ "\\ ",
196
+ rootNode2.toTex(),
197
+ "\\ ",
198
+ "+\\infty",
199
+ ],
200
+ //sign
201
+ [
202
+ "$h'(x)$",
203
+ "\\ ",
204
+ strSignHPrimeRoot1Minus1,
205
+ "0",
206
+ strSignHPrimeRootAvg,
207
+ "0",
208
+ strSignHPrimeRoot2Plus1,
209
+ "\\ ",
210
+ ],
211
+ //var
212
+ ...(strSignHPrimeRoot1Minus1 === "+"
213
+ ? [
214
+ [
215
+ "$\\ $",
216
+ "\\ ",
217
+ "\\ ",
218
+ nodeHRoot1.toTex(),
219
+ "\\ ",
220
+ "\\ ",
221
+ "\\ ",
222
+ "\\ ",
223
+ ],
224
+ [
225
+ "$h(x)$",
226
+ "\\ ",
227
+ "\\nearrow",
228
+ "\\ ",
229
+ "\\searrow",
230
+ "\\ ",
231
+ "\\nearrow",
232
+ "\\ ",
233
+ ],
234
+ [
235
+ "$\\ $",
236
+ "\\ ",
237
+ "\\ ",
238
+ "\\ ",
239
+ "\\ ",
240
+ nodeHRoot2.toTex(),
241
+ "\\ ",
242
+ "\\ ",
243
+ ],
244
+ ]
245
+ : [
246
+ [
247
+ "$\\ $",
248
+ "\\ ",
249
+ "\\ ",
250
+ "\\ ",
251
+ "\\ ",
252
+ nodeHRoot2.toTex(),
253
+ "\\ ",
254
+ "\\ ",
255
+ ],
256
+ [
257
+ "$h(x)$",
258
+ "\\ ",
259
+ "\\searrow",
260
+ "\\ ",
261
+ "\\nearrow",
262
+ "\\ ",
263
+ "\\searrow",
264
+ "\\ ",
265
+ ],
266
+ [
267
+ "$\\ $",
268
+ "\\ ",
269
+ "\\ ",
270
+ nodeHRoot1.toTex(),
271
+ "\\ ",
272
+ "\\ ",
273
+ "\\ ",
274
+ "\\ ",
275
+ ],
276
+ ]),
277
+ ];
278
+ }
279
+ };
280
+ const getHint = () => {
281
+ return `Commence par déterminer la fonction dérivée $h'$ de $h$. Puis, étudie le signe de $h'$ en résolvant l'inéquation $h'(x)\\geq 0$.
282
+
283
+ Enfin, sers-toi de la propriété suivante :
284
+
285
+ - si $h'$ est positive sur un intervalle $I$, alors $h$ est croissante sur $I$;
286
+ - si $h'$ est négative sur un intervalle $I$, alors $h$ est décroissante sur $I$.`;
287
+ };
288
+ const getCorrection = (identifiers) => {
289
+ const { coeffsF, isFOverExp } = identifiers;
290
+ const [c, b, a] = coeffsF;
291
+ const rootNodes = getRootNodesOfDerivative(a, b, c);
292
+ const nodeH = getInstructionNode(a, b, c, isFOverExp);
293
+ const nodeHPrime = nodeH.derivative();
294
+ if (rootNodes.length === 1) {
295
+ const [rootNode] = rootNodes;
296
+ const rootTex = rootNode.toTex();
297
+ const rootNodeMinus1 = substract(rootNode, 1);
298
+ const hPrimeRootMinus1 = nodeHPrime.evaluate({
299
+ x: rootNodeMinus1.evaluate(),
300
+ });
301
+ const signs = hPrimeRootMinus1 > 0 ? ["+", "-"] : ["-", "+"];
302
+ const signWords = signs.map((strSign) => strSign === "+" ? "positive" : "négative");
303
+ const words = signs.map((strSign) => strSign === "+" ? "croissante" : "décroissante");
304
+ const image = nodeH
305
+ .toDetailedEvaluation({
306
+ x: rootNode,
307
+ })
308
+ .simplify();
309
+ return `On calcule $h'$ :
310
+
311
+ $$
312
+ h'(x) = ${nodeHPrime.simplify().toTex()}
313
+ $$
314
+
315
+ On détermine ensuite le signe de $h'(x)$ :
316
+
317
+ ${alignTex([
318
+ ["", "h'(x) \\geq 0"],
319
+ ["\\iff", nodeHPrime.simplify().toTex() + "\\geq 0"],
320
+ [
321
+ "\\iff",
322
+ (() => {
323
+ if (isFOverExp) {
324
+ return frac(nodeHPrime, exp(opposite("x".toTree()))).simplify();
325
+ }
326
+ else {
327
+ const nodeWithoutExp = frac(nodeHPrime, exp("x".toTree())).simplify();
328
+ if (isFractionNode(nodeWithoutExp)) {
329
+ return nodeWithoutExp.leftChild.simplify({ towardsDistribute: true });
330
+ }
331
+ else {
332
+ return nodeWithoutExp;
333
+ }
334
+ }
335
+ })().toTex() + "\\geq 0",
336
+ ],
337
+ ["\\iff", "x" + (b > 0 ? "\\geq" : "\\leq") + rootTex],
338
+ ])}
339
+
340
+ $h'$ est donc ${signWords[0]} sur $]-\\infty; ${rootTex}]$, puis ${signWords[1]} sur $[${rootTex}; +\\infty[$.
341
+
342
+ On en conclut que $h$ est ${words[0]} sur $]-\\infty; ${rootTex}]$, puis ${words[1]} sur $[${rootTex}; +\\infty[$.
343
+
344
+ Pour compléter le tableau, il ne reste plus qu'à calculer l'image par $h$ de $${rootTex}$ :
345
+
346
+ $$
347
+ h\\left(${rootTex}\\right) = ${image.toTex()} = ${image.simplify().toTex()}
348
+ $$`;
349
+ }
350
+ else {
351
+ const coeffs = zip([c, b, a], [b, 2 * a, 0]).map(([c1, c2]) => c1 - c2);
352
+ const inequationSolutionNode = getTrinomInequationSolutionNode(coeffs, "\\ge");
353
+ const arrIntervalNode = (() => {
354
+ if (isUnionIntervalNode(inequationSolutionNode.intervalSolution)) {
355
+ return inequationSolutionNode.intervalSolution.sets;
356
+ }
357
+ else {
358
+ return [inequationSolutionNode.intervalSolution];
359
+ }
360
+ })();
361
+ return `On calcule $h'$ :
362
+
363
+ $$
364
+ h'(x) = ${nodeHPrime.simplify().toTex()}
365
+ $$
366
+
367
+ On détermine ensuite le signe de $h'(x)$ :
368
+
369
+ ${alignTex([
370
+ ["", "h'(x) \\geq 0"],
371
+ ["\\iff", nodeHPrime.simplify().toTex() + "\\geq 0"],
372
+ [
373
+ "\\iff",
374
+ (() => {
375
+ if (isFOverExp) {
376
+ return frac(nodeHPrime, exp(opposite("x".toTree()))).simplify();
377
+ }
378
+ else {
379
+ const nodeWithoutExp = frac(nodeHPrime, exp("x".toTree())).simplify();
380
+ if (isFractionNode(nodeWithoutExp)) {
381
+ return nodeWithoutExp.leftChild.simplify({ towardsDistribute: true });
382
+ }
383
+ else {
384
+ return nodeWithoutExp;
385
+ }
386
+ }
387
+ })().toTex() + "\\geq 0",
388
+ ],
389
+ ])}
390
+
391
+ On résout l'inéquation :
392
+
393
+ $$
394
+ ${inequationSolutionNode.toTex()}
395
+ $$
396
+
397
+ $h$ est donc croissante sur ${arrIntervalNode
398
+ .map((node) => `$${node.toTex()}$`)
399
+ .join(" et ")}.
400
+
401
+ On calcule enfin les extrema locaux de $h$.
402
+
403
+ `;
404
+ }
405
+ };
406
+ const getKeys = () => {
407
+ return ["infty"];
408
+ };
409
+ const isAnswerTableValid = (ans, { answerTable }) => {
410
+ try {
411
+ return varSignTableVEA(ans, answerTable);
412
+ }
413
+ catch (err) {
414
+ return handleVEAError(err);
415
+ }
416
+ };
417
+ const createRandomIdentifiers = (opts) => {
418
+ const { typeF } = opts;
419
+ const coeffsF = (() => {
420
+ switch (typeF) {
421
+ case "affine": {
422
+ const b = randint(-8, 9, [0]);
423
+ const c = randint(-4, 5) * b;
424
+ return [c, b];
425
+ }
426
+ case "second degré": {
427
+ // return TrinomConstructor.randomNiceRoots().coefficients;
428
+ //we want integer roots for h'
429
+ const b = randint(1, 11);
430
+ return [1, b, 1];
431
+ }
432
+ default:
433
+ throw new Error("Unsupported typeF: " + typeF);
434
+ }
435
+ })();
436
+ const isFOverExp = coinFlip();
437
+ const identifiers = {
438
+ coeffsF,
439
+ isFOverExp,
440
+ };
441
+ return identifiers;
442
+ };
443
+ const getSignVarTableQuotientFExpQuestion = (optsIn) => {
444
+ const opts = optsIn ?? optsDefault;
445
+ let identifiers;
446
+ let counter = -1;
447
+ let isValid = false;
448
+ while (!isValid && counter < 100) {
449
+ counter++;
450
+ const identifiersCandidate = createRandomIdentifiers(opts);
451
+ try {
452
+ getAnswerTable(identifiersCandidate, opts);
453
+ isValid = true;
454
+ }
455
+ catch (_) {
456
+ (() => { })();
457
+ }
458
+ if (isValid) {
459
+ identifiers = identifiersCandidate;
460
+ }
461
+ }
462
+ if (!isValid) {
463
+ const identifiersDefault = {
464
+ coeffsF: [1, 5, 1],
465
+ isFOverExp: true,
466
+ };
467
+ identifiers = identifiersDefault;
468
+ }
469
+ return getQuestionFromIdentifiers(identifiers, opts);
470
+ };
471
+ const getQuestionFromIdentifiers = (identifiers, opts) => {
472
+ return {
473
+ answerTable: getAnswerTable(identifiers),
474
+ instruction: getInstruction(identifiers),
475
+ keys: getKeys(identifiers),
476
+ answerFormat: "tex",
477
+ identifiers,
478
+ options: opts,
479
+ hint: getHint(identifiers),
480
+ correction: getCorrection(identifiers),
481
+ initTable: getInitTable(identifiers),
482
+ };
483
+ };
484
+ const optsDefault = {
485
+ typeF: "affine",
486
+ };
487
+ const options = [
488
+ {
489
+ id: "typeF",
490
+ label: "Fonction $f$",
491
+ type: GeneratorOptionType.select,
492
+ target: GeneratorOptionTarget.generation,
493
+ values: ["affine", "second degré"],
494
+ defaultValue: optsDefault.typeF,
495
+ },
496
+ ];
497
+ export const signVarTableQuotientFExp = {
498
+ id: "signVarTableQuotientFExp",
499
+ label: "Dresser le tableau de variations de $x \\mapsto \\frac{f(x)}{\\exp(x)}$ ou de $x \\mapsto \\frac{\\exp(x)}{f(x)}$",
500
+ isSingleStep: true,
501
+ generator: (nb, opts) => getDistinctQuestions(() => getSignVarTableQuotientFExpQuestion(opts), nb),
502
+ options,
503
+ qcmTimer: 60,
504
+ freeTimer: 60,
505
+ isAnswerTableValid,
506
+ subject: "Mathématiques",
507
+ getInstruction,
508
+ getHint,
509
+ getCorrection,
510
+ getAnswerTable,
511
+ getQuestionFromIdentifiers,
512
+ hasHintAndCorrection: true,
513
+ answerType: "signVarTable",
514
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"signOfProductOfAffineAndTrinom.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AA2PF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAqBhE,CAAC"}
1
+ {"version":3,"file":"signOfProductOfAffineAndTrinom.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/functions/trinoms/sign/signOfProductOfAffineAndTrinom.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAST,MAAM,6BAA6B,CAAC;AAerC,KAAK,WAAW,GAAG;IACjB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAmPF,eAAO,MAAM,8BAA8B,EAAE,QAAQ,CAAC,WAAW,CAqBhE,CAAC"}
@@ -66,7 +66,7 @@ const getAnswerTable = (identifiers) => {
66
66
  return "-";
67
67
  };
68
68
  const thirdLine = [
69
- `$${buildF(identifiers).toTex()}$`,
69
+ `$f(x)$`,
70
70
  "\\ ",
71
71
  buildSign(partial[1][2], partial[2][2]),
72
72
  "0",
@@ -79,12 +79,6 @@ const getAnswerTable = (identifiers) => {
79
79
  ];
80
80
  return [...partial, thirdLine];
81
81
  };
82
- const buildF = (identifiers) => {
83
- const { affineCoeffs, trinomCoeffs } = identifiers;
84
- const affine = new Affine(affineCoeffs[1], affineCoeffs[0]);
85
- const trinom = new Trinom(trinomCoeffs[2], trinomCoeffs[1], trinomCoeffs[0]);
86
- return multiply(affine.toTree(), trinom.toTree());
87
- };
88
82
  const buildFcts = (identifiers) => {
89
83
  const { affineCoeffs, trinomCoeffs } = identifiers;
90
84
  const affine = new Affine(affineCoeffs[1], affineCoeffs[0]);
@@ -106,7 +100,7 @@ const getHint = () => {
106
100
 
107
101
  Détermine le signe de la fonction affine en résolvant l'inéquation $g(x)\\geq 0$.
108
102
 
109
- Puis détermine le signe de la fonction polynôme du second degré $g$ en trouvant ses racines.
103
+ Puis détermine le signe de la fonction polynôme du second degré $h$ en trouvant ses racines.
110
104
 
111
105
  Enfin, entre tes résultats dans le tableau. Le signe de $f(x)$ s'obtiendra alors en utilisant la règle des signes.`;
112
106
  };
@@ -175,7 +169,6 @@ const getSignOfProductOfAffineAndTrinomQuestion = () => {
175
169
  };
176
170
  const getQuestionFromIdentifiers = (identifiers) => {
177
171
  const fcts = buildFcts(identifiers);
178
- const f = buildF(identifiers);
179
172
  return {
180
173
  answerTable: getAnswerTable(identifiers),
181
174
  instruction: getInstruction(identifiers),
@@ -185,7 +178,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
185
178
  hint: getHint(identifiers),
186
179
  correction: getCorrection(identifiers),
187
180
  initTable: [
188
- ["$x$", "", "\\ ", "", "\\ ", "", "\\ ", "", "\\ ", "+\\infty"],
181
+ ["$x$", "", "\\ ", "", "\\ ", "", "\\ ", "", "\\ ", ""],
189
182
  [
190
183
  `$${fcts.affine.toTree().toTex()}$`,
191
184
  "\\ ",
@@ -210,7 +203,7 @@ const getQuestionFromIdentifiers = (identifiers) => {
210
203
  "",
211
204
  "\\ ",
212
205
  ],
213
- [`$${f.toTex()}$`, "\\ ", "", "", "", "", "", "", "", "\\ "],
206
+ [`$f(x)$`, "\\ ", "", "", "", "", "", "", "", "\\ "],
214
207
  ],
215
208
  };
216
209
  };
@@ -1 +1 @@
1
- {"version":3,"file":"scalarProductOrthoInSquare.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAiBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAkOF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAmB5D,CAAC"}
1
+ {"version":3,"file":"scalarProductOrthoInSquare.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/geometry/vectors/scalarProduct/scalarProductOrthoInSquare.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAoBT,MAAM,6BAA6B,CAAC;AAkBrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAoPF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAmB5D,CAAC"}
@@ -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> = (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]) return `immédiat`;
182
- // for (let i = 0; i < vecs[index1].length; i++) {
183
- // const rep = vecs[index1][i];
184
- // const origin1 = rep[0];
185
- // const sameOrigin = vecs[index2].find((e) => e[0] === origin1);
186
- // if (sameOrigin)
187
- // return `on prend $${rep}$ et $${sameOrigin}$. ${sameOrigin[1]} à projeter sur ${rep}`;
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
@@ -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"}