math-exercises 3.0.166 → 3.0.168

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 (132) hide show
  1. package/lib/exercises/math/_debug/debugVarSignTableReading.d.ts.map +1 -1
  2. package/lib/exercises/math/_debug/debugVarSignTableReading.js +1 -10
  3. package/lib/exercises/math/_debug/index.d.ts +1 -2
  4. package/lib/exercises/math/_debug/index.d.ts.map +1 -1
  5. package/lib/exercises/math/_debug/index.js +1 -2
  6. package/lib/exercises/math/derivation/variations/index.d.ts +3 -0
  7. package/lib/exercises/math/derivation/variations/index.d.ts.map +1 -1
  8. package/lib/exercises/math/derivation/variations/index.js +4 -0
  9. package/lib/exercises/math/derivation/variations/signVarTable3dDegree.d.ts +2 -0
  10. package/lib/exercises/math/derivation/variations/signVarTable3dDegree.d.ts.map +1 -0
  11. package/lib/exercises/math/derivation/variations/signVarTable3dDegree.js +203 -0
  12. package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.d.ts +9 -0
  13. package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.d.ts.map +1 -0
  14. package/lib/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.js +163 -0
  15. package/lib/exercises/math/derivation/variations/signVarTableFromGraph.d.ts +9 -0
  16. package/lib/exercises/math/derivation/variations/signVarTableFromGraph.d.ts.map +1 -0
  17. package/lib/exercises/math/derivation/variations/signVarTableFromGraph.js +189 -0
  18. package/lib/exercises/math/derivation/variations/signVarTableTrinom.d.ts +9 -0
  19. package/lib/exercises/math/derivation/variations/signVarTableTrinom.d.ts.map +1 -0
  20. package/lib/exercises/math/derivation/variations/signVarTableTrinom.js +148 -0
  21. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.d.ts.map +1 -1
  22. package/lib/exercises/math/functions/affines/affineAdjustmentComplete.js +1 -4
  23. package/lib/exercises/math/functions/index.d.ts +1 -0
  24. package/lib/exercises/math/functions/index.d.ts.map +1 -1
  25. package/lib/exercises/math/functions/index.js +1 -0
  26. package/lib/exercises/math/functions/inverse/compareInverseValues.d.ts.map +1 -1
  27. package/lib/exercises/math/functions/inverse/compareInverseValues.js +1 -10
  28. package/lib/exercises/math/functions/periodicity/index.d.ts +2 -0
  29. package/lib/exercises/math/functions/periodicity/index.d.ts.map +1 -0
  30. package/lib/exercises/math/functions/periodicity/index.js +1 -0
  31. package/lib/exercises/math/functions/sign/equationFromSignTable.d.ts.map +1 -1
  32. package/lib/exercises/math/functions/sign/equationFromSignTable.js +3 -0
  33. package/lib/exercises/math/functions/trinoms/equation/index.d.ts +2 -0
  34. package/lib/exercises/math/functions/trinoms/equation/index.d.ts.map +1 -1
  35. package/lib/exercises/math/functions/trinoms/equation/index.js +2 -0
  36. package/lib/exercises/math/functions/trinoms/equation/secondDegreeEquationWithRightMember.d.ts +11 -0
  37. package/lib/exercises/math/functions/trinoms/equation/secondDegreeEquationWithRightMember.d.ts.map +1 -0
  38. package/lib/exercises/math/functions/trinoms/equation/secondDegreeEquationWithRightMember.js +205 -0
  39. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.d.ts.map +1 -1
  40. package/lib/exercises/math/functions/trinoms/equation/secondDegreeInequation.js +78 -13
  41. package/lib/exercises/math/functions/trinoms/equation/solveBisquaredEquation.d.ts +9 -0
  42. package/lib/exercises/math/functions/trinoms/equation/solveBisquaredEquation.d.ts.map +1 -0
  43. package/lib/exercises/math/functions/trinoms/equation/solveBisquaredEquation.js +223 -0
  44. package/lib/exercises/math/functions/trinoms/equation/trinomSelectEquationWithoutDeltaNeeded.d.ts.map +1 -1
  45. package/lib/exercises/math/functions/trinoms/equation/trinomSelectEquationWithoutDeltaNeeded.js +3 -1
  46. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.d.ts.map +1 -1
  47. package/lib/exercises/math/functions/trinoms/roots/niceRootsFromDevForm.js +1 -0
  48. package/lib/exercises/math/functions/trinoms/roots/rootsReading.d.ts.map +1 -1
  49. package/lib/exercises/math/functions/trinoms/roots/rootsReading.js +27 -1
  50. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts +4 -1
  51. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.d.ts.map +1 -1
  52. package/lib/exercises/math/functions/trinoms/summitAndCanonical/alphaBetaFromDevForm.js +133 -11
  53. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts +4 -1
  54. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.d.ts.map +1 -1
  55. package/lib/exercises/math/functions/trinoms/summitAndCanonical/canonicalFromDevForm.js +135 -14
  56. package/lib/exercises/math/functions/trinoms/summitAndCanonical/findTrinomCanonicalFormFromGraph.d.ts +9 -0
  57. package/lib/exercises/math/functions/trinoms/summitAndCanonical/findTrinomCanonicalFormFromGraph.d.ts.map +1 -0
  58. package/lib/exercises/math/functions/trinoms/summitAndCanonical/findTrinomCanonicalFormFromGraph.js +123 -0
  59. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts +1 -0
  60. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.d.ts.map +1 -1
  61. package/lib/exercises/math/functions/trinoms/summitAndCanonical/index.js +1 -0
  62. package/lib/exercises/math/geometry/cartesian/cartesianEquationOfLineFromPerpendicularLine.js +1 -1
  63. package/lib/exercises/math/index.d.ts +0 -1
  64. package/lib/exercises/math/index.d.ts.map +1 -1
  65. package/lib/exercises/math/index.js +1 -1
  66. package/lib/exercises/math/probaStat/conditionalProbaWriteFromFrench.js +2 -2
  67. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts +1 -1
  68. package/lib/exercises/math/probaStat/probaFromTableNoContext.d.ts.map +1 -1
  69. package/lib/exercises/math/probaStat/probaFromTableNoContext.js +17 -11
  70. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.d.ts.map +1 -1
  71. package/lib/exercises/math/probaStat/randomVariable/findValueForFairRandomVariable.js +25 -14
  72. package/lib/exercises/math/probaStat/randomVariable/randomVariableValues.d.ts +2 -0
  73. package/lib/exercises/math/probaStat/randomVariable/randomVariableValues.d.ts.map +1 -0
  74. package/lib/exercises/math/probaStat/randomVariable/randomVariableValues.js +83 -0
  75. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts +12 -0
  76. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.d.ts.map +1 -0
  77. package/lib/exercises/math/probaStat/randomVariable/utils/randomVariableSituations.js +30 -0
  78. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.d.ts.map +1 -1
  79. package/lib/exercises/math/probaStat/twoStepExperiments/headsOrTailsTwiceOutcomes.js +1 -1
  80. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.d.ts.map +1 -1
  81. package/lib/exercises/math/sequences/geometric/geometricReasonUsage.js +35 -0
  82. package/lib/exercises/math/sequences/index.js +1 -0
  83. package/lib/exercises/math/sequences/limits/index.d.ts +2 -0
  84. package/lib/exercises/math/sequences/limits/index.d.ts.map +1 -0
  85. package/lib/exercises/math/sequences/limits/index.js +1 -0
  86. package/lib/exercises/math/sequences/limits/sequenceLimitReading.d.ts +2 -0
  87. package/lib/exercises/math/sequences/limits/sequenceLimitReading.d.ts.map +1 -0
  88. package/lib/exercises/math/sequences/limits/sequenceLimitReading.js +163 -0
  89. package/lib/exercises/math/trigonometry/circle/areReelsOnTheSameTrigoCirclePoint.js +2 -2
  90. package/lib/exercises/vea/numberVEA.d.ts +1 -1
  91. package/lib/exercises/vea/numberVEA.d.ts.map +1 -1
  92. package/lib/exercises/vea/numberVEA.js +7 -2
  93. package/lib/exercises/vea/signLineVEA.d.ts +8 -0
  94. package/lib/exercises/vea/signLineVEA.d.ts.map +1 -0
  95. package/lib/exercises/vea/signLineVEA.js +9 -0
  96. package/lib/exercises/vea/signTableVEA.d.ts +2 -0
  97. package/lib/exercises/vea/signTableVEA.d.ts.map +1 -0
  98. package/lib/exercises/vea/signTableVEA.js +5 -0
  99. package/lib/exercises/vea/varLineVEA.d.ts +8 -0
  100. package/lib/exercises/vea/varLineVEA.d.ts.map +1 -0
  101. package/lib/exercises/vea/varLineVEA.js +44 -0
  102. package/lib/exercises/vea/varSignTableVEA.d.ts +2 -0
  103. package/lib/exercises/vea/varSignTableVEA.d.ts.map +1 -0
  104. package/lib/exercises/vea/varSignTableVEA.js +8 -0
  105. package/lib/exercises/vea/varTableVEA.d.ts +2 -0
  106. package/lib/exercises/vea/varTableVEA.d.ts.map +1 -0
  107. package/lib/exercises/vea/varTableVEA.js +6 -0
  108. package/lib/exercises/vea/xTableLineVEA.d.ts +8 -0
  109. package/lib/exercises/vea/xTableLineVEA.d.ts.map +1 -0
  110. package/lib/exercises/vea/xTableLineVEA.js +18 -0
  111. package/lib/index.d.ts +32 -15
  112. package/lib/index.d.ts.map +1 -1
  113. package/lib/math/polynomials/polynomial.d.ts +1 -1
  114. package/lib/math/polynomials/polynomial.d.ts.map +1 -1
  115. package/lib/math/polynomials/polynomial.js +4 -2
  116. package/lib/tests/exoTest.d.ts.map +1 -1
  117. package/lib/tests/exoTest.js +6 -3
  118. package/lib/tests/pdfExo.test.js +2 -2
  119. package/lib/tests/pdfs/buildPDFForExercise.d.ts.map +1 -1
  120. package/lib/tests/pdfs/buildPDFForExercise.js +17 -1
  121. package/lib/tests/pdfs/dollarizeString.d.ts +2 -0
  122. package/lib/tests/pdfs/dollarizeString.d.ts.map +1 -0
  123. package/lib/tests/pdfs/dollarizeString.js +7 -0
  124. package/lib/tests/pdfs/signTableToLatex.js +1 -1
  125. package/lib/tests/pdfs/signVarTableToLatex.d.ts +2 -0
  126. package/lib/tests/pdfs/signVarTableToLatex.d.ts.map +1 -0
  127. package/lib/tests/pdfs/signVarTableToLatex.js +58 -0
  128. package/lib/tests/pdfs/varTableToLatex.d.ts.map +1 -1
  129. package/lib/tests/pdfs/varTableToLatex.js +2 -2
  130. package/lib/tests/questionTest.d.ts.map +1 -1
  131. package/lib/tests/questionTest.js +8 -4
  132. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"debugVarSignTableReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/_debug/debugVarSignTableReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAiQF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAWF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAenE,CAAC"}
