math-exercises 3.0.215 → 3.0.216
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/arithmetic/whichDayInXDays.d.ts.map +1 -1
- package/lib/exercises/math/arithmetic/whichDayInXDays.js +2 -1
- package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.js +1 -1
- package/lib/exercises/math/conversion/clock/index.d.ts +0 -1
- package/lib/exercises/math/conversion/clock/index.d.ts.map +1 -1
- package/lib/exercises/math/conversion/clock/index.js +1 -1
- package/lib/exercises/math/graphs/adjacentMatrixPath.d.ts +10 -0
- package/lib/exercises/math/graphs/adjacentMatrixPath.d.ts.map +1 -0
- package/lib/exercises/math/graphs/adjacentMatrixPath.js +89 -0
- package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.d.ts +7 -0
- package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.d.ts.map +1 -0
- package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.js +98 -0
- package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.d.ts +8 -0
- package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.d.ts.map +1 -0
- package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.js +96 -0
- package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.d.ts +15 -0
- package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.js +262 -0
- package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.d.ts +11 -0
- package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.js +178 -0
- package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts +19 -0
- package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsCheckIsSameGraph.js +301 -0
- package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.d.ts +16 -0
- package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.js +207 -0
- package/lib/exercises/math/graphs/graphsDegreeOfVertex.d.ts +15 -0
- package/lib/exercises/math/graphs/graphsDegreeOfVertex.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsDegreeOfVertex.js +232 -0
- package/lib/exercises/math/graphs/graphsOrderOfGraph.d.ts +14 -0
- package/lib/exercises/math/graphs/graphsOrderOfGraph.d.ts.map +1 -0
- package/lib/exercises/math/graphs/graphsOrderOfGraph.js +222 -0
- package/lib/exercises/math/graphs/index.d.ts +10 -0
- package/lib/exercises/math/graphs/index.d.ts.map +1 -0
- package/lib/exercises/math/graphs/index.js +9 -0
- package/lib/exercises/math/index.d.ts +1 -0
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +1 -0
- package/lib/exercises/math/matrices/areMatricesInverse.d.ts +9 -0
- package/lib/exercises/math/matrices/areMatricesInverse.d.ts.map +1 -0
- package/lib/exercises/math/matrices/areMatricesInverse.js +106 -0
- package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.d.ts +9 -0
- package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.d.ts.map +1 -0
- package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.js +144 -0
- package/lib/exercises/math/matrices/findInversedMatrixFromSystem.d.ts +8 -0
- package/lib/exercises/math/matrices/findInversedMatrixFromSystem.d.ts.map +1 -0
- package/lib/exercises/math/matrices/findInversedMatrixFromSystem.js +148 -0
- package/lib/exercises/math/matrices/index.d.ts +12 -0
- package/lib/exercises/math/matrices/index.d.ts.map +1 -1
- package/lib/exercises/math/matrices/index.js +12 -0
- package/lib/exercises/math/matrices/isMatrixTransitionMatrix.d.ts +8 -0
- package/lib/exercises/math/matrices/isMatrixTransitionMatrix.d.ts.map +1 -0
- package/lib/exercises/math/matrices/isMatrixTransitionMatrix.js +132 -0
- package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.d.ts +8 -0
- package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.js +152 -0
- package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.d.ts +8 -0
- package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.js +155 -0
- package/lib/exercises/math/matrices/matrixComputeDetOfMat2.d.ts +8 -0
- package/lib/exercises/math/matrices/matrixComputeDetOfMat2.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixComputeDetOfMat2.js +142 -0
- package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.d.ts +8 -0
- package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.js +237 -0
- package/lib/exercises/math/matrices/matrixComputeLinearCombination.d.ts +15 -0
- package/lib/exercises/math/matrices/matrixComputeLinearCombination.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixComputeLinearCombination.js +232 -0
- package/lib/exercises/math/matrices/matrixComputePower.d.ts +12 -0
- package/lib/exercises/math/matrices/matrixComputePower.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixComputePower.js +230 -0
- package/lib/exercises/math/matrices/matrixComputeProduct.d.ts +9 -0
- package/lib/exercises/math/matrices/matrixComputeProduct.d.ts.map +1 -0
- package/lib/exercises/math/matrices/matrixComputeProduct.js +178 -0
- package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.d.ts +8 -0
- package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.d.ts.map +1 -0
- package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.js +105 -0
- package/lib/exercises/vea/matrixVEA.d.ts +2 -0
- package/lib/exercises/vea/matrixVEA.d.ts.map +1 -0
- package/lib/exercises/vea/matrixVEA.js +1 -0
- package/lib/index.d.ts +86 -13
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +3 -1
- package/lib/math/graphs/graph.d.ts +43 -0
- package/lib/math/graphs/graph.d.ts.map +1 -0
- package/lib/math/graphs/graph.js +391 -0
- package/lib/math/matrices/matrix.d.ts +42 -3
- package/lib/math/matrices/matrix.d.ts.map +1 -1
- package/lib/math/matrices/matrix.js +173 -7
- package/lib/math/matrices/parseMatrix.d.ts +3 -0
- package/lib/math/matrices/parseMatrix.d.ts.map +1 -0
- package/lib/math/matrices/parseMatrix.js +22 -0
- package/lib/math/systems/generalSystem.d.ts +2 -0
- package/lib/math/systems/generalSystem.d.ts.map +1 -1
- package/lib/math/systems/generalSystem.js +5 -0
- package/lib/math/utils/graphs/graphRenderer.d.ts +25 -0
- package/lib/math/utils/graphs/graphRenderer.d.ts.map +1 -0
- package/lib/math/utils/graphs/graphRenderer.js +123 -0
- package/lib/playground.d.ts +6 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +6 -5
- package/lib/tree/parsers/latexParser.d.ts +1 -1
- package/lib/tree/utilities/nodeSimplifier.d.ts +1 -1
- package/lib/types/keyIds.d.ts +2 -0
- package/lib/types/keyIds.d.ts.map +1 -1
- package/lib/utils/arrays/arrayChunks.d.ts +9 -0
- package/lib/utils/arrays/arrayChunks.d.ts.map +1 -0
- package/lib/utils/arrays/arrayChunks.js +34 -0
- package/lib/utils/strings/ordinalSuffixed.d.ts +2 -0
- package/lib/utils/strings/ordinalSuffixed.d.ts.map +1 -0
- package/lib/utils/strings/ordinalSuffixed.js +5 -0
- package/package.json +7 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, propWhile, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { MatrixConstructor } from "../../../math/matrices/matrix.js";
|
|
4
|
+
import { parseMatrix } from "../../../math/matrices/parseMatrix.js";
|
|
5
|
+
import { GeneralSystem, GeneralSystemConstructor, } from "../../../math/systems/generalSystem.js";
|
|
6
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
7
|
+
const getPropositions = (n, { answer }) => {
|
|
8
|
+
const propositions = [];
|
|
9
|
+
addValidProp(propositions, answer);
|
|
10
|
+
propWhile(propositions, n, () => {
|
|
11
|
+
const matrix = MatrixConstructor.randomInversible(2, 2, {
|
|
12
|
+
niceInversible: true,
|
|
13
|
+
elementsOpts: [-10, 10, [0]],
|
|
14
|
+
});
|
|
15
|
+
const inv = matrix.toInversed().simplify();
|
|
16
|
+
tryToAddWrongProp(propositions, inv.toTex());
|
|
17
|
+
});
|
|
18
|
+
return shuffleProps(propositions, n);
|
|
19
|
+
};
|
|
20
|
+
const getAnswer = (identifiers) => {
|
|
21
|
+
const { systemIds } = identifiers;
|
|
22
|
+
const system = GeneralSystemConstructor.fromIdentifiers(systemIds);
|
|
23
|
+
const matrix = system.getMatrix();
|
|
24
|
+
return matrix.toInversed().simplify().toTex();
|
|
25
|
+
};
|
|
26
|
+
const getInstruction = (identifiers) => {
|
|
27
|
+
const { systemIds } = identifiers;
|
|
28
|
+
const system = GeneralSystemConstructor.fromIdentifiers(systemIds);
|
|
29
|
+
const matrix = system.getMatrix();
|
|
30
|
+
return `On considère la matrice :
|
|
31
|
+
|
|
32
|
+
$$
|
|
33
|
+
A = ${matrix.toTex()}
|
|
34
|
+
$$
|
|
35
|
+
|
|
36
|
+
et le système d'inconnues $x$ et $y$, où $a$ et $b$ sont des réels :
|
|
37
|
+
|
|
38
|
+
$$
|
|
39
|
+
${system.toTex()}
|
|
40
|
+
$$
|
|
41
|
+
|
|
42
|
+
Résoudre le système, puis en déduire la matrice inverse de $A$.`;
|
|
43
|
+
};
|
|
44
|
+
const getHint = () => {
|
|
45
|
+
return `Commence par résoudre le système.
|
|
46
|
+
|
|
47
|
+
Puis, utilise le fait que si $A$ est inversible, alors $AX=B \\iff X = A^{-1}B$.`;
|
|
48
|
+
};
|
|
49
|
+
const getCorrection = (identifiers) => {
|
|
50
|
+
const { systemIds } = identifiers;
|
|
51
|
+
const system = GeneralSystemConstructor.fromIdentifiers(systemIds);
|
|
52
|
+
const { x, y } = system.solve();
|
|
53
|
+
const matrix = system.getMatrix();
|
|
54
|
+
return `On résout le système, on trouve :
|
|
55
|
+
|
|
56
|
+
$$
|
|
57
|
+
\\left\\{\\begin{matrix}
|
|
58
|
+
x & = & ${x
|
|
59
|
+
.simplify({
|
|
60
|
+
towardsDistribute: true,
|
|
61
|
+
forbidFactorize: true,
|
|
62
|
+
forceDistributeFractions: true,
|
|
63
|
+
})
|
|
64
|
+
.toTex()}\\\\
|
|
65
|
+
y & = & ${y
|
|
66
|
+
.simplify({
|
|
67
|
+
towardsDistribute: true,
|
|
68
|
+
forbidFactorize: true,
|
|
69
|
+
forceDistributeFractions: true,
|
|
70
|
+
})
|
|
71
|
+
.toTex()}
|
|
72
|
+
\\end{matrix}\\right.
|
|
73
|
+
$$
|
|
74
|
+
|
|
75
|
+
Or, ce système est équivalent à $AX = B$ avec :
|
|
76
|
+
|
|
77
|
+
$$
|
|
78
|
+
A=${matrix.toTex()}, X = \\begin{pmatrix}x\\\\ y\\end{pmatrix}, B = \\begin{pmatrix}a\\\\ b\\end{pmatrix}
|
|
79
|
+
$$
|
|
80
|
+
|
|
81
|
+
On a alors :
|
|
82
|
+
|
|
83
|
+
$$
|
|
84
|
+
AX = B \\iff X = A^{-1} B
|
|
85
|
+
$$
|
|
86
|
+
|
|
87
|
+
donc
|
|
88
|
+
|
|
89
|
+
$$
|
|
90
|
+
A^{-1} = ${matrix.toInversed().simplify().toTex()}
|
|
91
|
+
$$`;
|
|
92
|
+
};
|
|
93
|
+
const getKeys = () => {
|
|
94
|
+
return ["mat-2-2"];
|
|
95
|
+
};
|
|
96
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
97
|
+
try {
|
|
98
|
+
const matAns = parseMatrix(ans);
|
|
99
|
+
const matAnswer = parseMatrix(answer);
|
|
100
|
+
return matAns.equals(matAnswer);
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
return handleVEAError(err);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
const getFindInversedMatrixFromSystemQuestion = () => {
|
|
107
|
+
const matrix = MatrixConstructor.randomInversible(2, 2, {
|
|
108
|
+
niceInversible: true,
|
|
109
|
+
elementsOpts: [-10, 10, [0]],
|
|
110
|
+
});
|
|
111
|
+
const sys = new GeneralSystem(matrix.elements.map((row, i) => [
|
|
112
|
+
...row,
|
|
113
|
+
String.fromCharCode(97 + i).toTree(),
|
|
114
|
+
]));
|
|
115
|
+
const identifiers = {
|
|
116
|
+
systemIds: sys.toIdentifiers(),
|
|
117
|
+
};
|
|
118
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
119
|
+
};
|
|
120
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
121
|
+
return {
|
|
122
|
+
answer: getAnswer(identifiers),
|
|
123
|
+
instruction: getInstruction(identifiers),
|
|
124
|
+
keys: getKeys(identifiers),
|
|
125
|
+
answerFormat: "tex",
|
|
126
|
+
identifiers,
|
|
127
|
+
hint: getHint(identifiers),
|
|
128
|
+
correction: getCorrection(identifiers),
|
|
129
|
+
};
|
|
130
|
+
};
|
|
131
|
+
export const findInversedMatrixFromSystem = {
|
|
132
|
+
id: "findInversedMatrixFromSystem",
|
|
133
|
+
connector: "=",
|
|
134
|
+
label: "Déterminer l'inverse d'une matrice en résolvant un système d'équations linéaires",
|
|
135
|
+
isSingleStep: true,
|
|
136
|
+
generator: (nb, opts) => getDistinctQuestions(() => getFindInversedMatrixFromSystemQuestion(opts), nb),
|
|
137
|
+
qcmTimer: 60,
|
|
138
|
+
freeTimer: 60,
|
|
139
|
+
getPropositions,
|
|
140
|
+
isAnswerValid,
|
|
141
|
+
subject: "Mathématiques",
|
|
142
|
+
getInstruction,
|
|
143
|
+
getHint,
|
|
144
|
+
getCorrection,
|
|
145
|
+
getAnswer,
|
|
146
|
+
getQuestionFromIdentifiers,
|
|
147
|
+
hasHintAndCorrection: true,
|
|
148
|
+
};
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
export * from "./matrixInversibilityDomain.js";
|
|
2
2
|
export * from "./productCell.js";
|
|
3
|
+
export * from "./matrixComputeLinearCombination.js";
|
|
4
|
+
export * from "./matrixComputeProduct.js";
|
|
5
|
+
export * from "./matrixComputePower.js";
|
|
6
|
+
export * from "./matrixBuildMatrixFromCoefficients.js";
|
|
7
|
+
export * from "./matrixComputeDetOfMat2.js";
|
|
8
|
+
export * from "./matrixComputeInverseOfMat2.js";
|
|
9
|
+
export * from "./matrixCheckIsSymmetrical.js";
|
|
10
|
+
export * from "./areMatricesInverse.js";
|
|
11
|
+
export * from "./writeMatrixAssociatedToSystem.js";
|
|
12
|
+
export * from "./findInversedMatrixFromSystem.js";
|
|
13
|
+
export * from "./isMatrixTransitionMatrix.js";
|
|
14
|
+
export * from "./computeFixedMatrixInRecurrenceSequence.js";
|
|
3
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/matrices/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/matrices/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AAGjC,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,wCAAwC,CAAC;AACvD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6CAA6C,CAAC"}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
export * from "./matrixInversibilityDomain.js";
|
|
2
2
|
export * from "./productCell.js";
|
|
3
3
|
// export * from "./matrixGeneralTerm.js";
|
|
4
|
+
export * from "./matrixComputeLinearCombination.js";
|
|
5
|
+
export * from "./matrixComputeProduct.js";
|
|
6
|
+
export * from "./matrixComputePower.js";
|
|
7
|
+
export * from "./matrixBuildMatrixFromCoefficients.js";
|
|
8
|
+
export * from "./matrixComputeDetOfMat2.js";
|
|
9
|
+
export * from "./matrixComputeInverseOfMat2.js";
|
|
10
|
+
export * from "./matrixCheckIsSymmetrical.js";
|
|
11
|
+
export * from "./areMatricesInverse.js";
|
|
12
|
+
export * from "./writeMatrixAssociatedToSystem.js";
|
|
13
|
+
export * from "./findInversedMatrixFromSystem.js";
|
|
14
|
+
export * from "./isMatrixTransitionMatrix.js";
|
|
15
|
+
export * from "./computeFixedMatrixInRecurrenceSequence.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
import { MatrixIdentifiers } from "../../../math/matrices/matrix.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
matrixIds: MatrixIdentifiers;
|
|
5
|
+
};
|
|
6
|
+
export declare const isMatrixTransitionMatrix: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=isMatrixTransitionMatrix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isMatrixTransitionMatrix.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/matrices/isMatrixTransitionMatrix.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAUvC,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,iBAAiB,CAAC;CAC9B,CAAC;AAgIF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAiB1D,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { addValidProp, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Matrix, MatrixConstructor, } from "../../../math/matrices/matrix.js";
|
|
4
|
+
import { RationalConstructor } from "../../../math/numbers/rationals/rational.js";
|
|
5
|
+
import { randfloat } from "../../../math/utils/random/randfloat.js";
|
|
6
|
+
import { AddNode } from "../../../tree/nodes/operators/addNode.js";
|
|
7
|
+
import { substract } from "../../../tree/nodes/operators/substractNode.js";
|
|
8
|
+
import { operatorComposition } from "../../../tree/utilities/operatorComposition.js";
|
|
9
|
+
import { coinFlip } from "../../../utils/alea/coinFlip.js";
|
|
10
|
+
import { doWhile } from "../../../utils/doWhile.js";
|
|
11
|
+
const getPropositions = (n, { answer }) => {
|
|
12
|
+
const propositions = [];
|
|
13
|
+
addValidProp(propositions, answer, "raw");
|
|
14
|
+
tryToAddWrongProp(propositions, "Oui", "raw");
|
|
15
|
+
tryToAddWrongProp(propositions, "Non", "raw");
|
|
16
|
+
return shuffleProps(propositions, n);
|
|
17
|
+
};
|
|
18
|
+
const getAnswer = (identifiers) => {
|
|
19
|
+
const { matrixIds } = identifiers;
|
|
20
|
+
const matrix = MatrixConstructor.fromIdentifiers(matrixIds);
|
|
21
|
+
return matrix.isTransition() ? "Oui" : "Non";
|
|
22
|
+
};
|
|
23
|
+
const getInstruction = (identifiers) => {
|
|
24
|
+
const { matrixIds } = identifiers;
|
|
25
|
+
const matrix = MatrixConstructor.fromIdentifiers(matrixIds);
|
|
26
|
+
return `On considère la matrice $P$ ci-dessous :
|
|
27
|
+
|
|
28
|
+
$$
|
|
29
|
+
P = ${matrix.toTex()}
|
|
30
|
+
$$
|
|
31
|
+
|
|
32
|
+
$P$ est-elle une matrice de transition ?`;
|
|
33
|
+
};
|
|
34
|
+
const getHint = () => {
|
|
35
|
+
return `Une matrice de transition est une matrice associée à un graphe probabiliste, où le terme à la $i$-ème ligne et à la $j$-ème colonne est égale au poids de l'arête allant du sommet $i$ au sommet $j$ si elle existe, $0$ sinon.
|
|
36
|
+
|
|
37
|
+
Une matrice de transition est donc composée de probabilités, et la somme de chaque ligne doit valoir $1$.`;
|
|
38
|
+
};
|
|
39
|
+
const getCorrection = (identifiers) => {
|
|
40
|
+
const { matrixIds } = identifiers;
|
|
41
|
+
const matrix = MatrixConstructor.fromIdentifiers(matrixIds);
|
|
42
|
+
const nonProba = matrix.elements
|
|
43
|
+
.flat()
|
|
44
|
+
.find((x) => x.evaluate() < 0 || x.evaluate() > 1);
|
|
45
|
+
const lineNotOne = matrix.elements.find((line) => line.reduce((acc, el) => acc + el.evaluate(), 0) !== 1);
|
|
46
|
+
const hasNoProba = !!nonProba;
|
|
47
|
+
const hasLineNotOne = !!lineNotOne;
|
|
48
|
+
return `Une matrice est une matrice de transition si :
|
|
49
|
+
|
|
50
|
+
- elle est carrée ;
|
|
51
|
+
- ses éléments sont des nombres compris entre $0$ et $1$ ;
|
|
52
|
+
- la somme de chacune de ses lignes vaut $1$.
|
|
53
|
+
|
|
54
|
+
La matrice proposée est bien carrée.
|
|
55
|
+
|
|
56
|
+
${hasNoProba
|
|
57
|
+
? `Cependant, au moins un de ses éléments n'est pas compris entre $0$ et $1$, puisque la matrice contient $${nonProba?.toTex()}$.
|
|
58
|
+
|
|
59
|
+
Ce n'est donc pas une matrice de transition.`
|
|
60
|
+
: `Ses éléments sont bien des nombres entre $0$ et $1$.`}
|
|
61
|
+
|
|
62
|
+
${!hasNoProba &&
|
|
63
|
+
(hasLineNotOne
|
|
64
|
+
? `Cependant, la somme d'au moins une de ses lignes de vaut pas $1$ :
|
|
65
|
+
|
|
66
|
+
$$
|
|
67
|
+
${operatorComposition(AddNode, lineNotOne).toSimplificationTex()}
|
|
68
|
+
$$
|
|
69
|
+
|
|
70
|
+
Ce n'est donc pas une matrice de transition.
|
|
71
|
+
`
|
|
72
|
+
: `La somme de chacune de ses lignes vaut bien $1$.
|
|
73
|
+
|
|
74
|
+
C'est donc bien une matrice de transition.`)}
|
|
75
|
+
`;
|
|
76
|
+
};
|
|
77
|
+
const getIsMatrixTransitionMatrixQuestion = () => {
|
|
78
|
+
let b;
|
|
79
|
+
let d;
|
|
80
|
+
const isTransition = coinFlip();
|
|
81
|
+
const isRational = coinFlip();
|
|
82
|
+
const getValue = () => isRational
|
|
83
|
+
? RationalConstructor.randomIrreductibleProba().toTree()
|
|
84
|
+
: randfloat(0.01, 1, 2).toTree();
|
|
85
|
+
const a = getValue();
|
|
86
|
+
const c = getValue();
|
|
87
|
+
if (isTransition) {
|
|
88
|
+
b = substract(1, a).simplify();
|
|
89
|
+
d = substract(1, c).simplify();
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
[b, d] = doWhile(() => [getValue(), getValue()], ([x, y]) => new Matrix([
|
|
93
|
+
[a, x],
|
|
94
|
+
[c, y],
|
|
95
|
+
]).isTransition());
|
|
96
|
+
}
|
|
97
|
+
const identifiers = {
|
|
98
|
+
matrixIds: new Matrix([
|
|
99
|
+
[a, b],
|
|
100
|
+
[c, d],
|
|
101
|
+
]).toIdentifiers(),
|
|
102
|
+
};
|
|
103
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
104
|
+
};
|
|
105
|
+
const getQuestionFromIdentifiers = (identifiers) => {
|
|
106
|
+
return {
|
|
107
|
+
answer: getAnswer(identifiers),
|
|
108
|
+
instruction: getInstruction(identifiers),
|
|
109
|
+
keys: [],
|
|
110
|
+
answerFormat: "tex",
|
|
111
|
+
identifiers,
|
|
112
|
+
hint: getHint(identifiers),
|
|
113
|
+
correction: getCorrection(identifiers),
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
export const isMatrixTransitionMatrix = {
|
|
117
|
+
id: "isMatrixTransitionMatrix",
|
|
118
|
+
label: "Déterminer si une matrice est une matrice de transition",
|
|
119
|
+
isSingleStep: true,
|
|
120
|
+
generator: (nb, opts) => getDistinctQuestions(() => getIsMatrixTransitionMatrixQuestion(opts), nb),
|
|
121
|
+
qcmTimer: 60,
|
|
122
|
+
freeTimer: 60,
|
|
123
|
+
getPropositions,
|
|
124
|
+
answerType: "QCU",
|
|
125
|
+
subject: "Mathématiques",
|
|
126
|
+
getInstruction,
|
|
127
|
+
getHint,
|
|
128
|
+
getCorrection,
|
|
129
|
+
getAnswer,
|
|
130
|
+
getQuestionFromIdentifiers,
|
|
131
|
+
hasHintAndCorrection: true,
|
|
132
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
import { MatrixIdentifiers } from "../../../math/matrices/matrix.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
matIdsA: MatrixIdentifiers;
|
|
5
|
+
};
|
|
6
|
+
export declare const matrixBuildMatrixFromCoefficients: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=matrixBuildMatrixFromCoefficients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrixBuildMatrixFromCoefficients.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/matrices/matrixBuildMatrixFromCoefficients.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAMvC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AA4KF,eAAO,MAAM,iCAAiC,EAAE,QAAQ,CAAC,WAAW,CAkBnE,CAAC"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { addValidProp, propWhile, shuffleProps, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Matrix, MatrixConstructor, } from "../../../math/matrices/matrix.js";
|
|
4
|
+
import { parseMatrix } from "../../../math/matrices/parseMatrix.js";
|
|
5
|
+
import { arrayRotation } from "../../../utils/arrays/rotation.js";
|
|
6
|
+
import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
|
|
7
|
+
const getHydrated = (identifiers) => {
|
|
8
|
+
const { matIdsA } = identifiers;
|
|
9
|
+
const [matA] = [matIdsA].map((matIds) => MatrixConstructor.fromIdentifiers(matIds));
|
|
10
|
+
const dictCoeffs = Object.fromEntries(matA.elements.flatMap((row, i) => row.map((elt, j) => [`a_{${i + 1},${j + 1}}`, elt])));
|
|
11
|
+
return {
|
|
12
|
+
matA,
|
|
13
|
+
dictCoeffs,
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
const getInstruction = (identifiers) => {
|
|
17
|
+
const { dictCoeffs } = getHydrated(identifiers);
|
|
18
|
+
return `Soit :
|
|
19
|
+
|
|
20
|
+
$$
|
|
21
|
+
A = (a_{i,j})
|
|
22
|
+
$$
|
|
23
|
+
|
|
24
|
+
On donne :
|
|
25
|
+
|
|
26
|
+
${Object.entries(dictCoeffs)
|
|
27
|
+
.map(([tex, node]) => `
|
|
28
|
+
|
|
29
|
+
$$
|
|
30
|
+
${tex} = ${node.toTex()}
|
|
31
|
+
$$
|
|
32
|
+
|
|
33
|
+
Écrire la matrice $A$.
|
|
34
|
+
`)
|
|
35
|
+
.join("")}`;
|
|
36
|
+
};
|
|
37
|
+
const getAnswer = (identifiers) => {
|
|
38
|
+
const { matA } = getHydrated(identifiers);
|
|
39
|
+
return matA.toTex();
|
|
40
|
+
};
|
|
41
|
+
const getHint = () => {
|
|
42
|
+
const matA = new Matrix([
|
|
43
|
+
["a".toTree(), "b".toTree()],
|
|
44
|
+
["c".toTree(), "d".toTree()],
|
|
45
|
+
]);
|
|
46
|
+
return `Soient $A$ une matrice à $2$ lignes et $2$ colonnes à coefficients réels.
|
|
47
|
+
|
|
48
|
+
$$
|
|
49
|
+
A = ${matA.toTex()}
|
|
50
|
+
$$
|
|
51
|
+
|
|
52
|
+
Dans l'expression des coefficients de $A$ (à savoir $A=(a_{ij})$), $i$ correspond à la ligne et $j$ correspond à la colonne.
|
|
53
|
+
Ici, par exemple :
|
|
54
|
+
|
|
55
|
+
$$
|
|
56
|
+
a_{21} = c
|
|
57
|
+
$$
|
|
58
|
+
|
|
59
|
+
`;
|
|
60
|
+
};
|
|
61
|
+
const getCorrection = (identifiers) => {
|
|
62
|
+
const { matA } = getHydrated(identifiers);
|
|
63
|
+
return `Dans l'expression des coefficients de $A$ (à savoir $A=(a_{ij})$), $i$ correspond à la ligne et $j$ correspond à la colonne.
|
|
64
|
+
|
|
65
|
+
$$
|
|
66
|
+
A = ${matA.toTex()}
|
|
67
|
+
$$
|
|
68
|
+
|
|
69
|
+
`;
|
|
70
|
+
};
|
|
71
|
+
const getPropositions = (n, { answer, ...identifiers }) => {
|
|
72
|
+
const propositions = [];
|
|
73
|
+
addValidProp(propositions, answer);
|
|
74
|
+
const { matA } = getHydrated(identifiers);
|
|
75
|
+
//student a_{ij} -> a_{ji}
|
|
76
|
+
{
|
|
77
|
+
const matWrong = matA.transposed();
|
|
78
|
+
tryToAddWrongProp(propositions, matWrong.toTex());
|
|
79
|
+
}
|
|
80
|
+
//student: a_{12} -> a_{02}
|
|
81
|
+
{
|
|
82
|
+
const elementsShifted = arrayRotation(matA.elements, 1);
|
|
83
|
+
const matWrong = new Matrix(elementsShifted);
|
|
84
|
+
tryToAddWrongProp(propositions, matWrong.toTex());
|
|
85
|
+
}
|
|
86
|
+
//student: a_{ij} -> a_{ji} and a_{12} -> a_{02}
|
|
87
|
+
{
|
|
88
|
+
const elementsShifted = arrayRotation(matA.elements, 1);
|
|
89
|
+
const matWrong = new Matrix(elementsShifted).transposed();
|
|
90
|
+
tryToAddWrongProp(propositions, matWrong.toTex());
|
|
91
|
+
}
|
|
92
|
+
//filler
|
|
93
|
+
{
|
|
94
|
+
propWhile(propositions, n, () => {
|
|
95
|
+
const identifiersWrong = createRandomIdentifiers();
|
|
96
|
+
tryToAddWrongProp(propositions, getAnswer(identifiersWrong));
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return shuffleProps(propositions, n);
|
|
100
|
+
};
|
|
101
|
+
const getKeys = () => {
|
|
102
|
+
return ["mat-2-2"];
|
|
103
|
+
};
|
|
104
|
+
const isAnswerValid = (ans, { answer }) => {
|
|
105
|
+
try {
|
|
106
|
+
const matAns = parseMatrix(ans);
|
|
107
|
+
const matAnswer = parseMatrix(answer);
|
|
108
|
+
return matAns.equals(matAnswer);
|
|
109
|
+
}
|
|
110
|
+
catch (e) {
|
|
111
|
+
handleVEAError(e);
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
const createRandomIdentifiers = () => {
|
|
116
|
+
const matA = MatrixConstructor.random(2, 2);
|
|
117
|
+
const identifiers = {
|
|
118
|
+
matIdsA: matA.toIdentifiers(),
|
|
119
|
+
};
|
|
120
|
+
return identifiers;
|
|
121
|
+
};
|
|
122
|
+
const getMatrixBuildMatrixFromCoefficientsQuestion = () => {
|
|
123
|
+
const identifiers = createRandomIdentifiers();
|
|
124
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
125
|
+
};
|
|
126
|
+
const getQuestionFromIdentifiers = (identifiers, optsIn) => {
|
|
127
|
+
const question = {
|
|
128
|
+
answer: getAnswer(identifiers),
|
|
129
|
+
instruction: getInstruction(identifiers),
|
|
130
|
+
keys: getKeys(identifiers),
|
|
131
|
+
answerFormat: "tex",
|
|
132
|
+
identifiers,
|
|
133
|
+
hint: getHint(identifiers),
|
|
134
|
+
correction: getCorrection(identifiers),
|
|
135
|
+
options: optsIn,
|
|
136
|
+
};
|
|
137
|
+
return question;
|
|
138
|
+
};
|
|
139
|
+
export const matrixBuildMatrixFromCoefficients = {
|
|
140
|
+
id: "matrixBuildMatrixFromCoefficients",
|
|
141
|
+
connector: "=",
|
|
142
|
+
label: "Écrire une matrice à partir de la donnée de ses coefficients $a_{ij}$",
|
|
143
|
+
isSingleStep: true,
|
|
144
|
+
generator: (nb, opts) => getDistinctQuestions(() => getMatrixBuildMatrixFromCoefficientsQuestion(opts), nb),
|
|
145
|
+
qcmTimer: 60,
|
|
146
|
+
freeTimer: 60,
|
|
147
|
+
getPropositions,
|
|
148
|
+
isAnswerValid,
|
|
149
|
+
subject: "Mathématiques",
|
|
150
|
+
getQuestionFromIdentifiers,
|
|
151
|
+
hasHintAndCorrection: true,
|
|
152
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
import { MatrixIdentifiers } from "../../../math/matrices/matrix.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
matIdsA: MatrixIdentifiers;
|
|
5
|
+
};
|
|
6
|
+
export declare const matrixCheckIsSymmetrical: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=matrixCheckIsSymmetrical.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrixCheckIsSymmetrical.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/matrices/matrixCheckIsSymmetrical.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAYT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAsBvC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAoJF,eAAO,MAAM,wBAAwB,EAAE,QAAQ,CAAC,WAAW,CAc1D,CAAC"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { addValidProp, tryToAddWrongProp, } from "../../../exercises/exercise.js";
|
|
2
|
+
import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
|
|
3
|
+
import { Matrix, MatrixConstructor, } from "../../../math/matrices/matrix.js";
|
|
4
|
+
import { randint } from "../../../math/utils/random/randint.js";
|
|
5
|
+
import { NodeComparator } from "../../../tree/utilities/nodeComparator.js";
|
|
6
|
+
import { random } from "../../../utils/alea/random.js";
|
|
7
|
+
import { zip } from "../../../utils/arrays/arrayZip.js";
|
|
8
|
+
const _isMatrixSymH = (mat) => {
|
|
9
|
+
return zip(mat.elements, mat.elements.toReversed()).every(([row1, row2]) => zip(row1, row2).every(([node1, node2]) => NodeComparator.isEqualViaSub(node1, node2)));
|
|
10
|
+
};
|
|
11
|
+
const _isMatrixSymV = (mat) => {
|
|
12
|
+
return _isMatrixSymV(mat.transposed());
|
|
13
|
+
};
|
|
14
|
+
const isMatrixSymMat = (mat) => {
|
|
15
|
+
return mat.equals(mat.transposed());
|
|
16
|
+
};
|
|
17
|
+
const getHydrated = (identifiers) => {
|
|
18
|
+
const { matIdsA } = identifiers;
|
|
19
|
+
const [matA] = [matIdsA].map((matIds) => MatrixConstructor.fromIdentifiers(matIds));
|
|
20
|
+
return {
|
|
21
|
+
matA,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
const getInstruction = (identifiers) => {
|
|
25
|
+
const { matA } = getHydrated(identifiers);
|
|
26
|
+
return `Soit :
|
|
27
|
+
|
|
28
|
+
$$
|
|
29
|
+
A = ${matA.toTex()}
|
|
30
|
+
$$
|
|
31
|
+
|
|
32
|
+
La matrice $A$ est-elle symétrique ?`;
|
|
33
|
+
};
|
|
34
|
+
const getAnswer = (identifiers) => {
|
|
35
|
+
const { matA } = getHydrated(identifiers);
|
|
36
|
+
return isMatrixSymMat(matA) ? "Oui" : "Non";
|
|
37
|
+
};
|
|
38
|
+
const getHint = () => {
|
|
39
|
+
return `Une matrice est symétrique si elle est égale à sa transposée.
|
|
40
|
+
Les symétries axiales n'ont rien à voir avec cette qualification.`;
|
|
41
|
+
};
|
|
42
|
+
const getCorrection = (identifiers) => {
|
|
43
|
+
const { matA } = getHydrated(identifiers);
|
|
44
|
+
return `On a :
|
|
45
|
+
|
|
46
|
+
$$
|
|
47
|
+
{}^{t}A = ${matA.transposed().toTex()}
|
|
48
|
+
$$
|
|
49
|
+
|
|
50
|
+
${(() => {
|
|
51
|
+
if (isMatrixSymMat(matA)) {
|
|
52
|
+
return `On a $A = {}^{t}A$. La matrice est donc symétrique.`;
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
return `On a $A \\neq {}^{t}A$. La matrice n'est donc pas symétrique.`;
|
|
56
|
+
}
|
|
57
|
+
})()}
|
|
58
|
+
|
|
59
|
+
`;
|
|
60
|
+
};
|
|
61
|
+
const getPropositions = (_, { answer }) => {
|
|
62
|
+
const propositions = [];
|
|
63
|
+
["Oui", "Non"].forEach((str) => {
|
|
64
|
+
if (str === answer) {
|
|
65
|
+
addValidProp(propositions, str, "raw");
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
tryToAddWrongProp(propositions, str, "raw");
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
return propositions;
|
|
72
|
+
};
|
|
73
|
+
const createRandomIdentifiers = () => {
|
|
74
|
+
const createMatWithSymH = (nbRows, nbCols) => {
|
|
75
|
+
const nbRowsTop = Math.floor(nbRows / 2);
|
|
76
|
+
const nbRowsCenter = nbRows - 2 * nbRowsTop;
|
|
77
|
+
const elementsTop = MatrixConstructor.random(nbRowsTop, nbCols).elements;
|
|
78
|
+
const elementsCenter = nbRowsCenter > 0
|
|
79
|
+
? MatrixConstructor.random(nbRowsCenter, nbCols).elements
|
|
80
|
+
: [];
|
|
81
|
+
const elements = [
|
|
82
|
+
...elementsTop,
|
|
83
|
+
...elementsCenter,
|
|
84
|
+
...elementsTop.toReversed(),
|
|
85
|
+
];
|
|
86
|
+
const mat = new Matrix(elements);
|
|
87
|
+
return mat;
|
|
88
|
+
};
|
|
89
|
+
const matA = (() => {
|
|
90
|
+
const typeSym = random([
|
|
91
|
+
"symH",
|
|
92
|
+
"symV",
|
|
93
|
+
"symMat",
|
|
94
|
+
"square",
|
|
95
|
+
]);
|
|
96
|
+
switch (typeSym) {
|
|
97
|
+
case "symH": {
|
|
98
|
+
const nbRows = randint(3, 6);
|
|
99
|
+
const nbCols = randint(3, 6);
|
|
100
|
+
return createMatWithSymH(nbRows, nbCols);
|
|
101
|
+
}
|
|
102
|
+
case "symV": {
|
|
103
|
+
const nbRows = randint(3, 6);
|
|
104
|
+
const nbCols = randint(3, 6);
|
|
105
|
+
return createMatWithSymH(nbRows, nbCols).transposed();
|
|
106
|
+
}
|
|
107
|
+
case "symMat": {
|
|
108
|
+
const dim = randint(3, 6);
|
|
109
|
+
const matRandom = MatrixConstructor.random(dim, dim);
|
|
110
|
+
return matRandom
|
|
111
|
+
.add(matRandom.transposed())
|
|
112
|
+
.simplify({ towardsDistribute: true });
|
|
113
|
+
}
|
|
114
|
+
case "square": {
|
|
115
|
+
const dim = randint(3, 6);
|
|
116
|
+
const matRandom = MatrixConstructor.random(dim, dim);
|
|
117
|
+
return matRandom.simplify({ towardsDistribute: true });
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
})();
|
|
121
|
+
const identifiers = {
|
|
122
|
+
matIdsA: matA.toIdentifiers(),
|
|
123
|
+
};
|
|
124
|
+
return identifiers;
|
|
125
|
+
};
|
|
126
|
+
const getMatrixCheckIsSymmetricalQuestion = () => {
|
|
127
|
+
const identifiers = createRandomIdentifiers();
|
|
128
|
+
return getQuestionFromIdentifiers(identifiers);
|
|
129
|
+
};
|
|
130
|
+
const getQuestionFromIdentifiers = (identifiers, optsIn) => {
|
|
131
|
+
const question = {
|
|
132
|
+
answer: getAnswer(identifiers),
|
|
133
|
+
instruction: getInstruction(identifiers),
|
|
134
|
+
answerFormat: "raw",
|
|
135
|
+
identifiers,
|
|
136
|
+
hint: getHint(identifiers),
|
|
137
|
+
correction: getCorrection(identifiers),
|
|
138
|
+
options: optsIn,
|
|
139
|
+
};
|
|
140
|
+
return question;
|
|
141
|
+
};
|
|
142
|
+
export const matrixCheckIsSymmetrical = {
|
|
143
|
+
id: "matrixCheckIsSymmetrical",
|
|
144
|
+
connector: "=",
|
|
145
|
+
label: "Déterminer si une matrice est symétrique",
|
|
146
|
+
isSingleStep: true,
|
|
147
|
+
generator: (nb, opts) => getDistinctQuestions(() => getMatrixCheckIsSymmetricalQuestion(opts), nb),
|
|
148
|
+
qcmTimer: 60,
|
|
149
|
+
freeTimer: 60,
|
|
150
|
+
getPropositions,
|
|
151
|
+
subject: "Mathématiques",
|
|
152
|
+
getQuestionFromIdentifiers,
|
|
153
|
+
hasHintAndCorrection: true,
|
|
154
|
+
answerType: "QCU",
|
|
155
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Exercise } from "../../../exercises/exercise.js";
|
|
2
|
+
import { MatrixIdentifiers } from "../../../math/matrices/matrix.js";
|
|
3
|
+
type Identifiers = {
|
|
4
|
+
matIdsA: MatrixIdentifiers;
|
|
5
|
+
};
|
|
6
|
+
export declare const matrixComputeDetOfMat2: Exercise<Identifiers>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=matrixComputeDetOfMat2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matrixComputeDetOfMat2.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/matrices/matrixComputeDetOfMat2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAgBT,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAGL,iBAAiB,EAClB,MAAM,+BAA+B,CAAC;AAQvC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AA0JF,eAAO,MAAM,sBAAsB,EAAE,QAAQ,CAAC,WAAW,CAcxD,CAAC"}
|