math-exercises 3.0.192 → 3.0.193
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/dataRepresentations/dataToGraphGraphToData.d.ts.map +1 -1
- package/lib/exercises/math/dataRepresentations/dataToGraphGraphToData.js +1 -1
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.d.ts +10 -0
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionInSituation.js +96 -0
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionWithUnitChange.d.ts +11 -0
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionWithUnitChange.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/computeImageByExponentialFunctionWithUnitChange.js +116 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts +3 -0
- package/lib/exercises/math/functions/exponentials/index.d.ts.map +1 -1
- package/lib/exercises/math/functions/exponentials/index.js +3 -0
- package/lib/exercises/math/functions/exponentials/modelizeSituationByExponentialFunction.d.ts +9 -0
- package/lib/exercises/math/functions/exponentials/modelizeSituationByExponentialFunction.d.ts.map +1 -0
- package/lib/exercises/math/functions/exponentials/modelizeSituationByExponentialFunction.js +105 -0
- package/lib/exercises/math/functions/exponentials/plausibleExponentialFunctionExpressionFromGraph.js +2 -2
- package/lib/exercises/math/probaStat/stats2var/buildDataTableFromScatterplot.d.ts +8 -0
- package/lib/exercises/math/probaStat/stats2var/buildDataTableFromScatterplot.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats2var/buildDataTableFromScatterplot.js +114 -0
- package/lib/exercises/math/probaStat/stats2var/buildScatterPlotFromDataTable.d.ts +8 -0
- package/lib/exercises/math/probaStat/stats2var/buildScatterPlotFromDataTable.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats2var/buildScatterPlotFromDataTable.js +110 -0
- package/lib/exercises/math/probaStat/stats2var/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats2var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats2var/index.js +2 -0
- package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.d.ts +8 -0
- package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.js +87 -0
- package/lib/exercises/math/sequences/geometric/graph/index.d.ts +4 -1
- package/lib/exercises/math/sequences/geometric/graph/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/graph/index.js +4 -1
- package/lib/exercises/math/sequences/geometric/graph/plausibleGeometricSequenceExpressionFromGraph.d.ts +12 -0
- package/lib/exercises/math/sequences/geometric/graph/plausibleGeometricSequenceExpressionFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/plausibleGeometricSequenceExpressionFromGraph.js +133 -0
- package/lib/exercises/math/sequences/geometric/graph/readGeometricExpressionFromGraph.d.ts +8 -0
- package/lib/exercises/math/sequences/geometric/graph/readGeometricExpressionFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/readGeometricExpressionFromGraph.js +132 -0
- package/lib/exercises/math/sequences/geometric/graph/recognizeGeometricFromGraph.d.ts +11 -0
- package/lib/exercises/math/sequences/geometric/graph/recognizeGeometricFromGraph.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/graph/recognizeGeometricFromGraph.js +137 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +1 -0
- package/lib/index.d.ts +39 -0
- package/lib/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { toolBarConstructor } from "../../../../exercises/utils/geogebra/toolBarConstructor.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { ggbPointToCoords } from "../../../../geogebra/parsers/ggbPointToCoords.js";
|
|
5
|
+
import { parseGGBPoints } from "../../../../geogebra/parsers/parseGGBPoints.js";
|
|
6
|
+
import { PointConstructor } from "../../../../math/geometry/point.js";
|
|
7
|
+
import { randTupleInt } from "../../../../math/utils/random/randTupleInt.js";
|
|
8
|
+
import { dollarize } from "../../../../utils/latex/dollarize.js";
|
|
9
|
+
import { mdTable } from "../../../../utils/markdown/mdTable.js";
|
|
10
|
+
const getInstruction = (identifiers) => {
|
|
11
|
+
return `On s'intéresse à l'évolution de la population de loups dans une zone protégée à partir de l'année $2000$ (année $0$). Le tableau suivant donne le nombre d'individus pour chaque année étudiée.
|
|
12
|
+
|
|
13
|
+
${mdTable([
|
|
14
|
+
["Année", ...identifiers.xs.map((e) => dollarize(e.frenchify()))],
|
|
15
|
+
[
|
|
16
|
+
"Nombre d'individus",
|
|
17
|
+
...identifiers.ys.map((e) => dollarize(e.frenchify())),
|
|
18
|
+
],
|
|
19
|
+
])}
|
|
20
|
+
|
|
21
|
+
Construire le nuage de points associé au tableau ci-dessus.`;
|
|
22
|
+
};
|
|
23
|
+
const getHint = () => {
|
|
24
|
+
return `Chaque colonne du tableau représente un point du nuage de points. La première ligne donne son abscisse, et la deuxième son ordonnée.`;
|
|
25
|
+
};
|
|
26
|
+
const getCorrection = (identifiers) => {
|
|
27
|
+
const { xs, ys } = identifiers;
|
|
28
|
+
const points = xs.map((x, i) => PointConstructor.fromCoords([x, ys[i]], `P_${i}`));
|
|
29
|
+
return `Le tableau nous donne les points suivants :
|
|
30
|
+
|
|
31
|
+
- $${points.map((p) => p.toCoords()).join("$ \n - $")}$
|
|
32
|
+
|
|
33
|
+
Il suffit ensuite de placer ces points dans la figure.
|
|
34
|
+
`;
|
|
35
|
+
};
|
|
36
|
+
const getGGBAnswer = (identifiers) => {
|
|
37
|
+
const { xs, ys } = identifiers;
|
|
38
|
+
const points = xs.map((x, i) => PointConstructor.fromCoords([x, ys[i]], `P_${i}`));
|
|
39
|
+
return [
|
|
40
|
+
...points.flatMap((p) => p.toGGBCommand({
|
|
41
|
+
isFixed: true,
|
|
42
|
+
isSelectionnable: false,
|
|
43
|
+
showLabel: false,
|
|
44
|
+
})),
|
|
45
|
+
];
|
|
46
|
+
};
|
|
47
|
+
const getStudentGGBOptions = () => {
|
|
48
|
+
const ggb = new GeogebraConstructor({
|
|
49
|
+
commands: [],
|
|
50
|
+
customToolBar: toolBarConstructor({ point: true }),
|
|
51
|
+
});
|
|
52
|
+
return ggb.getOptions({
|
|
53
|
+
coords: [-1, 11, -1, 11],
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
const isGGBAnswerValid = (ans, { ggbAnswer, ...identifiers }) => {
|
|
57
|
+
const { xs, ys } = identifiers;
|
|
58
|
+
const points = xs.map((x, i) => PointConstructor.fromCoords([x, ys[i]], `P_${i}`));
|
|
59
|
+
const studentPoints = parseGGBPoints(ans)
|
|
60
|
+
.map((p) => ggbPointToCoords(p))
|
|
61
|
+
.sort((a, b) => a.x - b.x);
|
|
62
|
+
return studentPoints.every((p, i) => Math.abs(p.x - points[i].x.evaluate()) < 0.4 &&
|
|
63
|
+
Math.abs(p.y - points[i].y.evaluate()) < 0.4);
|
|
64
|
+
};
|
|
65
|
+
const getBuildScatterPlotFromDataTableQuestion = () => {
|
|
66
|
+
const xs = randTupleInt(4, {
|
|
67
|
+
from: 0,
|
|
68
|
+
to: 10,
|
|
69
|
+
allDifferent: true,
|
|
70
|
+
sorted: true,
|
|
71
|
+
});
|
|
72
|
+
const ys = randTupleInt(4, {
|
|
73
|
+
from: 0,
|
|
74
|
+
to: 10,
|
|
75
|
+
allDifferent: true,
|
|
76
|
+
sorted: true,
|
|
77
|
+
});
|
|
78
|
+
const identifiers = {
|
|
79
|
+
xs,
|
|
80
|
+
ys,
|
|
81
|
+
};
|
|
82
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
83
|
+
};
|
|
84
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
85
|
+
return {
|
|
86
|
+
ggbAnswer: getGGBAnswer(identifiers),
|
|
87
|
+
instruction: getInstruction(identifiers),
|
|
88
|
+
studentGgbOptions: getStudentGGBOptions(identifiers),
|
|
89
|
+
identifiers,
|
|
90
|
+
hint: getHint(identifiers),
|
|
91
|
+
correction: getCorrection(identifiers),
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
export const buildScatterPlotFromDataTable = {
|
|
95
|
+
id: "buildScatterPlotFromDataTable",
|
|
96
|
+
label: "Construire le nuage de points associé à un tableau de données",
|
|
97
|
+
isSingleStep: true,
|
|
98
|
+
generator: (nb, opts) => getDistinctQuestions(() => getBuildScatterPlotFromDataTableQuestion(opts), nb),
|
|
99
|
+
ggbTimer: 60,
|
|
100
|
+
isGGBAnswerValid,
|
|
101
|
+
subject: "Mathématiques",
|
|
102
|
+
getHint,
|
|
103
|
+
getInstruction,
|
|
104
|
+
getCorrection,
|
|
105
|
+
getGGBAnswer,
|
|
106
|
+
getStudentGGBOptions,
|
|
107
|
+
answerType: "GGB",
|
|
108
|
+
getQuestionFromIdentifiers,
|
|
109
|
+
hasHintAndCorrection: true,
|
|
110
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats2var/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/exercises/math/probaStat/stats2var/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,oCAAoC,CAAC"}
|
package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
q: number;
|
|
4
|
+
start: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const compareGeometricReasonWithOneFromGraph: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=compareGeometricReasonWithOneFromGraph.d.ts.map
|
package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compareGeometricReasonWithOneFromGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AAMrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAiFF,eAAO,MAAM,sCAAsC,EAAE,QAAQ,CAAC,WAAW,CAuBxE,CAAC"}
|
package/lib/exercises/math/sequences/geometric/graph/compareGeometricReasonWithOneFromGraph.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { randfloat } from "../../../../../math/utils/random/randfloat.js";
|
|
5
|
+
import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
|
|
6
|
+
const getPropositions = (n, { answer }) => {
|
|
7
|
+
const propositions = [];
|
|
8
|
+
addValidProp(propositions, answer);
|
|
9
|
+
tryToAddWrongProp(propositions, "q>1");
|
|
10
|
+
tryToAddWrongProp(propositions, "q=1");
|
|
11
|
+
tryToAddWrongProp(propositions, "0<q<1");
|
|
12
|
+
tryToAddWrongProp(propositions, "q<0");
|
|
13
|
+
return shuffleProps(propositions, n);
|
|
14
|
+
};
|
|
15
|
+
const getAnswer = (identifiers) => {
|
|
16
|
+
const { q } = identifiers;
|
|
17
|
+
return q > 1 ? "q>1" : "0<q<1";
|
|
18
|
+
};
|
|
19
|
+
const getInstruction = () => {
|
|
20
|
+
return `On donne ci-dessous le nuage de points représentant une suite géométrique $u$.
|
|
21
|
+
|
|
22
|
+
Que peut-on dire sur la raison $q$ de cette suite ?`;
|
|
23
|
+
};
|
|
24
|
+
const getHint = () => {
|
|
25
|
+
return `La raison d'une suite géométrique est le nombre par lequel on multiplie un terme pour passer au suivant.
|
|
26
|
+
|
|
27
|
+
Ici, le sens de variations de la suite te donne une indication sur ce nombre : les termes de la suite augmentent-ils en fonction du rang, ou bien diminuent-ils ?`;
|
|
28
|
+
};
|
|
29
|
+
const getCorrection = (identifiers) => {
|
|
30
|
+
const { q } = identifiers;
|
|
31
|
+
return `Le nuage de points de la suite $u$ montre qu'elle est ${q > 1 ? "croissante" : "décroissante"}.
|
|
32
|
+
|
|
33
|
+
Or, une suite géométrique est :
|
|
34
|
+
- croissante si et seulement si $q>1$;
|
|
35
|
+
- décroissante si et seulement si $0<q<1$.
|
|
36
|
+
|
|
37
|
+
Ici, on peut donc affirmer que $${getAnswer(identifiers)}$.`;
|
|
38
|
+
};
|
|
39
|
+
const getGGBOptions = (identifiers) => {
|
|
40
|
+
const { q, start } = identifiers;
|
|
41
|
+
const ggb = new GeogebraConstructor({
|
|
42
|
+
commands: [`Sequence((n, ${start}*${q}^n), n, 0, 50)`],
|
|
43
|
+
lockedAxesRatio: false,
|
|
44
|
+
gridDistance: false,
|
|
45
|
+
});
|
|
46
|
+
const max = Math.max(start, q ** 4 * start);
|
|
47
|
+
return ggb.getOptions({
|
|
48
|
+
coords: [-1, 5, Math.min(-1, -max * 0.1), 1.2 * max],
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
const getCompareGeometricReasonWithOneFromGraphQuestion = () => {
|
|
52
|
+
const start = randfloat(0.5, 4, 2);
|
|
53
|
+
const q = coinFlip() ? randfloat(0.1, 1, 2, [1]) : randfloat(1.1, 5, 2);
|
|
54
|
+
const identifiers = { q, start };
|
|
55
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
56
|
+
};
|
|
57
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
58
|
+
return {
|
|
59
|
+
answer: getAnswer(identifiers),
|
|
60
|
+
instruction: getInstruction(identifiers),
|
|
61
|
+
keys: [],
|
|
62
|
+
answerFormat: "tex",
|
|
63
|
+
identifiers,
|
|
64
|
+
hint: getHint(identifiers),
|
|
65
|
+
correction: getCorrection(identifiers),
|
|
66
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export const compareGeometricReasonWithOneFromGraph = {
|
|
70
|
+
id: "compareGeometricReasonWithOneFromGraph",
|
|
71
|
+
label: "Comparer la raison d'une suite géométrique avec $1$ à partir de son nuage de points",
|
|
72
|
+
isSingleStep: true,
|
|
73
|
+
generator: (nb, opts) => getDistinctQuestions(() => getCompareGeometricReasonWithOneFromGraphQuestion(opts), nb),
|
|
74
|
+
qcmTimer: 60,
|
|
75
|
+
freeTimer: 60,
|
|
76
|
+
getPropositions,
|
|
77
|
+
subject: "Mathématiques",
|
|
78
|
+
getHint,
|
|
79
|
+
getCorrection,
|
|
80
|
+
getInstruction,
|
|
81
|
+
getAnswer,
|
|
82
|
+
getGGBOptions,
|
|
83
|
+
hasGeogebra: true,
|
|
84
|
+
getQuestionFromIdentifiers,
|
|
85
|
+
answerType: "QCU",
|
|
86
|
+
hasHintAndCorrection: true,
|
|
87
|
+
};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./recognizeGeometricFromGraph.js";
|
|
2
|
+
export * from "./plausibleGeometricSequenceExpressionFromGraph.js";
|
|
3
|
+
export * from "./readGeometricExpressionFromGraph.js";
|
|
4
|
+
export * from "./compareGeometricReasonWithOneFromGraph.js";
|
|
2
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/graph/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/graph/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,oDAAoD,CAAC;AACnE,cAAc,uCAAuC,CAAC;AACtD,cAAc,6CAA6C,CAAC"}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./recognizeGeometricFromGraph.js";
|
|
2
|
+
export * from "./plausibleGeometricSequenceExpressionFromGraph.js";
|
|
3
|
+
export * from "./readGeometricExpressionFromGraph.js";
|
|
4
|
+
export * from "./compareGeometricReasonWithOneFromGraph.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
q: number;
|
|
4
|
+
start: number;
|
|
5
|
+
fakeParams: {
|
|
6
|
+
start: number;
|
|
7
|
+
q: number;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
export declare const plausibleGeometricSequenceExpressionFromGraph: Exercise<Identifiers>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=plausibleGeometricSequenceExpressionFromGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plausibleGeometricSequenceExpressionFromGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/graph/plausibleGeometricSequenceExpressionFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAaT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC5C,CAAC;AAyIF,eAAO,MAAM,6CAA6C,EAAE,QAAQ,CAAC,WAAW,CAwB7E,CAAC"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { randfloat } from "../../../../../math/utils/random/randfloat.js";
|
|
5
|
+
import { round } from "../../../../../math/utils/round.js";
|
|
6
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
|
+
import { power } from "../../../../../tree/nodes/operators/powerNode.js";
|
|
8
|
+
import { coinFlip } from "../../../../../utils/alea/coinFlip.js";
|
|
9
|
+
const getPropositions = (n, { answer, fakeParams }) => {
|
|
10
|
+
const propositions = [];
|
|
11
|
+
addValidProp(propositions, answer);
|
|
12
|
+
for (let i = 0; i < fakeParams.length; i++) {
|
|
13
|
+
tryToAddWrongProp(propositions, multiply(fakeParams[i].start, power(fakeParams[i].q, "n")).toTex());
|
|
14
|
+
}
|
|
15
|
+
return shuffleProps(propositions, n);
|
|
16
|
+
};
|
|
17
|
+
const getAnswer = (identifiers) => {
|
|
18
|
+
const { start, q } = identifiers;
|
|
19
|
+
return multiply(start, power(q, "n")).toTex();
|
|
20
|
+
};
|
|
21
|
+
const getInstruction = () => {
|
|
22
|
+
return `On donne ci-dessous les premiers points d'un nuage de points représentant une suite géométrique $u$..
|
|
23
|
+
|
|
24
|
+
Parmi les formes explicites suivantes, laquelle peut être celle de $u$ ?`;
|
|
25
|
+
};
|
|
26
|
+
const getHint = () => {
|
|
27
|
+
return `Le sens de variation de la suite peut t'aider. Si on note $q$ sa raison, alors :
|
|
28
|
+
|
|
29
|
+
- si $q>1$, la suite est strictement croissante;
|
|
30
|
+
- si $0<q<1$, la suite est strictement décroissante.
|
|
31
|
+
|
|
32
|
+
D'autre part, tu peux lire la valeur du premier terme de la suite.`;
|
|
33
|
+
};
|
|
34
|
+
const getCorrection = (identifiers) => {
|
|
35
|
+
const { q, start } = identifiers;
|
|
36
|
+
const sens = q < 1 ? "décroissante" : "croissante";
|
|
37
|
+
return `On sait que la forme explicite de la suite $u$ est de la forme :
|
|
38
|
+
|
|
39
|
+
$$
|
|
40
|
+
u_n = u_0\\times q^n
|
|
41
|
+
$$
|
|
42
|
+
|
|
43
|
+
D'après le graphique, la suite $u$ est ${sens}. On en déduit donc que $q ${q < 1 ? "<1" : ">1"}$. Cela permet donc d'exclure deux des propositions.
|
|
44
|
+
|
|
45
|
+
Ensuite, on lit le premier terme de la suite : on trouve $u_0 \\approx ${round(start, 1).frenchify()}$.
|
|
46
|
+
|
|
47
|
+
On en conclut donc que la seule forme explicite possible pour $u$ est :
|
|
48
|
+
|
|
49
|
+
$$
|
|
50
|
+
u_n = ${getAnswer(identifiers)}
|
|
51
|
+
$$`;
|
|
52
|
+
};
|
|
53
|
+
const getGGBOptions = (identifiers) => {
|
|
54
|
+
const { q, start } = identifiers;
|
|
55
|
+
const ggb = new GeogebraConstructor({
|
|
56
|
+
commands: [`Sequence((n, ${start}*${q}^n), n, 0, 50)`],
|
|
57
|
+
lockedAxesRatio: false,
|
|
58
|
+
});
|
|
59
|
+
const f2 = multiply(start, power(q, 2)).evaluate();
|
|
60
|
+
return ggb.getOptions({
|
|
61
|
+
coords: [-1, 5, -1, Math.max(start, f2) + 1],
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const getPlausibleExponentialFunctionExpressionFromGraphQuestion = () => {
|
|
65
|
+
const start = randfloat(0.5, 4, 2);
|
|
66
|
+
const q = coinFlip() ? randfloat(0.1, 1, 2, [1]) : randfloat(1.1, 5, 2);
|
|
67
|
+
let fakeParams = [];
|
|
68
|
+
if (q > 1) {
|
|
69
|
+
const firstDescQ = randfloat(0.1, 1, 2, [1]);
|
|
70
|
+
const secondDescQ = randfloat(0.1, 1, 2, [firstDescQ]);
|
|
71
|
+
const thirdQ = randfloat(1.1, 5, 2, [q]);
|
|
72
|
+
const firstStart = start;
|
|
73
|
+
const secondStart = randfloat(0.1, 4, 2);
|
|
74
|
+
const delta = randfloat(1, 3, 2);
|
|
75
|
+
const thirdStart = round(start - delta > 0 ? start - delta : start + delta, 2);
|
|
76
|
+
fakeParams = [
|
|
77
|
+
{ q: firstDescQ, start: firstStart },
|
|
78
|
+
{ q: secondDescQ, start: secondStart },
|
|
79
|
+
{ q: thirdQ, start: thirdStart },
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const firstAscQ = randfloat(1.1, 5, 2);
|
|
84
|
+
const secondAscQ = randfloat(1.1, 5, 2, [firstAscQ]);
|
|
85
|
+
const thirdQ = randfloat(0.1, 1, 2, [1, q]);
|
|
86
|
+
const firstStart = start;
|
|
87
|
+
const secondStart = randfloat(0.1, 4, 2);
|
|
88
|
+
const delta = randfloat(1, 3, 2);
|
|
89
|
+
const thirdStart = round(start - delta > 0 ? start - delta : start + delta, 2);
|
|
90
|
+
fakeParams = [
|
|
91
|
+
{ q: firstAscQ, start: firstStart },
|
|
92
|
+
{ q: secondAscQ, start: secondStart },
|
|
93
|
+
{ q: thirdQ, start: thirdStart },
|
|
94
|
+
];
|
|
95
|
+
}
|
|
96
|
+
const identifiers = {
|
|
97
|
+
start,
|
|
98
|
+
q,
|
|
99
|
+
fakeParams,
|
|
100
|
+
};
|
|
101
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
102
|
+
};
|
|
103
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
104
|
+
return {
|
|
105
|
+
answer: getAnswer(identifiers),
|
|
106
|
+
instruction: getInstruction(identifiers),
|
|
107
|
+
keys: [],
|
|
108
|
+
answerFormat: "tex",
|
|
109
|
+
identifiers,
|
|
110
|
+
hint: getHint(identifiers),
|
|
111
|
+
correction: getCorrection(identifiers),
|
|
112
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export const plausibleGeometricSequenceExpressionFromGraph = {
|
|
116
|
+
id: "plausibleGeometricSequenceExpressionFromGraph",
|
|
117
|
+
label: "Donner la forme explicite possible d'une suite géométrique à partir de son nuage de points",
|
|
118
|
+
isSingleStep: true,
|
|
119
|
+
generator: (nb, opts) => getDistinctQuestions(() => getPlausibleExponentialFunctionExpressionFromGraphQuestion(opts), nb),
|
|
120
|
+
qcmTimer: 60,
|
|
121
|
+
freeTimer: 60,
|
|
122
|
+
getPropositions,
|
|
123
|
+
answerType: "QCU",
|
|
124
|
+
subject: "Mathématiques",
|
|
125
|
+
getHint,
|
|
126
|
+
getCorrection,
|
|
127
|
+
getInstruction,
|
|
128
|
+
getAnswer,
|
|
129
|
+
getGGBOptions,
|
|
130
|
+
hasGeogebra: true,
|
|
131
|
+
getQuestionFromIdentifiers,
|
|
132
|
+
hasHintAndCorrection: true,
|
|
133
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
start: number;
|
|
4
|
+
q: number;
|
|
5
|
+
};
|
|
6
|
+
export declare const readGeometricExpressionFromGraph: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=readGeometricExpressionFromGraph.d.ts.map
|
package/lib/exercises/math/sequences/geometric/graph/readGeometricExpressionFromGraph.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"readGeometricExpressionFromGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/graph/readGeometricExpressionFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAWrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAqHF,eAAO,MAAM,gCAAgC,EAAE,QAAQ,CAAC,WAAW,CA0BlE,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { GeogebraConstructor } from "../../../../../geogebra/geogebraConstructor.js";
|
|
4
|
+
import { randint } from "../../../../../math/utils/random/randint.js";
|
|
5
|
+
import { round } from "../../../../../math/utils/round.js";
|
|
6
|
+
import { multiply } from "../../../../../tree/nodes/operators/multiplyNode.js";
|
|
7
|
+
import { power } from "../../../../../tree/nodes/operators/powerNode.js";
|
|
8
|
+
import { parseAlgebraic } from "../../../../../tree/parsers/latexParser.js";
|
|
9
|
+
import { random } from "../../../../../utils/alea/random.js";
|
|
10
|
+
import { handleVEAError } from "../../../../../utils/errors/handleVEAError.js";
|
|
11
|
+
const getPropositions = (n, { answer }) => {
|
|
12
|
+
const propositions = [];
|
|
13
|
+
addValidProp(propositions, answer);
|
|
14
|
+
propWhile(propositions, n, () => {
|
|
15
|
+
const fakeStart = randint(2, 10);
|
|
16
|
+
const fakeQ = random([0.2, 0.5, 2, 3, 4, 5]);
|
|
17
|
+
tryToAddWrongProp(propositions, multiply(fakeStart, power(fakeQ, "n")).toTex());
|
|
18
|
+
});
|
|
19
|
+
return shuffleProps(propositions, n);
|
|
20
|
+
};
|
|
21
|
+
const getAnswer = (identifiers) => {
|
|
22
|
+
const { q, start } = identifiers;
|
|
23
|
+
return multiply(start, power(q, "n")).simplify().toTex();
|
|
24
|
+
};
|
|
25
|
+
const getInstruction = () => {
|
|
26
|
+
return `On donne ci-dessous le nuage de points d'une suite géométrique $u$.
|
|
27
|
+
|
|
28
|
+
Déterminer la forme explicite de $u$.`;
|
|
29
|
+
};
|
|
30
|
+
const getHint = () => {
|
|
31
|
+
return `La forme explicite d'une suite géométrique $u$ de premier terme $u_0$ et de raison $q$ est :
|
|
32
|
+
|
|
33
|
+
$$
|
|
34
|
+
u_n = u_0\\times q^n
|
|
35
|
+
$$
|
|
36
|
+
|
|
37
|
+
Commence par lire le premier terme de la suite $u_0$.
|
|
38
|
+
|
|
39
|
+
Puis, détermine la raison de la suite en observant comment on passe d'un terme au suivant. `;
|
|
40
|
+
};
|
|
41
|
+
const getCorrection = (identifiers) => {
|
|
42
|
+
const { q, start } = identifiers;
|
|
43
|
+
return `On lit le premier terme de la suite :
|
|
44
|
+
|
|
45
|
+
$$
|
|
46
|
+
u_0 = ${start.frenchify()}
|
|
47
|
+
$$
|
|
48
|
+
|
|
49
|
+
Puis, on détermine la raison de la suite. Pour cela, on remarque que :
|
|
50
|
+
|
|
51
|
+
$$
|
|
52
|
+
u_1 = ${round(start * q, 2).frenchify()}
|
|
53
|
+
$$
|
|
54
|
+
|
|
55
|
+
Pour passer de $u_0$ à $u_1$, on a donc multiplié par $${q.frenchify()}$ : c'est la raison de la suite.
|
|
56
|
+
|
|
57
|
+
La forme explicite de $u$ est donc :
|
|
58
|
+
|
|
59
|
+
$$
|
|
60
|
+
u_n = ${getAnswer(identifiers)}
|
|
61
|
+
$$
|
|
62
|
+
`;
|
|
63
|
+
};
|
|
64
|
+
const getGGBOptions = (identifiers) => {
|
|
65
|
+
const { q, start } = identifiers;
|
|
66
|
+
const ggb = new GeogebraConstructor({
|
|
67
|
+
commands: [`Sequence((n, ${start}*${q}^n), n, 0, 50)`],
|
|
68
|
+
lockedAxesRatio: false,
|
|
69
|
+
});
|
|
70
|
+
return ggb.getOptions({
|
|
71
|
+
coords: [-1, 5, -1, 1.2 * Math.max(start, q * start, q * q * start)],
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
const getKeys = () => {
|
|
75
|
+
return ["n"];
|
|
76
|
+
};
|
|
77
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
78
|
+
try {
|
|
79
|
+
const parsed = parseAlgebraic(ans);
|
|
80
|
+
if (!parsed)
|
|
81
|
+
return false;
|
|
82
|
+
return parsed.simplify().toTex() === answer;
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
return handleVEAError(err);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const getReadExponentialFunctionParamsOnGraphQuestion = () => {
|
|
89
|
+
const [start, q] = random([
|
|
90
|
+
[random([2, 4, 6, 8]), 0.5],
|
|
91
|
+
[random([0.2, 1, 2, 3, 4, 5]), 2],
|
|
92
|
+
[random([0.5, 2]), 3],
|
|
93
|
+
]);
|
|
94
|
+
const identifiers = {
|
|
95
|
+
start,
|
|
96
|
+
q,
|
|
97
|
+
};
|
|
98
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
99
|
+
};
|
|
100
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
101
|
+
return {
|
|
102
|
+
answer: getAnswer(identifiers),
|
|
103
|
+
instruction: getInstruction(identifiers),
|
|
104
|
+
keys: getKeys(identifiers),
|
|
105
|
+
answerFormat: "tex",
|
|
106
|
+
identifiers,
|
|
107
|
+
hint: getHint(identifiers),
|
|
108
|
+
correction: getCorrection(identifiers),
|
|
109
|
+
ggbOptions: getGGBOptions(identifiers),
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export const readGeometricExpressionFromGraph = {
|
|
113
|
+
id: "readGeometricExpressionFromGraph",
|
|
114
|
+
connector: "=",
|
|
115
|
+
label: "Déterminer la forme explicite d'une suite géométrique à partir de son nuage de points",
|
|
116
|
+
isSingleStep: true,
|
|
117
|
+
generator: (nb, opts) => getDistinctQuestions(() => getReadExponentialFunctionParamsOnGraphQuestion(opts), nb, 10),
|
|
118
|
+
qcmTimer: 60,
|
|
119
|
+
freeTimer: 60,
|
|
120
|
+
getPropositions,
|
|
121
|
+
isAnswerValid,
|
|
122
|
+
subject: "Mathématiques",
|
|
123
|
+
getHint,
|
|
124
|
+
getCorrection,
|
|
125
|
+
getInstruction,
|
|
126
|
+
getAnswer,
|
|
127
|
+
getGGBOptions,
|
|
128
|
+
hasGeogebra: true,
|
|
129
|
+
getQuestionFromIdentifiers,
|
|
130
|
+
hasHintAndCorrection: true,
|
|
131
|
+
maxAllowedQuestions: 10,
|
|
132
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Exercise } from "../../../../../exercises/exercise.js";
|
|
2
|
+
type Identifiers = {
|
|
3
|
+
isGeo: boolean;
|
|
4
|
+
sequence: number[];
|
|
5
|
+
};
|
|
6
|
+
type Options = {
|
|
7
|
+
firstTermRankOne?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const recognizeGeometricFromGraph: Exercise<Identifiers, Options>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=recognizeGeometricFromGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recognizeGeometricFromGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/exercises/math/sequences/geometric/graph/recognizeGeometricFromGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AASrC,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AA8IF,KAAK,OAAO,GAAG;IACb,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AASF,eAAO,MAAM,2BAA2B,EAAE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAkBtE,CAAC"}
|