1
+ {"version":3,"file":"debugVarSignTableReading.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/_debug/debugVarSignTableReading.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAmBT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAwPF,KAAK,OAAO,GAAG;IACb,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAWF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAenE,CAAC"}
@@ -35,16 +35,7 @@ const getTable = (identifiers) => {
35
35
  "\\ ",
36
36
  xValues[3].frenchify(),
37
37
  ],
38
- [
39
- "£f'(x)£",
40
- xValues[0].frenchify(),
41
- "+",
42
- xValues[1].frenchify(),
43
- "-",
44
- xValues[2].frenchify(),
45
- "+",
46
- xValues[3].frenchify(),
47
- ],
38
+ ["£f'(x)£", "\\ ", "+", "z", "-", "z", "+", ""],
48
39
  [
49
40
  " ",
50
41
  isFirstAscending ? "\\ " : yValues[0].frenchify(),
@@ -1,3 +1,2 @@
1
- export * from "./debugVarSignTableReading.js";
2
- export * from "./debugVarSignTableFromGraph.js";
1
+ export {};
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/_debug/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/_debug/index.ts"],"names":[],"mappings":""}
@@ -1,2 +1 @@
1
- export * from "./debugVarSignTableReading.js";
2
- export * from "./debugVarSignTableFromGraph.js";
1
+ export {};
@@ -2,4 +2,7 @@ export * from "./thirdDegreeFunctionVariation.js";
2
2
  export * from "./thirdDegreeDerivativeVariation.js";
3
3
  export * from "./variationArrowAmount.js";
4
4
  export * from "./readExtremaAbscissFromDerivativeCurve.js";
5
+ export * from "./signVarTableFromGraph.js";
6
+ export * from "./signVarTableFromDerivativeGraph.js";
7
+ export * from "./signVarTableTrinom.js";
5
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4CAA4C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,yBAAyB,CAAC"}
@@ -2,3 +2,7 @@ export * from "./thirdDegreeFunctionVariation.js";
2
2
  export * from "./thirdDegreeDerivativeVariation.js";
3
3
  export * from "./variationArrowAmount.js";
4
4
  export * from "./readExtremaAbscissFromDerivativeCurve.js";
5
+ export * from "./signVarTableFromGraph.js";
6
+ export * from "./signVarTableFromDerivativeGraph.js";
7
+ export * from "./signVarTableTrinom.js";
8
+ // export * from "./signVarTable3dDegree.js";
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=signVarTable3dDegree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signVarTable3dDegree.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/signVarTable3dDegree.ts"],"names":[],"mappings":""}
@@ -0,0 +1,203 @@
1
+ // import {
2
+ // Exercise,
3
+ // QuestionGenerator,
4
+ // GetHint,
5
+ // GetCorrection,
6
+ // GetInstruction,
7
+ // GetKeys,
8
+ // GetQuestionFromIdentifiers,
9
+ // GetAnswerTable,
10
+ // TableVEA,
11
+ // } from "../../../../exercises/exercise.js";
12
+ // import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
13
+ // import { varSignTableVEA } from "../../../../exercises/vea/varSignTableVEA.js";
14
+ // import { Trinom, TrinomConstructor } from "../../../../math/polynomials/trinom.js";
15
+ // import { opposite } from "../../../../tree/nodes/functions/oppositeNode.js";
16
+ // import { add } from "../../../../tree/nodes/operators/addNode.js";
17
+ // import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
18
+ // import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
19
+ // import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
20
+ // import { alignTex } from "../../../../utils/latex/alignTex.js";
21
+ export {};
22
+ // //coeff de f'
23
+ // type Identifiers = {
24
+ // a: number;
25
+ // b: number;
26
+ // c: number;
27
+ // };
28
+ // const getAnswerTable: GetAnswerTable<Identifiers> = (identifiers) => {
29
+ // const { a, b, c } = identifiers;
30
+ // const trinom = new Trinom(a, b, c);
31
+ // const poly = trinom.integrateToNode({}, true);
32
+ // const roots = trinom.getRootsNode();
33
+ // const imgs = roots.map((r) =>
34
+ // poly
35
+ // .toDetailedEvaluation({
36
+ // x: r,
37
+ // })
38
+ // .simplify({
39
+ // calculatePowers: true,
40
+ // }),
41
+ // );
42
+ // return [
43
+ // [
44
+ // "$x$",
45
+ // "-\\infty",
46
+ // "\\ ",
47
+ // roots[0].toTex(),
48
+ // "\\ ",
49
+ // roots[1].toTex(),
50
+ // "\\ ",
51
+ // "+\\infty",
52
+ // ],
53
+ // [
54
+ // "$f'(x)$",
55
+ // "\\ ",
56
+ // a > 0 ? "+" : "-",
57
+ // "0",
58
+ // a > 0 ? "-" : "+",
59
+ // "0",
60
+ // a > 0 ? "+" : "-",
61
+ // "\\ ",
62
+ // ],
63
+ // [
64
+ // "$\\ $",
65
+ // "\\ ",
66
+ // "\\ ",
67
+ // a > 0 ? imgs[0].toTex() : "\\ ",
68
+ // "\\ ",
69
+ // a < 0 ? imgs[1].toTex() : "\\ ",
70
+ // "\\ ",
71
+ // "\\ ",
72
+ // ],
73
+ // [
74
+ // "$f(x)$",
75
+ // "\\ ",
76
+ // a > 0 ? "\\nearrow" : "\\searrow",
77
+ // "\\ ",
78
+ // a > 0 ? "\\searrow" : "\\nearrow",
79
+ // "\\ ",
80
+ // a > 0 ? "\\nearrow" : "\\searrow",
81
+ // "\\ ",
82
+ // ],
83
+ // [
84
+ // "$\\ $",
85
+ // "\\ ",
86
+ // "\\ ",
87
+ // a < 0 ? imgs[0].toTex() : "\\ ",
88
+ // "\\ ",
89
+ // a > 0 ? imgs[1].toTex() : "\\ ",
90
+ // "\\ ",
91
+ // "\\ ",
92
+ // ],
93
+ // ];
94
+ // };
95
+ // const getInstruction: GetInstruction<Identifiers> = (identifiers) => {
96
+ // const { a, b, c } = identifiers;
97
+ // const trinom = new Trinom(a, b, c);
98
+ // const poly = trinom.integrateToNode({}, true);
99
+ // return `Soit $f$ la fonction définie sur $\\mathbb{R}$ par :
100
+ // $$
101
+ // f(x) = ${poly.toTex()}
102
+ // $$
103
+ // Dresser le tableau de signes de $f'$ et de variations de $f$.
104
+ // `;
105
+ // };
106
+ // const getHint: GetHint<Identifiers> = () => {
107
+ // return `Commence par déterminer la fonction dérivée $f'$ de $f$. Puis, étudie le signe de $f'$ en résolvant l'inéquation $f'(x)\\geq 0$.
108
+ // Enfin, sers-toi de la propriété suivante :
109
+ // - si $f'$ est positive sur un intervalle $I$, alors $f$ est croissante sur $I$;
110
+ // - si $f'$ est négative sur un intervalle $I$, alors $f$ est décroissante sur $I$.`;
111
+ // };
112
+ // const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
113
+ // const { a, b, c } = identifiers;
114
+ // const trinom = new Trinom(a, b, c);
115
+ // const poly = trinom.integrateToNode({}, true);
116
+ // const roots = trinom.getRootsNode();
117
+ // const imgs = roots.map((r) =>
118
+ // poly
119
+ // .toDetailedEvaluation({
120
+ // x: r,
121
+ // })
122
+ // .simplify({
123
+ // calculatePowers: true,
124
+ // }),
125
+ // );
126
+ // const words =
127
+ // a > 0 ? ["décroissante", "croissante"] : ["croissante", "décroissante"];
128
+ // const signWords = a > 0 ? ["négative", "positive"] : ["positive", "négative"];
129
+ // return `On calcule $f'$ :
130
+ // $$
131
+ // f'(x) = ${poly.derivative().toTex()} = ${poly.derivative().simplify().toTex()}
132
+ // $$
133
+ // On détermine ensuite le signe de $f'(x)$ :
134
+ // ${alignTex([
135
+ // ["", "f'(x) \\geq 0"],
136
+ // [
137
+ // "\\iff",
138
+ // add(multiply(2, multiply(a, "x")), b)
139
+ // .simplify()
140
+ // .toTex() + "\\geq 0",
141
+ // ],
142
+ // ["\\iff", "x" + (a > 0 ? "\\geq" : "\\leq")],
143
+ // ])}
144
+ // `;
145
+ // };
146
+ // const getKeys: GetKeys<Identifiers> = () => {
147
+ // return ["infty"];
148
+ // };
149
+ // const isAnswerTableValid: TableVEA<Identifiers> = (ans, { answerTable }) => {
150
+ // try {
151
+ // return varSignTableVEA(ans, answerTable);
152
+ // } catch (err) {
153
+ // return handleVEAError(err);
154
+ // }
155
+ // };
156
+ // const getSignVarTableTrinomQuestion: QuestionGenerator<Identifiers> = () => {
157
+ // const trinom = TrinomConstructor.randomNiceRoots();
158
+ // const identifiers: Identifiers = {
159
+ // a: trinom.a,
160
+ // b: trinom.b,
161
+ // c: trinom.c,
162
+ // };
163
+ // return getQuestionFromIdentifiers(identifiers);
164
+ // };
165
+ // const getQuestionFromIdentifiers: GetQuestionFromIdentifiers<Identifiers> = (
166
+ // identifiers,
167
+ // ) => {
168
+ // return {
169
+ // answerTable: getAnswerTable(identifiers),
170
+ // instruction: getInstruction(identifiers),
171
+ // keys: getKeys(identifiers),
172
+ // answerFormat: "tex",
173
+ // identifiers,
174
+ // hint: getHint(identifiers),
175
+ // correction: getCorrection(identifiers),
176
+ // initTable: [
177
+ // ["$x$", "", "\\ ", "", "\\ ", "", "\\ ", ""],
178
+ // ["$f'(x)$", "\\ ", "", "", "", "", "", "\\ "],
179
+ // ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
180
+ // ["$f(x)$", "\\ ", "", "", "", "", "", "\\ "],
181
+ // ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
182
+ // ],
183
+ // };
184
+ // };
185
+ // export const signVarTable3dDegree: Exercise<Identifiers> = {
186
+ // id: "signVarTable3dDegree",
187
+ // label:
188
+ // "Dresser le tableau de signes de $f'$ et de variations de $f$ pour une fonction polynôme de degré trois",
189
+ // isSingleStep: true,
190
+ // generator: (nb, opts) =>
191
+ // getDistinctQuestions(() => getSignVarTableTrinomQuestion(opts), nb),
192
+ // qcmTimer: 60,
193
+ // freeTimer: 60,
194
+ // isAnswerTableValid,
195
+ // subject: "Mathématiques",
196
+ // getInstruction,
197
+ // getHint,
198
+ // getCorrection,
199
+ // getAnswerTable,
200
+ // getQuestionFromIdentifiers,
201
+ // hasHintAndCorrection: true,
202
+ // answerType: "signVarTable",
203
+ // };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ type: number;
4
+ coeffs: number[];
5
+ initTable: string[][];
6
+ };
7
+ export declare const signVarTableFromDerivativeGraph: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=signVarTableFromDerivativeGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signVarTableFromDerivativeGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/signVarTableFromDerivativeGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB,CAAC;AA4JF,eAAO,MAAM,+BAA+B,EAAE,QAAQ,CAAC,WAAW,CAmBjE,CAAC"}
@@ -0,0 +1,163 @@
1
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
2
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
3
+ import { Polynomial } from "../../../../math/polynomials/polynomial.js";
4
+ import { randint } from "../../../../math/utils/random/randint.js";
5
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
6
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
7
+ const getRoots = (identifiers) => {
8
+ const { coeffs } = identifiers;
9
+ const [_d, c, b, a] = coeffs;
10
+ const sqrtDelta = 2 * Math.sqrt(b ** 2 - 3 * a * c);
11
+ const x1 = (-2 * b - sqrtDelta) / (6 * a);
12
+ const x2 = (-2 * b + sqrtDelta) / (6 * a);
13
+ return [x1, x2].sort((a, b) => a - b);
14
+ };
15
+ const getGGBOptions = (identifiers) => {
16
+ const { coeffs } = identifiers;
17
+ const poly = new Polynomial(coeffs);
18
+ const deriv = poly.derivate();
19
+ const commands = [`f(x) =${deriv.toMathString()}`];
20
+ const ggb = new GeogebraConstructor({
21
+ commands,
22
+ lockedAxesRatio: false,
23
+ });
24
+ const [x1, x2] = getRoots(identifiers);
25
+ const alpha = (x1 + x2) / 2;
26
+ const beta = deriv.calculate(alpha);
27
+ return ggb.getOptions({
28
+ coords: ggb.getAdaptedCoords({
29
+ xMin: x1 - 2,
30
+ xMax: x2 + 2,
31
+ yMin: Math.min(-1, beta) - 2,
32
+ yMax: Math.max(1, beta) + 2,
33
+ }),
34
+ });
35
+ };
36
+ const getAnswerTable = (identifiers) => {
37
+ const { coeffs } = identifiers;
38
+ const [x1, x2] = getRoots(identifiers);
39
+ const vars = coeffs[3] > 0
40
+ ? ["\\nearrow", "\\searrow", "\\nearrow"]
41
+ : ["\\searrow", "\\nearrow", "\\searrow"];
42
+ const signs = coeffs[3] < 0 ? ["-", "+", "-"] : ["+", "-", "+"];
43
+ return [
44
+ [
45
+ "$x$",
46
+ "-\\infty",
47
+ "\\ ",
48
+ x1.toTree().toTex(),
49
+ "\\ ",
50
+ x2.toTree().toTex(),
51
+ "\\ ",
52
+ "+\\infty",
53
+ ],
54
+ ["$f'(x)$", "\\ ", signs[0], "0", signs[1], "0", signs[2], "\\ "],
55
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
56
+ ["$f(x)$", "\\ ", vars[0], "\\ ", vars[1], "\\ ", vars[2], "\\ "],
57
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
58
+ ];
59
+ };
60
+ const getInstruction = () => {
61
+ return `On considère une fonction $f$, définie et dérivable sur $\\mathbb{R}$, dont la fonction dérivée $f'$ est représentée ci-dessous.
62
+
63
+ Dresser le tableau de signes de $f'$ et de variations de $f$.`;
64
+ };
65
+ const getHint = () => {
66
+ return `La fonction $f$ est définie sur $\\mathbb{R}$, donc les valeurs de $x$ vont de $-\\infty$ à $+\\infty$.
67
+
68
+ Repère ensuite les abscisses des points de la courbe de $f'$ tels que $f'(x) = 0$.
69
+
70
+ Sur les intervalles où $f'$ est positive, la fonction $f$ est croissante. Sur les intervalles où $f'$ est négative, la fonction $f$ est décroissante.`;
71
+ };
72
+ const getCorrection = (identifiers) => {
73
+ const { coeffs } = identifiers;
74
+ const [_d, _c, _b, a] = coeffs;
75
+ const [x1, x2] = getRoots(identifiers);
76
+ const words = a > 0
77
+ ? ["croissante", "décroissante", "croissante"]
78
+ : ["décroissante", "croissante", "décroissante"];
79
+ const signWords = words.map((e) => e === "croissante" ? "positive" : "négative");
80
+ return `D'après le graphique, la fonction dérivée $f'$ est ${signWords[0]} sur $]-\\infty; ${x1}]$, puis ${signWords[1]} sur $[${x1}; ${x2}]$, puis ${signWords[2]} sur $[${x2}; +\\infty[$.
81
+
82
+ On en déduit que la fonction $f$ est ${words[0]} sur $]-\\infty; ${x1}]$, puis ${words[1]} sur $[${x1}; ${x2}]$, puis ${words[2]} sur $[${x2}; +\\infty[$.
83
+ `;
84
+ };
85
+ const getKeys = () => {
86
+ return ["infty"];
87
+ };
88
+ const isAnswerTableValid = (ans, { answerTable }) => {
89
+ try {
90
+ return ans.every((row, i) => row.every((cell, j) => {
91
+ return cell === answerTable[i][j];
92
+ }));
93
+ }
94
+ catch (err) {
95
+ return handleVEAError(err);
96
+ }
97
+ };
98
+ // const lists = [
99
+ // "x^3 - 3x",
100
+ // "x^3 -6x^2 + 9x",
101
+ // "-x^3 + 3x^2 + 9x",
102
+ // "2x^3 - 9x^2 + 12x",
103
+ // "-x^3+6x^2-9x",
104
+ // "4x^3 -24x^2 + 36x",
105
+ // ];
106
+ const poly3Coeffs = [
107
+ [0, -3, 0, 1],
108
+ [0, 9, -6, 1],
109
+ // [0, 9, 3, -1],
110
+ [0, 12, -9, 2],
111
+ [0, -9, 6, -1],
112
+ // [0, 36, -24, 4],
113
+ ];
114
+ const getVarSignTableFromGraphQuestion = () => {
115
+ const index = randint(0, 4);
116
+ const coeffs = coinFlip()
117
+ ? poly3Coeffs[index]
118
+ : poly3Coeffs[index].map((x) => -x);
119
+ const initTable = [
120
+ ["$x$", "-\\infty", "\\ ", "", "\\ ", "", "\\ ", "+\\infty"],
121
+ ["$f'(x)$", "\\ ", "", "", "", "", "", "\\ "],
122
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
123
+ ["$f(x)$", "\\ ", "", "", "", "", "", "\\ "],
124
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
125
+ ];
126
+ const identifiers = {
127
+ type: 0,
128
+ coeffs: [coeffs[0] + randint(-10, 10), ...coeffs.slice(1)],
129
+ initTable,
130
+ };
131
+ return getQuestionFromIdentifiers(identifiers);
132
+ };
133
+ const getQuestionFromIdentifiers = (identifiers) => {
134
+ return {
135
+ answerTable: getAnswerTable(identifiers),
136
+ instruction: getInstruction(identifiers),
137
+ keys: getKeys(identifiers),
138
+ answerFormat: "tex",
139
+ identifiers,
140
+ hint: getHint(identifiers),
141
+ correction: getCorrection(identifiers),
142
+ initTable: identifiers.initTable,
143
+ ggbOptions: getGGBOptions(identifiers),
144
+ };
145
+ };
146
+ export const signVarTableFromDerivativeGraph = {
147
+ id: "signVarTableFromDerivativeGraph",
148
+ label: "Dresser le tableau de signes de $f'$ et de variations de $f$ à partir d'une représentation graphique",
149
+ isSingleStep: true,
150
+ generator: (nb, opts) => getDistinctQuestions(() => getVarSignTableFromGraphQuestion(opts), nb),
151
+ qcmTimer: 60,
152
+ freeTimer: 60,
153
+ isAnswerTableValid,
154
+ subject: "Mathématiques",
155
+ getInstruction,
156
+ getHint,
157
+ getCorrection,
158
+ getAnswerTable,
159
+ getQuestionFromIdentifiers,
160
+ hasHintAndCorrection: true,
161
+ answerType: "signVarTable",
162
+ hasGeogebra: true,
163
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ type: number;
4
+ coeffs: number[];
5
+ initTable: string[][];
6
+ };
7
+ export declare const signVarTableFromGraph: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=signVarTableFromGraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signVarTableFromGraph.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/derivation/variations/signVarTableFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAUT,MAAM,6BAA6B,CAAC;AAUrC,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC;CACvB,CAAC;AAsLF,eAAO,MAAM,qBAAqB,EAAE,QAAQ,CAAC,WAAW,CAmBvD,CAAC"}
@@ -0,0 +1,189 @@
1
+ import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
2
+ import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
3
+ import { Polynomial } from "../../../../math/polynomials/polynomial.js";
4
+ import { randint } from "../../../../math/utils/random/randint.js";
5
+ import { coinFlip } from "../../../../utils/alea/coinFlip.js";
6
+ import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
7
+ const getRoots = (identifiers) => {
8
+ const { coeffs } = identifiers;
9
+ const [_d, c, b, a] = coeffs;
10
+ const sqrtDelta = 2 * Math.sqrt(b ** 2 - 3 * a * c);
11
+ const x1 = (-2 * b - sqrtDelta) / (6 * a);
12
+ const x2 = (-2 * b + sqrtDelta) / (6 * a);
13
+ return [x1, x2].sort((a, b) => a - b);
14
+ };
15
+ const getGGBOptions = (identifiers) => {
16
+ const { coeffs } = identifiers;
17
+ const poly = new Polynomial(coeffs);
18
+ const commands = [`f(x) =${poly.toMathString()}`];
19
+ const ggb = new GeogebraConstructor({
20
+ commands,
21
+ lockedAxesRatio: false,
22
+ });
23
+ const [x1, x2] = getRoots(identifiers);
24
+ const fx1 = poly.calculate(x1);
25
+ const fx2 = poly.calculate(x2);
26
+ return ggb.getOptions({
27
+ coords: ggb.getAdaptedCoords({
28
+ xMin: x1 - 2,
29
+ xMax: x2 + 2,
30
+ yMin: Math.min(fx1, fx2) - 2,
31
+ yMax: Math.max(fx1, fx2) + 2,
32
+ }),
33
+ });
34
+ };
35
+ const getAnswerTable = (identifiers) => {
36
+ const { coeffs } = identifiers;
37
+ const [_d, _c, _b, a] = coeffs;
38
+ const poly = new Polynomial(coeffs);
39
+ const [x1, x2] = getRoots(identifiers);
40
+ const fx1 = poly.calculate(x1);
41
+ const fx2 = poly.calculate(x2);
42
+ const vars = coeffs[3] > 0
43
+ ? ["\\nearrow", "\\searrow", "\\nearrow"]
44
+ : ["\\searrow", "\\nearrow", "\\searrow"];
45
+ const signs = coeffs[3] < 0 ? ["-", "+", "-"] : ["+", "-", "+"];
46
+ return [
47
+ [
48
+ "$x$",
49
+ "-\\infty",
50
+ "\\ ",
51
+ x1.toTree().toTex(),
52
+ "\\ ",
53
+ x2.toTree().toTex(),
54
+ "\\ ",
55
+ "+\\infty",
56
+ ],
57
+ ["$f'(x)$", "\\ ", signs[0], "0", signs[1], "0", signs[2], "\\ "],
58
+ [
59
+ "$\\ $",
60
+ "\\ ",
61
+ "\\ ",
62
+ a > 0 ? fx1.toTree().toTex() : "\\ ",
63
+ "\\ ",
64
+ a > 0 ? "\\ " : fx2.toTree().toTex(),
65
+ "\\ ",
66
+ "\\ ",
67
+ ],
68
+ ["$f(x)$", "\\ ", vars[0], "\\ ", vars[1], "\\ ", vars[2], "\\ "],
69
+ [
70
+ "$\\ $",
71
+ "\\ ",
72
+ "\\ ",
73
+ a > 0 ? "\\ " : fx1.toTree().toTex(),
74
+ "\\ ",
75
+ a > 0 ? fx2.toTree().toTex() : "\\ ",
76
+ "\\ ",
77
+ "\\ ",
78
+ ],
79
+ ];
80
+ };
81
+ const getInstruction = () => {
82
+ return `On considère une fonction $f$, définie et dérivable sur $\\mathbb{R}$, dont la représentation graphique est donnée ci-dessous.
83
+
84
+ Dresser le tableau de signes de $f'$ et de variations de $f$.`;
85
+ };
86
+ const getHint = () => {
87
+ return `La fonction est définie sur $\\mathbb{R}$, donc les valeurs de $x$ vont de $-\\infty$ à $+\\infty$.
88
+
89
+ Repère ensuite les points de la courbe auxquels le sens de variation change.
90
+
91
+ Sur les intervalles où $f$ est croissante, sa dérivée $f'$ est négative. Sur les intervalles où $f$ est décroissante, sa dérivée $f'$ est positive.`;
92
+ };
93
+ const getCorrection = (identifiers) => {
94
+ const { coeffs } = identifiers;
95
+ const [_d, _c, _b, a] = coeffs;
96
+ const poly = new Polynomial(coeffs);
97
+ const [x1, x2] = getRoots(identifiers);
98
+ const fx1 = poly.calculate(x1);
99
+ const fx2 = poly.calculate(x2);
100
+ const words = a > 0
101
+ ? ["croissante", "décroissante", "croissante"]
102
+ : ["décroissante", "croissante", "décroissante"];
103
+ const signWords = words.map((e) => e === "croissante" ? "positive" : "négative");
104
+ return `D'après le graphique, la fonction $f$ est ${words[0]} sur $]-\\infty; ${x1}]$, puis ${words[1]} sur $[${x1}; ${x2}]$, puis ${words[2]} sur $[${x2}; +\\infty[$.
105
+
106
+ On en déduit que la fonction dérivée $f'$ est ${signWords[0]} sur $]-\\infty; ${x1}]$, puis ${signWords[1]} sur $[${x1}; ${x2}]$, puis ${signWords[2]} sur $[${x2}; +\\infty[$.
107
+
108
+ De plus, on lit graphiquement que l'image de $${x1}$ est $${fx1}$, et celle de $${x2}$ est $${fx2}$.
109
+ `;
110
+ };
111
+ const getKeys = () => {
112
+ return ["infty"];
113
+ };
114
+ const isAnswerTableValid = (ans, { answerTable }) => {
115
+ try {
116
+ return ans.every((row, i) => row.every((cell, j) => {
117
+ return cell === answerTable[i][j];
118
+ }));
119
+ }
120
+ catch (err) {
121
+ return handleVEAError(err);
122
+ }
123
+ };
124
+ // const lists = [
125
+ // "x^3 - 3x",
126
+ // "x^3 -6x^2 + 9x",
127
+ // "-x^3 + 3x^2 + 9x",
128
+ // "2x^3 - 9x^2 + 12x",
129
+ // "-x^3+6x^2-9x",
130
+ // "4x^3 -24x^2 + 36x",
131
+ // ];
132
+ const poly3Coeffs = [
133
+ [0, -3, 0, 1],
134
+ [0, 9, -6, 1],
135
+ // [0, 9, 3, -1],
136
+ [0, 12, -9, 2],
137
+ [0, -9, 6, -1],
138
+ // [0, 36, -24, 4],
139
+ ];
140
+ const getVarSignTableFromGraphQuestion = () => {
141
+ const index = randint(0, 4);
142
+ const coeffs = coinFlip()
143
+ ? poly3Coeffs[index]
144
+ : poly3Coeffs[index].map((x) => -x);
145
+ const initTable = [
146
+ ["$x$", "-\\infty", "\\ ", "", "\\ ", "", "\\ ", "+\\infty"],
147
+ ["$f'(x)$", "\\ ", "", "", "", "", "", "\\ "],
148
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
149
+ ["$f(x)$", "\\ ", "", "", "", "", "", "\\ "],
150
+ ["$\\ $", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ ", "\\ "],
151
+ ];
152
+ const identifiers = {
153
+ type: 0,
154
+ coeffs: [coeffs[0] + randint(-10, 10), ...coeffs.slice(1)],
155
+ initTable,
156
+ };
157
+ return getQuestionFromIdentifiers(identifiers);
158
+ };
159
+ const getQuestionFromIdentifiers = (identifiers) => {
160
+ return {
161
+ answerTable: getAnswerTable(identifiers),
162
+ instruction: getInstruction(identifiers),
163
+ keys: getKeys(identifiers),
164
+ answerFormat: "tex",
165
+ identifiers,
166
+ hint: getHint(identifiers),
167
+ correction: getCorrection(identifiers),
168
+ initTable: identifiers.initTable,
169
+ ggbOptions: getGGBOptions(identifiers),
170
+ };
171
+ };
172
+ export const signVarTableFromGraph = {
173
+ id: "signVarTableFromGraph",
174
+ label: "Dresser le tableau de signes de $f'$ et de variations de $f$ à partir d'une représentation graphique",
175
+ isSingleStep: true,
176
+ generator: (nb, opts) => getDistinctQuestions(() => getVarSignTableFromGraphQuestion(opts), nb),
177
+ qcmTimer: 60,
178
+ freeTimer: 60,
179
+ isAnswerTableValid,
180
+ subject: "Mathématiques",
181
+ getInstruction,
182
+ getHint,
183
+ getCorrection,
184
+ getAnswerTable,
185
+ getQuestionFromIdentifiers,
186
+ hasHintAndCorrection: true,
187
+ answerType: "signVarTable",
188
+ hasGeogebra: true,
189
+ };
@@ -0,0 +1,9 @@
1
+ import { Exercise } from "../../../../exercises/exercise.js";
2
+ type Identifiers = {
3
+ a: number;
4
+ b: number;
5
+ c: number;
6
+ };
7
+ export declare const signVarTableTrinom: Exercise<Identifiers>;
8
+ export {};
9
+ //# sourceMappingURL=signVarTableTrinom.d.ts.map