math-exercises 3.0.189 → 3.0.191
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/calcul/decimals/decimalFractionToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/calcul/decimals/decimalFractionToDecimal.js +5 -4
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/factorizeEquation.js +9 -8
- package/lib/exercises/math/calculLitteral/equation/isEqualityTrue.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/isEqualityTrue.js +7 -6
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/barChartInterpreting.js +5 -4
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts +6 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/index.js +5 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts +12 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotBuildScatterPlotFromDataTable.js +206 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts +9 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotCommenting.js +210 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts +10 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableFromScatterPlotData.js +252 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts +12 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotFillDataTableWithDataClassesFromScatterPlotData.js +352 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts +11 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.d.ts.map +1 -0
- package/lib/exercises/math/dataRepresentations/scatterPlot/scatterPlotInterpreting.js +403 -0
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving1.js +3 -2
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/derivativeEquationSolving3.js +3 -2
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/valueDerivativeFromFunctionExpression.js +3 -2
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.d.ts.map +1 -1
- package/lib/exercises/math/derivation/problems/problemMaximizeProfitFindProduction.js +3 -2
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.d.ts.map +1 -1
- package/lib/exercises/math/derivation/problems/problemMovementOnLineFindSpeedAtPoint.js +3 -2
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/tangent/tangentEquationFromFunctionExpression.js +4 -3
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/findAbscissaOfExtremaFromFunctionExpression.js +4 -3
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/findExtremaFromFunctionExpression.js +4 -3
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/plausibleDerivativeGraphFromFunctionGraphByManipulatingPolynomial.js +3 -2
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/plausibleFunctionGraphFromDerivativeGraphByManipulatingPolynomial.js +3 -2
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.d.ts.map +1 -1
- package/lib/exercises/math/derivation/variations/signVarTableFromFunctionExpression.js +8 -4
- package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts +13 -0
- package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineCompareTwoImagesFromVariations.js +205 -0
- package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts +9 -0
- package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVarTableOnBoundedInterval.js +157 -0
- package/lib/exercises/math/functions/affines/affineVariations.d.ts +12 -0
- package/lib/exercises/math/functions/affines/affineVariations.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVariations.js +176 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts +8 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromGraph.js +203 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts +12 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.d.ts.map +1 -0
- package/lib/exercises/math/functions/affines/affineVariationsFromTwoImages.js +259 -0
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.d.ts.map +1 -1
- package/lib/exercises/math/functions/affines/coordsOfPointOnAffineFindX.js +8 -6
- package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.d.ts +2 -0
- package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.js +155 -0
- package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts +9 -0
- package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/exponentialFunctionImage.js +99 -0
- package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.d.ts +8 -0
- package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/exponentialsRawVariations.js +99 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts +8 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponentials/index.js +9 -0
- package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.d.ts +12 -0
- package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.js +138 -0
- package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.d.ts +8 -0
- package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/readExponentialFunctionParamsOnGraph.js +142 -0
- package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts +10 -0
- package/lib/exercises/math/functions/exponentials/realPowersFraction.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersFraction.js +125 -0
- package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts +12 -0
- package/lib/exercises/math/functions/exponentials/realPowersMixOperations.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersMixOperations.js +148 -0
- package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts +10 -0
- package/lib/exercises/math/functions/exponentials/realPowersPower.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersPower.js +128 -0
- package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts +10 -0
- package/lib/exercises/math/functions/exponentials/realPowersProduct.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/realPowersProduct.js +128 -0
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAbscissOnSemiLineV2.js +7 -6
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/alKashi/scalarProductAlKashiBH.js +3 -2
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/scalarProduct/scalarProductComputeBH.js +7 -6
- package/lib/exercises/math/percent/percentToDecimal.d.ts.map +1 -1
- package/lib/exercises/math/percent/percentToDecimal.js +5 -4
- package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/basicStats/calculateFrequencyInList.js +5 -4
- package/lib/exercises/math/probaStat/probaFromTableWithContext.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +7 -8
- package/lib/exercises/math/probaStat/stats1var/medianWithList.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/medianWithList.js +5 -4
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/situations/arithmeticFindRankFromSituation.js +9 -9
- package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts +12 -0
- package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindNextTermFromTwoConsecutiveTerms.js +217 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts +10 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFindRecurrenceFormula.js +186 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts +14 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/geometricPlaceFirstPoints.js +189 -0
- package/lib/exercises/math/sequences/geometric/graph/index.d.ts +2 -0
- package/lib/exercises/math/sequences/geometric/graph/index.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/index.js +1 -0
- package/lib/exercises/utils/options/arrayedOptions.d.ts +2 -0
- package/lib/exercises/utils/options/arrayedOptions.d.ts.map +1 -0
- package/lib/exercises/utils/options/arrayedOptions.js +16 -0
- package/lib/index.d.ts +33 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.d.ts.map +1 -1
- package/lib/math/utils/sequences/situations/seqArithmeticSituations.js +20 -20
- package/lib/tree/nodes/algebraicNode.d.ts +3 -0
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +5 -3
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +5 -3
- package/lib/tree/nodes/operators/powerNode.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { blues, greenMain, oranges, purples, reds, } from "../../../../geogebra/colors.js";
|
|
4
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
5
|
+
import { Point } from "../../../../math/geometry/point.js";
|
|
6
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
7
|
+
import { NodeComparator } from "../../../../tree/utilities/nodeComparator.js";
|
|
8
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
9
|
+
const getInstruction = () => {
|
|
10
|
+
return `Ci-dessous est tracée la courbe représentative $C_f$ d'une fonction affine $f$.
|
|
11
|
+
Déterminer graphiquement le sens de variation de $f$.`;
|
|
12
|
+
};
|
|
13
|
+
const getAnswer = (identifiers) => {
|
|
14
|
+
const { b, secondPoint } = identifiers;
|
|
15
|
+
const point1 = new Point("P1", 0, b);
|
|
16
|
+
const point2 = new Point("P2", secondPoint[0], secondPoint[1]);
|
|
17
|
+
if (NodeComparator.isEqualViaSub(point1.y, point2.y)) {
|
|
18
|
+
return "Constante";
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const [pointXSmall, pointXBig] = [point1, point2].toSorted((point1, point2) => point1.x.evaluate() - point2.x.evaluate());
|
|
22
|
+
return NodeComparator.compareViaSub(pointXSmall.y, pointXBig.y) === -1
|
|
23
|
+
? "Strictement croissante"
|
|
24
|
+
: "Strictement décroissante";
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const getHint = () => {
|
|
28
|
+
return `On prend deux points distincts sur $C_f$.
|
|
29
|
+
|
|
30
|
+
On note $x_{1}$ l'abscisse du point avec l'abscisse la plus petite.
|
|
31
|
+
On note $x_{2}$ l'abscisse du point avec l'abscisse la plus grande.
|
|
32
|
+
|
|
33
|
+
Les coordonnées des deux points sont donc $(x_{1};f(x_{1}))$ et $(x_{2};f(x_{2}))$.
|
|
34
|
+
|
|
35
|
+
La fonction $f$ est
|
|
36
|
+
|
|
37
|
+
- strictement croissante si :
|
|
38
|
+
|
|
39
|
+
$$
|
|
40
|
+
f(x_{1})<f(x_{2})
|
|
41
|
+
$$
|
|
42
|
+
|
|
43
|
+
- strictement décroissante si :
|
|
44
|
+
|
|
45
|
+
$$
|
|
46
|
+
f(x_{1})>f(x_{2})
|
|
47
|
+
$$
|
|
48
|
+
|
|
49
|
+
- constante si :
|
|
50
|
+
|
|
51
|
+
$$
|
|
52
|
+
f(x_{1})=f(x_{2})
|
|
53
|
+
$$
|
|
54
|
+
|
|
55
|
+
`;
|
|
56
|
+
};
|
|
57
|
+
const getCorrection = (identifiers) => {
|
|
58
|
+
const { b, secondPoint } = identifiers;
|
|
59
|
+
const point1 = new Point("P1", 0, b);
|
|
60
|
+
const point2 = new Point("P2", secondPoint[0], secondPoint[1]);
|
|
61
|
+
if (NodeComparator.isEqualViaSub(point1.y, point2.y)) {
|
|
62
|
+
return `On a :
|
|
63
|
+
|
|
64
|
+
$$
|
|
65
|
+
f(${point1.x.toTex()}) = f(${point2.x.toTex()}) = ${point1.y.toTex()}
|
|
66
|
+
$$
|
|
67
|
+
|
|
68
|
+
La fonction $f$ est donc constante sur $\\mathbb{R}$.`;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const [pointXSmall, pointXBig] = [point1, point2].toSorted((point1, point2) => point1.x.evaluate() - point2.x.evaluate());
|
|
72
|
+
const valueComp = NodeComparator.compareViaSub(pointXSmall.y, pointXBig.y);
|
|
73
|
+
if (valueComp === -1) {
|
|
74
|
+
return `On a :
|
|
75
|
+
|
|
76
|
+
$$
|
|
77
|
+
${pointXSmall.x.toTex()} < ${pointXBig.x.toTex()}
|
|
78
|
+
$$
|
|
79
|
+
|
|
80
|
+
et
|
|
81
|
+
|
|
82
|
+
$$
|
|
83
|
+
f(${pointXSmall.x.toTex()}) < f(${pointXBig.x.toTex()})
|
|
84
|
+
$$
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
La fonction $f$ est donc ${getAnswer(identifiers).toLocaleLowerCase()} sur $\\mathbb{R}$.`;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
return `On a :
|
|
91
|
+
|
|
92
|
+
$$
|
|
93
|
+
${pointXSmall.x.toTex()} < ${pointXBig.x.toTex()}
|
|
94
|
+
$$
|
|
95
|
+
|
|
96
|
+
et
|
|
97
|
+
|
|
98
|
+
$$
|
|
99
|
+
f(${pointXSmall.x.toTex()}) > f(${pointXBig.x.toTex()})
|
|
100
|
+
$$
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
La fonction $f$ est donc ${getAnswer(identifiers).toLocaleLowerCase()} sur $\\mathbb{R}$.`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const getCorrectionGGBOptions = (identifiers) => {
|
|
108
|
+
const { b, secondPoint } = identifiers;
|
|
109
|
+
const xMin = Math.min(0, secondPoint[0]);
|
|
110
|
+
const xMax = Math.max(0, secondPoint[0]);
|
|
111
|
+
const yMin = Math.min(b, secondPoint[1]);
|
|
112
|
+
const yMax = Math.max(b, secondPoint[1]);
|
|
113
|
+
const point1 = new Point("P1", 0, b);
|
|
114
|
+
const point2 = new Point("P2", secondPoint[0], secondPoint[1]);
|
|
115
|
+
const [pointXSmall, pointXBig] = [point1, point2].toSorted((point1, point2) => point1.x.evaluate() - point2.x.evaluate());
|
|
116
|
+
const colorButGreen = (() => {
|
|
117
|
+
const colors = [...reds, ...oranges, ...blues, ...purples];
|
|
118
|
+
return random(colors);
|
|
119
|
+
})();
|
|
120
|
+
const commands = [
|
|
121
|
+
`l = Line[(0, ${b}), (${secondPoint[0]}, ${secondPoint[1]})]`,
|
|
122
|
+
`SetColor(l, "${colorButGreen}")`,
|
|
123
|
+
"SetFixed(l, true, false)",
|
|
124
|
+
`v = Vector(${pointXSmall.toMathString()}, ${pointXBig.toMathString()})`,
|
|
125
|
+
`SetLineThickness(v, 10)`,
|
|
126
|
+
`SetColor(v, "${greenMain}")`,
|
|
127
|
+
];
|
|
128
|
+
const ggb = new GeogebraConstructor({
|
|
129
|
+
commands,
|
|
130
|
+
});
|
|
131
|
+
return ggb.getOptions({
|
|
132
|
+
coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
const getGGBOptions = (identifiers) => {
|
|
136
|
+
const { b, secondPoint } = identifiers;
|
|
137
|
+
const xMin = Math.min(0, secondPoint[0]);
|
|
138
|
+
const xMax = Math.max(0, secondPoint[0]);
|
|
139
|
+
const yMin = Math.min(b, secondPoint[1]);
|
|
140
|
+
const yMax = Math.max(b, secondPoint[1]);
|
|
141
|
+
const colorButGreen = (() => {
|
|
142
|
+
const colors = [...reds, ...oranges, ...blues, ...purples];
|
|
143
|
+
return random(colors);
|
|
144
|
+
})();
|
|
145
|
+
const commands = [
|
|
146
|
+
`l = Line[(0, ${b}), (${secondPoint[0]}, ${secondPoint[1]})]`,
|
|
147
|
+
`SetColor(l, "${colorButGreen}")`,
|
|
148
|
+
"SetFixed(l, true, false)",
|
|
149
|
+
];
|
|
150
|
+
const ggb = new GeogebraConstructor({
|
|
151
|
+
commands,
|
|
152
|
+
});
|
|
153
|
+
return ggb.getOptions({
|
|
154
|
+
coords: ggb.getAdaptedCoords({ xMin, xMax, yMin, yMax }),
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
const getPropositions = (n, { answer }) => {
|
|
158
|
+
const propositions = [];
|
|
159
|
+
addValidProp(propositions, answer, "raw");
|
|
160
|
+
tryToAddWrongProp(propositions, "Strictement croissante", "raw");
|
|
161
|
+
tryToAddWrongProp(propositions, "Strictement décroissante", "raw");
|
|
162
|
+
tryToAddWrongProp(propositions, "Constante", "raw");
|
|
163
|
+
tryToAddWrongProp(propositions, "Non monotone", "raw");
|
|
164
|
+
return shuffleProps(propositions, n);
|
|
165
|
+
};
|
|
166
|
+
const getAffineVariationsFromGraphQuestion = () => {
|
|
167
|
+
const b = randint(-5, 6);
|
|
168
|
+
const secondPoint = [randint(-5, 6, [0]), randint(-5, 6)];
|
|
169
|
+
const identifiers = { b, secondPoint };
|
|
170
|
+
//[0,b] et [x,y]
|
|
171
|
+
//a = (y-b)/x
|
|
172
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
173
|
+
};
|
|
174
|
+
const getQuestionFromIdentifiers = (identifiers, opts) => {
|
|
175
|
+
const question = {
|
|
176
|
+
instruction: getInstruction(identifiers, opts),
|
|
177
|
+
answer: getAnswer(identifiers, opts),
|
|
178
|
+
keys: [],
|
|
179
|
+
ggbOptions: getGGBOptions(identifiers, opts),
|
|
180
|
+
answerFormat: "tex",
|
|
181
|
+
identifiers,
|
|
182
|
+
hint: getHint(identifiers, opts),
|
|
183
|
+
correction: getCorrection(identifiers, opts),
|
|
184
|
+
correctionGgbOptions: getCorrectionGGBOptions(identifiers, opts),
|
|
185
|
+
options: opts,
|
|
186
|
+
};
|
|
187
|
+
return question;
|
|
188
|
+
};
|
|
189
|
+
export const affineVariationsFromGraph = {
|
|
190
|
+
id: "affineVariationsFromGraph",
|
|
191
|
+
connector: "=",
|
|
192
|
+
label: "Lire graphiquement le sens de variation d'une fonction affine",
|
|
193
|
+
isSingleStep: true,
|
|
194
|
+
generator: (nb) => getDistinctQuestions(() => getAffineVariationsFromGraphQuestion(), nb),
|
|
195
|
+
qcmTimer: 60,
|
|
196
|
+
freeTimer: 60,
|
|
197
|
+
getPropositions,
|
|
198
|
+
hasGeogebra: true,
|
|
199
|
+
subject: "Mathématiques",
|
|
200
|
+
getQuestionFromIdentifiers,
|
|
201
|
+
hasHintAndCorrection: true,
|
|
202
|
+
answerType: "QCU",
|
|
203
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { PointIdentifiers } from "../../../../math/geometry/point.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
pointIds: PointIdentifiers[];
|
|
5
|
+
};
|
|
6
|
+
type Options = {
|
|
7
|
+
typeX: string;
|
|
8
|
+
typeY: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const affineVariationsFromTwoImages: Exercise<Identifiers, Options>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=affineVariationsFromTwoImages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affineVariationsFromTwoImages.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/affineVariationsFromTwoImages.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAiBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,gBAAgB,EACjB,MAAM,8BAA8B,CAAC;AA+CtC,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;CAC9B,CAAC;AAyMF,KAAK,OAAO,GAAG;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AA+BF,eAAO,MAAM,6BAA6B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkCxE,CAAC"}
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, GeneratorOptionTarget, GeneratorOptionType, } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Point, PointConstructor, } from "../../../../math/geometry/point.js";
|
|
4
|
+
import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
5
|
+
import { randint } from "../../../../math/utils/random/randint.js";
|
|
6
|
+
import { abs } from "../../../../tree/nodes/functions/absNode.js";
|
|
7
|
+
import { sqrt } from "../../../../tree/nodes/functions/sqrtNode.js";
|
|
8
|
+
import { PiNode } from "../../../../tree/nodes/numbers/piNode.js";
|
|
9
|
+
import { frac } from "../../../../tree/nodes/operators/fractionNode.js";
|
|
10
|
+
import { NodeComparator } from "../../../../tree/utilities/nodeComparator.js";
|
|
11
|
+
import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
12
|
+
import { probaFlip } from "../../../../utils/alea/probaFlip.js";
|
|
13
|
+
import { random } from "../../../../utils/alea/random.js";
|
|
14
|
+
import { alignTex } from "../../../../utils/latex/alignTex.js";
|
|
15
|
+
const createRandomNode = (numberType) => {
|
|
16
|
+
switch (numberType) {
|
|
17
|
+
case "Décimal":
|
|
18
|
+
return coinFlip()
|
|
19
|
+
? randfloat(-100, 0, randint(1, 7), [0]).toTree()
|
|
20
|
+
: randfloat(1, 100, randint(1, 7), [1]).toTree();
|
|
21
|
+
case "Fraction": {
|
|
22
|
+
if (probaFlip(0.7)) {
|
|
23
|
+
const num = coinFlip()
|
|
24
|
+
? randint(10_000, 20_000)
|
|
25
|
+
: randint(-20_000, -10_000);
|
|
26
|
+
const den = randint(1, abs(num).evaluate());
|
|
27
|
+
return frac(num, den);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
const num = coinFlip()
|
|
31
|
+
? randfloat(1, 200, randint(1, 3), [1])
|
|
32
|
+
: randfloat(-200, -1, randint(1, 3));
|
|
33
|
+
const den = randfloat(1, abs(num).evaluate(), randint(1, 3));
|
|
34
|
+
return frac(num, den);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
case "Réel":
|
|
38
|
+
return random([
|
|
39
|
+
PiNode,
|
|
40
|
+
frac(PiNode, randint(2, 4)),
|
|
41
|
+
sqrt(randfloat(1, 100, randint(1, 5), [1])),
|
|
42
|
+
]);
|
|
43
|
+
case "Entier":
|
|
44
|
+
default:
|
|
45
|
+
return randint(-100, 100).toTree();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const getInstruction = (identifiers) => {
|
|
49
|
+
const { pointIds } = identifiers;
|
|
50
|
+
const [point1, point2] = pointIds.map((pointIds) => PointConstructor.fromIdentifiers(pointIds));
|
|
51
|
+
return `Soit $f$ une fonction affine telle que :
|
|
52
|
+
|
|
53
|
+
${alignTex([point1, point2].map((point) => [
|
|
54
|
+
`f(${point.x.toTex()})`,
|
|
55
|
+
"=",
|
|
56
|
+
point.y.toTex(),
|
|
57
|
+
]))}
|
|
58
|
+
|
|
59
|
+
Quel est le sens de variations de $f$ sur $\\mathbb{R}$ ?`;
|
|
60
|
+
};
|
|
61
|
+
const getAnswer = (identifiers) => {
|
|
62
|
+
const { pointIds } = identifiers;
|
|
63
|
+
const [point1, point2] = pointIds.map((pointIds) => PointConstructor.fromIdentifiers(pointIds));
|
|
64
|
+
if (NodeComparator.isEqualViaSub(point1.y, point2.y)) {
|
|
65
|
+
return "Constante";
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const [pointXSmall, pointXBig] = [point1, point2].toSorted((point1, point2) => point1.x.evaluate() - point2.x.evaluate());
|
|
69
|
+
return NodeComparator.compareViaSub(pointXSmall.y, pointXBig.y) === -1
|
|
70
|
+
? "Strictement croissante"
|
|
71
|
+
: "Strictement décroissante";
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const getHint = () => {
|
|
75
|
+
return `Soit $f$ une fonction affine et $x_{1}$ et $x_{2}$ deux réels distincts tels que :
|
|
76
|
+
|
|
77
|
+
$$
|
|
78
|
+
x_{1}<x_{2}
|
|
79
|
+
$$
|
|
80
|
+
|
|
81
|
+
La fonction $f$ est
|
|
82
|
+
|
|
83
|
+
- strictement croissante si :
|
|
84
|
+
|
|
85
|
+
$$
|
|
86
|
+
f(x_{1})<f(x_{2})
|
|
87
|
+
$$
|
|
88
|
+
|
|
89
|
+
- strictement décroissante si :
|
|
90
|
+
|
|
91
|
+
$$
|
|
92
|
+
f(x_{1})>f(x_{2})
|
|
93
|
+
$$
|
|
94
|
+
|
|
95
|
+
- constante si :
|
|
96
|
+
|
|
97
|
+
$$
|
|
98
|
+
f(x_{1})=f(x_{2})
|
|
99
|
+
$$
|
|
100
|
+
|
|
101
|
+
`;
|
|
102
|
+
};
|
|
103
|
+
const getCorrection = (identifiers) => {
|
|
104
|
+
const { pointIds } = identifiers;
|
|
105
|
+
const [point1, point2] = pointIds.map((pointIds) => PointConstructor.fromIdentifiers(pointIds));
|
|
106
|
+
if (NodeComparator.isEqualViaSub(point1.y, point2.y)) {
|
|
107
|
+
return `On a :
|
|
108
|
+
|
|
109
|
+
$$
|
|
110
|
+
f(${point1.x.toTex()}) = f(${point2.x.toTex()}) = ${point1.y.toTex()}
|
|
111
|
+
$$
|
|
112
|
+
|
|
113
|
+
La fonction $f$ est donc constante sur $\\mathbb{R}$.`;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
const [pointXSmall, pointXBig] = [point1, point2].toSorted((point1, point2) => point1.x.evaluate() - point2.x.evaluate());
|
|
117
|
+
const valueComp = NodeComparator.compareViaSub(pointXSmall.y, pointXBig.y);
|
|
118
|
+
if (valueComp === -1) {
|
|
119
|
+
return `On a :
|
|
120
|
+
|
|
121
|
+
$$
|
|
122
|
+
${pointXSmall.x.toTex()} < ${pointXBig.x.toTex()}
|
|
123
|
+
$$
|
|
124
|
+
|
|
125
|
+
et
|
|
126
|
+
|
|
127
|
+
$$
|
|
128
|
+
${pointXSmall.y.toTex()} < ${pointXBig.y.toTex()}
|
|
129
|
+
$$
|
|
130
|
+
|
|
131
|
+
donc
|
|
132
|
+
|
|
133
|
+
$$
|
|
134
|
+
f(${pointXSmall.x.toTex()}) < f(${pointXBig.x.toTex()})
|
|
135
|
+
$$
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
La fonction $f$ est donc ${getAnswer(identifiers).toLocaleLowerCase()} sur $\\mathbb{R}$.`;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
return `On a :
|
|
142
|
+
|
|
143
|
+
$$
|
|
144
|
+
${pointXSmall.x.toTex()} < ${pointXBig.x.toTex()}
|
|
145
|
+
$$
|
|
146
|
+
|
|
147
|
+
et
|
|
148
|
+
|
|
149
|
+
$$
|
|
150
|
+
${pointXSmall.y.toTex()} > ${pointXBig.y.toTex()}
|
|
151
|
+
$$
|
|
152
|
+
|
|
153
|
+
donc
|
|
154
|
+
|
|
155
|
+
$$
|
|
156
|
+
f(${pointXSmall.x.toTex()}) > f(${pointXBig.x.toTex()})
|
|
157
|
+
$$
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
La fonction $f$ est donc ${getAnswer(identifiers).toLocaleLowerCase()} sur $\\mathbb{R}$.`;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
const getPropositions = (n, { answer }) => {
|
|
165
|
+
const propositions = [];
|
|
166
|
+
addValidProp(propositions, answer, "raw");
|
|
167
|
+
tryToAddWrongProp(propositions, "Strictement croissante", "raw");
|
|
168
|
+
tryToAddWrongProp(propositions, "Strictement décroissante", "raw");
|
|
169
|
+
tryToAddWrongProp(propositions, "Constante", "raw");
|
|
170
|
+
tryToAddWrongProp(propositions, "Non monotone", "raw");
|
|
171
|
+
return shuffleProps(propositions, n);
|
|
172
|
+
};
|
|
173
|
+
const getKeys = () => {
|
|
174
|
+
return [];
|
|
175
|
+
};
|
|
176
|
+
const getAffineVariationsFromTwoImagesQuestion = (optsIn) => {
|
|
177
|
+
const arrayedOptions = optsIn ?? optsDefault;
|
|
178
|
+
const typeX1 = random(arrayedOptions.typeX);
|
|
179
|
+
const typeX2 = random(arrayedOptions.typeX);
|
|
180
|
+
const typeY1 = random(arrayedOptions.typeY);
|
|
181
|
+
const typeY2 = random(arrayedOptions.typeY);
|
|
182
|
+
const nodeX1 = createRandomNode(typeX1);
|
|
183
|
+
const nodeX2 = (() => {
|
|
184
|
+
let nodeCandidate;
|
|
185
|
+
do {
|
|
186
|
+
nodeCandidate = createRandomNode(typeX2);
|
|
187
|
+
} while (NodeComparator.isEqualViaSub(nodeCandidate, nodeX1));
|
|
188
|
+
return nodeCandidate;
|
|
189
|
+
})();
|
|
190
|
+
const nodeY1 = createRandomNode(typeY1);
|
|
191
|
+
const nodeY2 = probaFlip(0.9) ? createRandomNode(typeY2) : nodeY1;
|
|
192
|
+
const point1 = new Point("P1", nodeX1, nodeY1);
|
|
193
|
+
const point2 = new Point("P2", nodeX2, nodeY2);
|
|
194
|
+
const identifiers = {
|
|
195
|
+
pointIds: [point1, point2].map((point) => point.toIdentifiers()),
|
|
196
|
+
};
|
|
197
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
198
|
+
};
|
|
199
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
200
|
+
const question = {
|
|
201
|
+
answer: getAnswer(identifiers),
|
|
202
|
+
instruction: getInstruction(identifiers),
|
|
203
|
+
keys: getKeys(identifiers),
|
|
204
|
+
answerFormat: "raw",
|
|
205
|
+
identifiers,
|
|
206
|
+
hint: getHint(identifiers),
|
|
207
|
+
correction: getCorrection(identifiers),
|
|
208
|
+
};
|
|
209
|
+
return question;
|
|
210
|
+
};
|
|
211
|
+
const optsDefault = {
|
|
212
|
+
typeX: ["Entier", "Décimal"],
|
|
213
|
+
typeY: ["Entier", "Décimal"],
|
|
214
|
+
};
|
|
215
|
+
const options = [
|
|
216
|
+
{
|
|
217
|
+
id: "typeX",
|
|
218
|
+
label: "Types de nombres pour les antécédents",
|
|
219
|
+
target: GeneratorOptionTarget.generation,
|
|
220
|
+
type: GeneratorOptionType.multiselect,
|
|
221
|
+
values: ["Entier", "Décimal", "Fraction", "Réel"],
|
|
222
|
+
defaultValue: optsDefault.typeX,
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: "typeY",
|
|
226
|
+
label: "Types de nombres pour les images",
|
|
227
|
+
target: GeneratorOptionTarget.generation,
|
|
228
|
+
type: GeneratorOptionType.multiselect,
|
|
229
|
+
values: ["Entier", "Décimal", "Fraction", "Réel"],
|
|
230
|
+
defaultValue: optsDefault.typeY,
|
|
231
|
+
},
|
|
232
|
+
];
|
|
233
|
+
export const affineVariationsFromTwoImages = {
|
|
234
|
+
id: "affineVariationsFromTwoImages",
|
|
235
|
+
label: "Déterminer le sens de variations d'une fonction affine à partir des images de deux réels",
|
|
236
|
+
isSingleStep: true,
|
|
237
|
+
generator: (nb, opts) => getDistinctQuestions(() => getAffineVariationsFromTwoImagesQuestion(opts), nb),
|
|
238
|
+
options,
|
|
239
|
+
validateOptions: (opts) => {
|
|
240
|
+
return {
|
|
241
|
+
valid: !!(opts?.typeX &&
|
|
242
|
+
opts?.typeX.length > 0 &&
|
|
243
|
+
opts?.typeY &&
|
|
244
|
+
opts?.typeY.length > 0),
|
|
245
|
+
message: "Veuillez choisir au moins un type de nombre pour les antécédents et un type de nombre pour les images'.",
|
|
246
|
+
};
|
|
247
|
+
},
|
|
248
|
+
qcmTimer: 60,
|
|
249
|
+
freeTimer: 60,
|
|
250
|
+
getPropositions,
|
|
251
|
+
subject: "Mathématiques",
|
|
252
|
+
getInstruction,
|
|
253
|
+
getHint,
|
|
254
|
+
getCorrection,
|
|
255
|
+
getAnswer,
|
|
256
|
+
answerType: "QCU",
|
|
257
|
+
hasHintAndCorrection: true,
|
|
258
|
+
getQuestionFromIdentifiers,
|
|
259
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordsOfPointOnAffineFindX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/coordsOfPointOnAffineFindX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,
|
|
1
|
+
{"version":3,"file":"coordsOfPointOnAffineFindX.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/affines/coordsOfPointOnAffineFindX.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAYrC,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AA+IF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,WAAW,CAc5D,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
1
|
+
import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../../exercises/exercise.js";
|
|
2
2
|
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Point, PointConstructor } from "../../../../math/geometry/point.js";
|
|
3
4
|
import { Affine, AffineConstructor } from "../../../../math/polynomials/affine.js";
|
|
4
5
|
import { Polynomial } from "../../../../math/polynomials/polynomial.js";
|
|
5
6
|
import { randint } from "../../../../math/utils/random/randint.js";
|
|
@@ -64,11 +65,12 @@ const getPropositions = (n, { answer, coeffs, yValue }) => {
|
|
|
64
65
|
const propositions = [];
|
|
65
66
|
addValidProp(propositions, answer);
|
|
66
67
|
const poly = AffineConstructor.fromCoeffs(coeffs);
|
|
67
|
-
tryToAddWrongProp(propositions,
|
|
68
|
-
tryToAddWrongProp(propositions,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
tryToAddWrongProp(propositions, new Point("A", yValue.toTree(), poly.calculate(yValue).toTree()).toCoords());
|
|
69
|
+
tryToAddWrongProp(propositions, new Point("B", yValue.toTree(), AffineConstructor.fromCoeffs([p, -m]).calculate(yValue).toTree()).toCoords());
|
|
70
|
+
tryToAddWrongProp(propositions, new Point("C", frac(add(yValue, p), m).simplify(), yValue.toTree()).toCoords());
|
|
71
|
+
propWhile(propositions, n, () => {
|
|
72
|
+
tryToAddWrongProp(propositions, PointConstructor.random("A").toCoords());
|
|
73
|
+
});
|
|
72
74
|
return shuffleProps(propositions, n);
|
|
73
75
|
};
|
|
74
76
|
const isAnswerValid = (ans, { answer }) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimateExponentialFunctionImageFromGeometricScatterplot.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/functions/exponentials/estimateExponentialFunctionImageFromGeometricScatterplot.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// import {
|
|
2
|
+
// Exercise,
|
|
3
|
+
// Proposition,
|
|
4
|
+
// QCMGenerator,
|
|
5
|
+
// QuestionGenerator,
|
|
6
|
+
// VEA,
|
|
7
|
+
// addValidProp,
|
|
8
|
+
// shuffleProps,
|
|
9
|
+
// GetAnswer,
|
|
10
|
+
// GetHint,
|
|
11
|
+
// GetCorrection,
|
|
12
|
+
// GetInstruction,
|
|
13
|
+
// GetGGBOptions,
|
|
14
|
+
// GetQuestionFromIdentifiers,
|
|
15
|
+
// propWhile,
|
|
16
|
+
// tryToAddWrongProp,
|
|
17
|
+
// } from "../../../../exercises/exercise.js";
|
|
18
|
+
// import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
19
|
+
// import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
20
|
+
// import { randfloat } from "../../../../math/utils/random/randfloat.js";
|
|
21
|
+
// import { round } from "../../../../math/utils/round.js";
|
|
22
|
+
// import { multiply } from "../../../../tree/nodes/operators/multiplyNode.js";
|
|
23
|
+
// import { power } from "../../../../tree/nodes/operators/powerNode.js";
|
|
24
|
+
// import { parseAlgebraic } from "../../../../tree/parsers/latexParser.js";
|
|
25
|
+
// import { coinFlip } from "../../../../utils/alea/coinFlip.js";
|
|
26
|
+
// import { doWhile } from "../../../../utils/doWhile.js";
|
|
27
|
+
// import { handleVEAError } from "../../../../utils/errors/handleVEAError.js";
|
|
28
|
+
export {};
|
|
29
|
+
// type Identifiers = {
|
|
30
|
+
// x: number;
|
|
31
|
+
// u0: number;
|
|
32
|
+
// q: number;
|
|
33
|
+
// };
|
|
34
|
+
// const getPropositions: QCMGenerator<Identifiers> = (n, { answer }) => {
|
|
35
|
+
// const propositions: Proposition[] = [];
|
|
36
|
+
// addValidProp(propositions, answer);
|
|
37
|
+
// propWhile(propositions, n, () => {
|
|
38
|
+
// // tryToAddWrongProp(propositions);
|
|
39
|
+
// });
|
|
40
|
+
// return shuffleProps(propositions, n);
|
|
41
|
+
// };
|
|
42
|
+
// const getAnswer: GetAnswer<Identifiers> = (identifiers) => {
|
|
43
|
+
// const { q, u0, x } = identifiers;
|
|
44
|
+
// return round(multiply(u0, power(q, x)).evaluate(), 2).frenchify();
|
|
45
|
+
// };
|
|
46
|
+
// const getInstruction: GetInstruction<Identifiers> = (identifiers) => {
|
|
47
|
+
// const { x } = identifiers;
|
|
48
|
+
// return `On donne ci-dessous le nuage de points représentant une suite géométrique $u$ définie par :
|
|
49
|
+
// $$
|
|
50
|
+
// u_n = u_0\\times q^n
|
|
51
|
+
// $$
|
|
52
|
+
// où $u_0$ est le premier terme de la suite, et $q$ est sa raison.
|
|
53
|
+
// On définit la fonction $f$ sur $[0;+\\infty[$ par :
|
|
54
|
+
// $$
|
|
55
|
+
// f(x) = u_0\\times q^x
|
|
56
|
+
// $$
|
|
57
|
+
// Donner une valeur approchée de $f(${x.frenchify()})$.
|
|
58
|
+
// `;
|
|
59
|
+
// };
|
|
60
|
+
// const getHint: GetHint<Identifiers> = (identifiers) => {
|
|
61
|
+
// const { x } = identifiers;
|
|
62
|
+
// return `La fonction $f$ est le prolongement de la suite $u$.
|
|
63
|
+
// Pour donner une valeur approchée de $f(${x.frenchify()})$, on peut imaginer une courbe qui relie les points du nuage de points, et estimer ainsi l'image de ${x.frenchify()}.`;
|
|
64
|
+
// };
|
|
65
|
+
// const getCorrection: GetCorrection<Identifiers> = (identifiers) => {
|
|
66
|
+
// const { x } = identifiers;
|
|
67
|
+
// return `On relie mentalement les points par une courbe. On peut alors estimer la valeur de ${x.frenchify()} :
|
|
68
|
+
// $$
|
|
69
|
+
// f(${x.frenchify()}) \\approx ${getAnswer(identifiers)}
|
|
70
|
+
// $$`;
|
|
71
|
+
// };
|
|
72
|
+
// const getGGBOptions: GetGGBOptions<Identifiers> = (identifiers) => {
|
|
73
|
+
// const { u0, q, x } = identifiers;
|
|
74
|
+
// const ggb = new GeogebraConstructor({
|
|
75
|
+
// commands: [`Sequence((n, ${u0}*${q}^n), n, 0, 50)`],
|
|
76
|
+
// lockedAxesRatio: false,
|
|
77
|
+
// });
|
|
78
|
+
// const f = (x: number) => round(multiply(u0, power(q, x)).evaluate(), 2);
|
|
79
|
+
// const next = f(Math.ceil(x));
|
|
80
|
+
// return ggb.getOptions({
|
|
81
|
+
// coords: [-1, Math.max(x + 2, 5), -1, Math.max(next + 5, 5) + 1],
|
|
82
|
+
// });
|
|
83
|
+
// };
|
|
84
|
+
// const isAnswerValid: VEA<Identifiers> = (ans, { answer, q, u0, x }) => {
|
|
85
|
+
// try {
|
|
86
|
+
// const parsed = parseAlgebraic(ans);
|
|
87
|
+
// if (!parsed) return false;
|
|
88
|
+
// const f = (x: number) => round(multiply(u0, power(q, x)).evaluate(), 2);
|
|
89
|
+
// const nbAns = f(x);
|
|
90
|
+
// const prev = f(Math.floor(x));
|
|
91
|
+
// const next = f(Math.ceil(x));
|
|
92
|
+
// const delta = Math.abs(next - prev);
|
|
93
|
+
// return Math.abs(parsed.evaluate() - nbAns) < 0.2 * delta;
|
|
94
|
+
// } catch (err) {
|
|
95
|
+
// return handleVEAError(err);
|
|
96
|
+
// }
|
|
97
|
+
// };
|
|
98
|
+
// const getEstimateExponentialFunctionImageFromGeometriceScatterplotQuestion: QuestionGenerator<
|
|
99
|
+
// Identifiers
|
|
100
|
+
// > = () => {
|
|
101
|
+
// const u0 = randfloat(0.5, 4, 2);
|
|
102
|
+
// const q = coinFlip() ? randfloat(0.1, 1, 2, [1]) : randfloat(1.1, 5, 2);
|
|
103
|
+
// const x = doWhile(
|
|
104
|
+
// () => randfloat(0.5, 3, 2),
|
|
105
|
+
// (a) => Math.abs(round(a, 1) - a) < 0.025,
|
|
106
|
+
// );
|
|
107
|
+
// const identifiers: Identifiers = {
|
|
108
|
+
// q,
|
|
109
|
+
// u0,
|
|
110
|
+
// x,
|
|
111
|
+
// };
|
|
112
|
+
// return getQuestionFromIdentifiers(identifiers);
|
|
113
|
+
// };
|
|
114
|
+
// const getQuestionFromIdentifiers: GetQuestionFromIdentifiers<Identifiers> = (
|
|
115
|
+
// identifiers,
|
|
116
|
+
// ) => {
|
|
117
|
+
// return {
|
|
118
|
+
// answer: getAnswer(identifiers),
|
|
119
|
+
// instruction: getInstruction(identifiers),
|
|
120
|
+
// keys: [],
|
|
121
|
+
// answerFormat: "tex",
|
|
122
|
+
// identifiers,
|
|
123
|
+
// hint: getHint(identifiers),
|
|
124
|
+
// correction: getCorrection(identifiers),
|
|
125
|
+
// ggbOptions: getGGBOptions(identifiers),
|
|
126
|
+
// };
|
|
127
|
+
// };
|
|
128
|
+
// export const estimateExponentialFunctionImageFromGeometricScatterplot: Exercise<Identifiers> =
|
|
129
|
+
// {
|
|
130
|
+
// id: "estimateExponentialFunctionImageFromGeometricScatterplot",
|
|
131
|
+
// connector: "=",
|
|
132
|
+
// label:
|
|
133
|
+
// "Estimer une valeur approchée de $q^x$ à partir du nuage de points de $q^n$",
|
|
134
|
+
// isSingleStep: true,
|
|
135
|
+
// generator: (nb, opts) =>
|
|
136
|
+
// getDistinctQuestions(
|
|
137
|
+
// () =>
|
|
138
|
+
// getEstimateExponentialFunctionImageFromGeometriceScatterplotQuestion(
|
|
139
|
+
// opts,
|
|
140
|
+
// ),
|
|
141
|
+
// nb,
|
|
142
|
+
// ),
|
|
143
|
+
// qcmTimer: 60,
|
|
144
|
+
// freeTimer: 60,
|
|
145
|
+
// getPropositions,
|
|
146
|
+
// isAnswerValid,
|
|
147
|
+
// subject: "Mathématiques",
|
|
148
|
+
// getHint,
|
|
149
|
+
// getCorrection,
|
|
150
|
+
// getInstruction,
|
|
151
|
+
// getAnswer,
|
|
152
|
+
// getGGBOptions,
|
|
153
|
+
// hasGeogebra: true,
|
|
154
|
+
// getQuestionFromIdentifiers,
|
|
155
|
+
// };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Exercise } from "../../../../exercises/exercise.js";
|
|
2
|
+
import { NodeIdentifiers } from "../../../../tree/nodes/nodeConstructor.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
aIds: NodeIdentifiers;
|
|
5
|
+
xIds: NodeIdentifiers;
|
|
6
|
+
};
|
|
7
|
+
export declare const exponentialFunctionImage: Exercise<Identifiers>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=exponentialFunctionImage.d.ts.map
|