math-exercises 3.0.214 → 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.
Files changed (371) hide show
  1. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts +9 -0
  2. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.d.ts.map +1 -0
  3. package/lib/exercises/math/arithmetic/findLeftInHugeNumberDivision.js +194 -0
  4. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts +8 -0
  5. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.d.ts.map +1 -0
  6. package/lib/exercises/math/arithmetic/findMissingNumberToMakeNumberDivisibleBy9.js +121 -0
  7. package/lib/exercises/math/arithmetic/index.d.ts +7 -0
  8. package/lib/exercises/math/arithmetic/index.d.ts.map +1 -1
  9. package/lib/exercises/math/arithmetic/index.js +7 -0
  10. package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts +7 -0
  11. package/lib/exercises/math/arithmetic/isBigNumberPrime.d.ts.map +1 -0
  12. package/lib/exercises/math/arithmetic/isBigNumberPrime.js +107 -0
  13. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts +8 -0
  14. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.d.ts.map +1 -0
  15. package/lib/exercises/math/arithmetic/numberOfEndingZerosOfBigProduct.js +139 -0
  16. package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts +8 -0
  17. package/lib/exercises/math/arithmetic/pgcdFromEuclid.d.ts.map +1 -0
  18. package/lib/exercises/math/arithmetic/pgcdFromEuclid.js +123 -0
  19. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts +7 -0
  20. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.d.ts.map +1 -0
  21. package/lib/exercises/math/arithmetic/solveDiophantianEquationByUsingPrimality.js +117 -0
  22. package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts +8 -0
  23. package/lib/exercises/math/arithmetic/whichDayInXDays.d.ts.map +1 -0
  24. package/lib/exercises/math/arithmetic/whichDayInXDays.js +82 -0
  25. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts +15 -0
  26. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.d.ts.map +1 -0
  27. package/lib/exercises/math/calcul/fractions/fractionsSumFillInTheBlank.js +256 -0
  28. package/lib/exercises/math/calcul/fractions/index.d.ts +1 -0
  29. package/lib/exercises/math/calcul/fractions/index.d.ts.map +1 -1
  30. package/lib/exercises/math/calcul/fractions/index.js +1 -0
  31. package/lib/exercises/math/calcul/index.d.ts +1 -0
  32. package/lib/exercises/math/calcul/index.d.ts.map +1 -1
  33. package/lib/exercises/math/calcul/index.js +1 -0
  34. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts +3 -0
  35. package/lib/exercises/math/calcul/mentalCaluls/index.d.ts.map +1 -1
  36. package/lib/exercises/math/calcul/mentalCaluls/index.js +3 -0
  37. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts +10 -0
  38. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.d.ts.map +1 -0
  39. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication101AndFriends.js +264 -0
  40. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts +10 -0
  41. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.d.ts.map +1 -0
  42. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplication11AndFriends.js +264 -0
  43. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts +11 -0
  44. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.d.ts.map +1 -0
  45. package/lib/exercises/math/calcul/mentalCaluls/mentalMultiplicationTable.js +141 -0
  46. package/lib/exercises/math/calcul/ratio/index.d.ts +1 -0
  47. package/lib/exercises/math/calcul/ratio/index.d.ts.map +1 -1
  48. package/lib/exercises/math/calcul/ratio/index.js +1 -0
  49. package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts +13 -0
  50. package/lib/exercises/math/calcul/ratio/partsUsingRatio.d.ts.map +1 -0
  51. package/lib/exercises/math/calcul/ratio/partsUsingRatio.js +237 -0
  52. package/lib/exercises/math/calcul/relatives/index.d.ts +2 -0
  53. package/lib/exercises/math/calcul/relatives/index.d.ts.map +1 -0
  54. package/lib/exercises/math/calcul/relatives/index.js +1 -0
  55. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts +17 -0
  56. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.d.ts.map +1 -0
  57. package/lib/exercises/math/calcul/relatives/relativesAddAndSub.js +448 -0
  58. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts +10 -0
  59. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.d.ts.map +1 -0
  60. package/lib/exercises/math/calculLitteral/factorisation/factoByXK.js +190 -0
  61. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts +1 -0
  62. package/lib/exercises/math/calculLitteral/factorisation/index.d.ts.map +1 -1
  63. package/lib/exercises/math/calculLitteral/factorisation/index.js +1 -0
  64. package/lib/exercises/math/complex/algebraic/addComplex.d.ts +10 -0
  65. package/lib/exercises/math/complex/algebraic/addComplex.d.ts.map +1 -0
  66. package/lib/exercises/math/complex/algebraic/addComplex.js +125 -0
  67. package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts +8 -0
  68. package/lib/exercises/math/complex/algebraic/conjugateComplex.d.ts.map +1 -0
  69. package/lib/exercises/math/complex/algebraic/conjugateComplex.js +105 -0
  70. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts +8 -0
  71. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.d.ts.map +1 -0
  72. package/lib/exercises/math/complex/algebraic/conjugateDivideComplex.js +137 -0
  73. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts +8 -0
  74. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.d.ts.map +1 -0
  75. package/lib/exercises/math/complex/algebraic/conjugateMultiplyComplex.js +116 -0
  76. package/lib/exercises/math/complex/algebraic/divideComplex.d.ts +8 -0
  77. package/lib/exercises/math/complex/algebraic/divideComplex.d.ts.map +1 -0
  78. package/lib/exercises/math/complex/algebraic/divideComplex.js +128 -0
  79. package/lib/exercises/math/complex/algebraic/index.d.ts +11 -0
  80. package/lib/exercises/math/complex/algebraic/index.d.ts.map +1 -0
  81. package/lib/exercises/math/complex/algebraic/index.js +10 -0
  82. package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts +8 -0
  83. package/lib/exercises/math/complex/algebraic/inverseComplex.d.ts.map +1 -0
  84. package/lib/exercises/math/complex/algebraic/inverseComplex.js +95 -0
  85. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts +10 -0
  86. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.d.ts.map +1 -0
  87. package/lib/exercises/math/complex/algebraic/linearCombinaisonComplex.js +105 -0
  88. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts +8 -0
  89. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.d.ts.map +1 -0
  90. package/lib/exercises/math/complex/algebraic/moduloFromAlgebraicComplex.js +93 -0
  91. package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts +8 -0
  92. package/lib/exercises/math/complex/algebraic/mutiplyComplex.d.ts.map +1 -0
  93. package/lib/exercises/math/complex/algebraic/mutiplyComplex.js +106 -0
  94. package/lib/exercises/math/complex/algebraic/reAndIm.d.ts +9 -0
  95. package/lib/exercises/math/complex/algebraic/reAndIm.d.ts.map +1 -0
  96. package/lib/exercises/math/complex/algebraic/reAndIm.js +92 -0
  97. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts +9 -0
  98. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.d.ts.map +1 -0
  99. package/lib/exercises/math/complex/geometric/complexAlgebraicFromModuloAndArg.js +151 -0
  100. package/lib/exercises/math/complex/geometric/complexDistance.d.ts +11 -0
  101. package/lib/exercises/math/complex/geometric/complexDistance.d.ts.map +1 -0
  102. package/lib/exercises/math/complex/geometric/complexDistance.js +125 -0
  103. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts +9 -0
  104. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.d.ts.map +1 -0
  105. package/lib/exercises/math/complex/geometric/complexGeomAffixAlgFromPoint.js +326 -0
  106. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts +10 -0
  107. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.d.ts.map +1 -0
  108. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromCenteredRegularPolygon.js +459 -0
  109. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts +14 -0
  110. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.d.ts.map +1 -0
  111. package/lib/exercises/math/complex/geometric/complexGeomAffixExpFromPoint.js +539 -0
  112. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts +13 -0
  113. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.d.ts.map +1 -0
  114. package/lib/exercises/math/complex/geometric/complexGeomAffixTrigFromPoint.js +485 -0
  115. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts +12 -0
  116. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.d.ts.map +1 -0
  117. package/lib/exercises/math/complex/geometric/complexGeomApproxOfCosArgOrSinArgFromPointAndAffixTrig.js +224 -0
  118. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts +11 -0
  119. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.d.ts.map +1 -0
  120. package/lib/exercises/math/complex/geometric/complexGeomArgumentOfFracCBABFromFigure.js +448 -0
  121. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts +11 -0
  122. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.d.ts.map +1 -0
  123. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromAffixExp.js +223 -0
  124. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts +11 -0
  125. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.d.ts.map +1 -0
  126. package/lib/exercises/math/complex/geometric/complexGeomFindPointFromPowerOfUnitRootFromFigure.js +348 -0
  127. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts +8 -0
  128. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.d.ts.map +1 -0
  129. package/lib/exercises/math/complex/geometric/complexGeomPlaceAffixPoint.js +86 -0
  130. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts +11 -0
  131. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.d.ts.map +1 -0
  132. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZAPlusZ.js +311 -0
  133. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts +11 -0
  134. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.d.ts.map +1 -0
  135. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATimesZ.js +345 -0
  136. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts +16 -0
  137. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.d.ts.map +1 -0
  138. package/lib/exercises/math/complex/geometric/complexGeomPlacePointFromZATransformed.js +729 -0
  139. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts +11 -0
  140. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.d.ts.map +1 -0
  141. package/lib/exercises/math/complex/geometric/complexGeomPlacePointWithAffixInU.js +253 -0
  142. package/lib/exercises/math/complex/geometric/index.d.ts +12 -0
  143. package/lib/exercises/math/complex/geometric/index.d.ts.map +1 -0
  144. package/lib/exercises/math/complex/geometric/index.js +19 -0
  145. package/lib/exercises/math/complex/index.d.ts +4 -10
  146. package/lib/exercises/math/complex/index.d.ts.map +1 -1
  147. package/lib/exercises/math/complex/index.js +4 -11
  148. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts +10 -0
  149. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.d.ts.map +1 -0
  150. package/lib/exercises/math/complex/polynomials/factorizePolynomialInC.js +176 -0
  151. package/lib/exercises/math/complex/polynomials/index.d.ts +4 -0
  152. package/lib/exercises/math/complex/polynomials/index.d.ts.map +1 -0
  153. package/lib/exercises/math/complex/polynomials/index.js +3 -0
  154. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts +10 -0
  155. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.d.ts.map +1 -0
  156. package/lib/exercises/math/complex/polynomials/solveSecondDegreeInComplex.js +190 -0
  157. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts +11 -0
  158. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.d.ts.map +1 -0
  159. package/lib/exercises/math/complex/polynomials/solveZSquareEqualsA.js +158 -0
  160. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts +7 -0
  161. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.d.ts.map +1 -0
  162. package/lib/exercises/math/complex/unitRoots/giveNUnitRoot.js +122 -0
  163. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts +8 -0
  164. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.d.ts.map +1 -0
  165. package/lib/exercises/math/complex/unitRoots/giveOneSolutionToComplexPowNEqualsOne.js +138 -0
  166. package/lib/exercises/math/complex/unitRoots/index.d.ts +3 -0
  167. package/lib/exercises/math/complex/unitRoots/index.d.ts.map +1 -0
  168. package/lib/exercises/math/complex/unitRoots/index.js +2 -0
  169. package/lib/exercises/math/conversion/clock/clockReading.d.ts +12 -0
  170. package/lib/exercises/math/conversion/clock/clockReading.d.ts.map +1 -0
  171. package/lib/exercises/math/conversion/clock/clockReading.js +385 -0
  172. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts +2 -0
  173. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.d.ts.map +1 -0
  174. package/lib/exercises/math/conversion/clock/clockReadingPlusTimeOperation.js +521 -0
  175. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts +2 -0
  176. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.d.ts.map +1 -0
  177. package/lib/exercises/math/conversion/clock/clockWritingByManipulatingNeedles.js +359 -0
  178. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts +16 -0
  179. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.d.ts.map +1 -0
  180. package/lib/exercises/math/conversion/clock/dateTimeOperationAdd.js +319 -0
  181. package/lib/exercises/math/conversion/clock/index.d.ts +2 -0
  182. package/lib/exercises/math/conversion/clock/index.d.ts.map +1 -0
  183. package/lib/exercises/math/conversion/clock/index.js +4 -0
  184. package/lib/exercises/math/conversion/index.d.ts +1 -0
  185. package/lib/exercises/math/conversion/index.d.ts.map +1 -1
  186. package/lib/exercises/math/conversion/index.js +1 -0
  187. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts +11 -0
  188. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.d.ts.map +1 -0
  189. package/lib/exercises/math/geometry/angles/angleNatureFromFigure.js +233 -0
  190. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts +10 -0
  191. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.d.ts.map +1 -0
  192. package/lib/exercises/math/geometry/angles/angleNatureFromMeasure.js +137 -0
  193. package/lib/exercises/math/geometry/angles/index.d.ts +2 -0
  194. package/lib/exercises/math/geometry/angles/index.d.ts.map +1 -1
  195. package/lib/exercises/math/geometry/angles/index.js +2 -0
  196. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts +9 -0
  197. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.d.ts.map +1 -0
  198. package/lib/exercises/math/geometry/circles/buildCircleFromRadius.js +187 -0
  199. package/lib/exercises/math/geometry/circles/index.d.ts +1 -0
  200. package/lib/exercises/math/geometry/circles/index.d.ts.map +1 -1
  201. package/lib/exercises/math/geometry/circles/index.js +1 -0
  202. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts +11 -0
  203. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.d.ts.map +1 -0
  204. package/lib/exercises/math/geometry/lines/buildParallelFromLineAndPoint.js +154 -0
  205. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts +11 -0
  206. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.d.ts.map +1 -0
  207. package/lib/exercises/math/geometry/lines/buildPerpendicularFromLineAndPoint.js +157 -0
  208. package/lib/exercises/math/geometry/lines/index.d.ts +2 -0
  209. package/lib/exercises/math/geometry/lines/index.d.ts.map +1 -1
  210. package/lib/exercises/math/geometry/lines/index.js +2 -0
  211. package/lib/exercises/math/geometry/triangles/index.d.ts +2 -0
  212. package/lib/exercises/math/geometry/triangles/index.d.ts.map +1 -1
  213. package/lib/exercises/math/geometry/triangles/index.js +2 -1
  214. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts +13 -0
  215. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.d.ts.map +1 -0
  216. package/lib/exercises/math/geometry/triangles/traceHeightInTriangle.js +271 -0
  217. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts +8 -0
  218. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.d.ts.map +1 -1
  219. package/lib/exercises/math/geometry/triangles/traceMedianInTriangle.js +284 -53
  220. package/lib/exercises/math/geometry/vectors/constructions/index.d.ts +1 -0
  221. package/lib/exercises/math/geometry/vectors/constructions/index.d.ts.map +1 -1
  222. package/lib/exercises/math/geometry/vectors/constructions/index.js +1 -0
  223. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts +8 -0
  224. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.d.ts.map +1 -0
  225. package/lib/exercises/math/geometry/vectors/constructions/traceVectorSumFromVecs.js +165 -0
  226. package/lib/exercises/math/geometry/volumes/index.d.ts +1 -0
  227. package/lib/exercises/math/geometry/volumes/index.d.ts.map +1 -1
  228. package/lib/exercises/math/geometry/volumes/index.js +1 -0
  229. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts +8 -0
  230. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.d.ts.map +1 -0
  231. package/lib/exercises/math/geometry/volumes/volumeOfCylinder.js +157 -0
  232. package/lib/exercises/math/graphs/adjacentMatrixPath.d.ts +10 -0
  233. package/lib/exercises/math/graphs/adjacentMatrixPath.d.ts.map +1 -0
  234. package/lib/exercises/math/graphs/adjacentMatrixPath.js +89 -0
  235. package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.d.ts +7 -0
  236. package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.d.ts.map +1 -0
  237. package/lib/exercises/math/graphs/edgesNumberFromSummitsDegrees.js +98 -0
  238. package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.d.ts +8 -0
  239. package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.d.ts.map +1 -0
  240. package/lib/exercises/math/graphs/eulerianChainFromAdjacentMatrix.js +96 -0
  241. package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.d.ts +15 -0
  242. package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.d.ts.map +1 -0
  243. package/lib/exercises/math/graphs/graphsChainOrPathOfLengthN.js +262 -0
  244. package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.d.ts +11 -0
  245. package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.d.ts.map +1 -0
  246. package/lib/exercises/math/graphs/graphsCheckIsConnectedUndirectedGraph.js +178 -0
  247. package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts +19 -0
  248. package/lib/exercises/math/graphs/graphsCheckIsSameGraph.d.ts.map +1 -0
  249. package/lib/exercises/math/graphs/graphsCheckIsSameGraph.js +301 -0
  250. package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.d.ts +16 -0
  251. package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.d.ts.map +1 -0
  252. package/lib/exercises/math/graphs/graphsCheckIsVerticesAdjacent.js +207 -0
  253. package/lib/exercises/math/graphs/graphsDegreeOfVertex.d.ts +15 -0
  254. package/lib/exercises/math/graphs/graphsDegreeOfVertex.d.ts.map +1 -0
  255. package/lib/exercises/math/graphs/graphsDegreeOfVertex.js +232 -0
  256. package/lib/exercises/math/graphs/graphsOrderOfGraph.d.ts +14 -0
  257. package/lib/exercises/math/graphs/graphsOrderOfGraph.d.ts.map +1 -0
  258. package/lib/exercises/math/graphs/graphsOrderOfGraph.js +222 -0
  259. package/lib/exercises/math/graphs/index.d.ts +10 -0
  260. package/lib/exercises/math/graphs/index.d.ts.map +1 -0
  261. package/lib/exercises/math/graphs/index.js +9 -0
  262. package/lib/exercises/math/index.d.ts +1 -0
  263. package/lib/exercises/math/index.d.ts.map +1 -1
  264. package/lib/exercises/math/index.js +1 -0
  265. package/lib/exercises/math/matrices/areMatricesInverse.d.ts +9 -0
  266. package/lib/exercises/math/matrices/areMatricesInverse.d.ts.map +1 -0
  267. package/lib/exercises/math/matrices/areMatricesInverse.js +106 -0
  268. package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.d.ts +9 -0
  269. package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.d.ts.map +1 -0
  270. package/lib/exercises/math/matrices/computeFixedMatrixInRecurrenceSequence.js +144 -0
  271. package/lib/exercises/math/matrices/findInversedMatrixFromSystem.d.ts +8 -0
  272. package/lib/exercises/math/matrices/findInversedMatrixFromSystem.d.ts.map +1 -0
  273. package/lib/exercises/math/matrices/findInversedMatrixFromSystem.js +148 -0
  274. package/lib/exercises/math/matrices/index.d.ts +12 -0
  275. package/lib/exercises/math/matrices/index.d.ts.map +1 -1
  276. package/lib/exercises/math/matrices/index.js +12 -0
  277. package/lib/exercises/math/matrices/isMatrixTransitionMatrix.d.ts +8 -0
  278. package/lib/exercises/math/matrices/isMatrixTransitionMatrix.d.ts.map +1 -0
  279. package/lib/exercises/math/matrices/isMatrixTransitionMatrix.js +132 -0
  280. package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.d.ts +8 -0
  281. package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.d.ts.map +1 -0
  282. package/lib/exercises/math/matrices/matrixBuildMatrixFromCoefficients.js +152 -0
  283. package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.d.ts +8 -0
  284. package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.d.ts.map +1 -0
  285. package/lib/exercises/math/matrices/matrixCheckIsSymmetrical.js +155 -0
  286. package/lib/exercises/math/matrices/matrixComputeDetOfMat2.d.ts +8 -0
  287. package/lib/exercises/math/matrices/matrixComputeDetOfMat2.d.ts.map +1 -0
  288. package/lib/exercises/math/matrices/matrixComputeDetOfMat2.js +142 -0
  289. package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.d.ts +8 -0
  290. package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.d.ts.map +1 -0
  291. package/lib/exercises/math/matrices/matrixComputeInverseOfMat2.js +237 -0
  292. package/lib/exercises/math/matrices/matrixComputeLinearCombination.d.ts +15 -0
  293. package/lib/exercises/math/matrices/matrixComputeLinearCombination.d.ts.map +1 -0
  294. package/lib/exercises/math/matrices/matrixComputeLinearCombination.js +232 -0
  295. package/lib/exercises/math/matrices/matrixComputePower.d.ts +12 -0
  296. package/lib/exercises/math/matrices/matrixComputePower.d.ts.map +1 -0
  297. package/lib/exercises/math/matrices/matrixComputePower.js +230 -0
  298. package/lib/exercises/math/matrices/matrixComputeProduct.d.ts +9 -0
  299. package/lib/exercises/math/matrices/matrixComputeProduct.d.ts.map +1 -0
  300. package/lib/exercises/math/matrices/matrixComputeProduct.js +178 -0
  301. package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.d.ts +8 -0
  302. package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.d.ts.map +1 -0
  303. package/lib/exercises/math/matrices/writeMatrixAssociatedToSystem.js +105 -0
  304. package/lib/exercises/math/spaceGeometry/basis/index.d.ts +1 -0
  305. package/lib/exercises/math/spaceGeometry/basis/index.d.ts.map +1 -1
  306. package/lib/exercises/math/spaceGeometry/basis/index.js +1 -0
  307. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts +18 -0
  308. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.d.ts.map +1 -0
  309. package/lib/exercises/math/spaceGeometry/basis/spaceSegmentLengthInRectangularPrism.js +538 -0
  310. package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.d.ts.map +1 -1
  311. package/lib/exercises/math/trigonometry/formulas/trigoAdditionFormulaUsage.js +6 -5
  312. package/lib/exercises/math/trigonometry/triangle/trigonometrySohcahtoaCalcul.js +1 -1
  313. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts +1 -0
  314. package/lib/exercises/utils/geogebra/toolBarConstructor.d.ts.map +1 -1
  315. package/lib/exercises/utils/geogebra/toolBarConstructor.js +2 -0
  316. package/lib/exercises/vea/matrixVEA.d.ts +2 -0
  317. package/lib/exercises/vea/matrixVEA.d.ts.map +1 -0
  318. package/lib/exercises/vea/matrixVEA.js +1 -0
  319. package/lib/geogebra/parsers/geogebraParser.d.ts +3 -0
  320. package/lib/geogebra/parsers/geogebraParser.d.ts.map +1 -1
  321. package/lib/geogebra/parsers/geogebraParser.js +27 -0
  322. package/lib/index.d.ts +286 -23
  323. package/lib/index.d.ts.map +1 -1
  324. package/lib/latexTester.js +2 -0
  325. package/lib/math/geometry/angle.d.ts.map +1 -1
  326. package/lib/math/geometry/angle.js +3 -0
  327. package/lib/math/geometry/point.d.ts.map +1 -1
  328. package/lib/math/geometry/point.js +3 -1
  329. package/lib/math/geometry/segment.d.ts +1 -1
  330. package/lib/math/geometry/segment.d.ts.map +1 -1
  331. package/lib/math/geometry/segment.js +5 -2
  332. package/lib/math/graphs/graph.d.ts +43 -0
  333. package/lib/math/graphs/graph.d.ts.map +1 -0
  334. package/lib/math/graphs/graph.js +391 -0
  335. package/lib/math/matrices/matrix.d.ts +42 -3
  336. package/lib/math/matrices/matrix.d.ts.map +1 -1
  337. package/lib/math/matrices/matrix.js +173 -7
  338. package/lib/math/matrices/parseMatrix.d.ts +3 -0
  339. package/lib/math/matrices/parseMatrix.d.ts.map +1 -0
  340. package/lib/math/matrices/parseMatrix.js +22 -0
  341. package/lib/math/systems/generalSystem.d.ts +2 -0
  342. package/lib/math/systems/generalSystem.d.ts.map +1 -1
  343. package/lib/math/systems/generalSystem.js +5 -0
  344. package/lib/math/utils/geometry/angleBetweenPoints.d.ts +4 -0
  345. package/lib/math/utils/geometry/angleBetweenPoints.d.ts.map +1 -0
  346. package/lib/math/utils/geometry/angleBetweenPoints.js +58 -0
  347. package/lib/math/utils/geometry/angleNWSE.d.ts +3 -0
  348. package/lib/math/utils/geometry/angleNWSE.d.ts.map +1 -0
  349. package/lib/math/utils/geometry/angleNWSE.js +56 -0
  350. package/lib/math/utils/graphs/graphRenderer.d.ts +25 -0
  351. package/lib/math/utils/graphs/graphRenderer.d.ts.map +1 -0
  352. package/lib/math/utils/graphs/graphRenderer.js +123 -0
  353. package/lib/playground.d.ts +6 -1
  354. package/lib/playground.d.ts.map +1 -1
  355. package/lib/playground.js +6 -5
  356. package/lib/tests/singleExo.test.d.ts.map +1 -1
  357. package/lib/tests/singleExo.test.js +2 -2
  358. package/lib/tree/parsers/latexParser.d.ts +1 -1
  359. package/lib/tree/utilities/nodeSimplifier.d.ts +1 -1
  360. package/lib/types/keyIds.d.ts +2 -0
  361. package/lib/types/keyIds.d.ts.map +1 -1
  362. package/lib/utils/arrays/arrayChunks.d.ts +9 -0
  363. package/lib/utils/arrays/arrayChunks.d.ts.map +1 -0
  364. package/lib/utils/arrays/arrayChunks.js +34 -0
  365. package/lib/utils/strings/frenchDays.d.ts +2 -0
  366. package/lib/utils/strings/frenchDays.d.ts.map +1 -0
  367. package/lib/utils/strings/frenchDays.js +9 -0
  368. package/lib/utils/strings/ordinalSuffixed.d.ts +2 -0
  369. package/lib/utils/strings/ordinalSuffixed.d.ts.map +1 -0
  370. package/lib/utils/strings/ordinalSuffixed.js +5 -0
  371. package/package.json +7 -1
@@ -0,0 +1,144 @@
1
+ import { addValidProp, shuffleProps, tryToAddWrongProp, propWhile, } from "../../../exercises/exercise.js";
2
+ import { getDistinctQuestions } from "../../../exercises/utils/getDistinctQuestions.js";
3
+ import { rationalVEA } from "../../../exercises/vea/rationalVEA.js";
4
+ import { Vector, VectorConstructor } from "../../../math/geometry/vector.js";
5
+ import { MatrixConstructor, } from "../../../math/matrices/matrix.js";
6
+ import { binom, isBinomialCoefficientNode, } from "../../../tree/nodes/operators/binomialCoefficientNode.js";
7
+ import { parseAlgebraic } from "../../../tree/parsers/latexParser.js";
8
+ import { handleVEAError } from "../../../utils/errors/handleVEAError.js";
9
+ import { alignTex } from "../../../utils/latex/alignTex.js";
10
+ const getPropositions = (n, { answer }) => {
11
+ const propositions = [];
12
+ addValidProp(propositions, answer);
13
+ propWhile(propositions, n, () => {
14
+ tryToAddWrongProp(propositions, VectorConstructor.random("u").toBinomCoords().toTex());
15
+ });
16
+ return shuffleProps(propositions, n);
17
+ };
18
+ const getAnswer = (identifiers) => {
19
+ //u = (I-A)^(-1) * b
20
+ const { aIds, bIds } = identifiers;
21
+ const a = MatrixConstructor.fromIdentifiers(aIds);
22
+ const b = MatrixConstructor.fromIdentifiers(bIds);
23
+ const id = MatrixConstructor.identity(2);
24
+ const sub = id.substract(a).simplify();
25
+ const inv = sub.toInversed().simplify();
26
+ const u = inv.matrixProduct(b).simplify();
27
+ const vec = binom(u.elements[0][0], u.elements[1][0]);
28
+ return vec.toTex();
29
+ };
30
+ const getInstruction = (identifiers) => {
31
+ const { aIds, bIds } = identifiers;
32
+ const a = MatrixConstructor.fromIdentifiers(aIds);
33
+ const b = MatrixConstructor.fromIdentifiers(bIds);
34
+ return `Soient :
35
+
36
+ $$
37
+ A=${a.toTex()}, B=${b.toTex()}
38
+ $$
39
+
40
+ Déterminer une matrice colonne $U$ tel que :
41
+
42
+ $$
43
+ U = AU+B
44
+ $$
45
+ `;
46
+ };
47
+ const getHint = () => {
48
+ return `Isole $U$ d'un côté de l'équation. Puis, utilise la calculatrice pour déterminer l'inverse d'une certaine matrice.`;
49
+ };
50
+ const getCorrection = (identifiers) => {
51
+ const { aIds, bIds } = identifiers;
52
+ const a = MatrixConstructor.fromIdentifiers(aIds);
53
+ const b = MatrixConstructor.fromIdentifiers(bIds);
54
+ const id = MatrixConstructor.identity(2);
55
+ const iMinusA = id.substract(a);
56
+ const inv = iMinusA.toInversed().simplify();
57
+ return `On a :
58
+
59
+ ${alignTex([
60
+ ["U=AU+B", "\\iff", "U-AU=B"],
61
+ ["", "\\iff", "(I_2-A)U=B"],
62
+ ])}
63
+
64
+ donc $U = (I_2-A)^{-1}B$.
65
+
66
+ Or,
67
+
68
+ $$
69
+ I_2-A = ${iMinusA.toTex()} = ${iMinusA.simplify().toTex()}
70
+ $$
71
+
72
+ Avec la calculatrice, ou en résolvant un système d'équations, on trouve :
73
+
74
+ $$
75
+ (I_2-A)^{-1} = ${inv.toTex()}
76
+ $$
77
+
78
+ et donc
79
+
80
+ $$
81
+ U = ${inv.toTex()}${b.toTex()} = ${getAnswer(identifiers)}
82
+ $$
83
+ `;
84
+ };
85
+ const getKeys = () => {
86
+ return ["binom"];
87
+ };
88
+ const isAnswerValid = (ans, { answer }) => {
89
+ try {
90
+ const sol = parseAlgebraic(answer);
91
+ const solVector = new Vector("u", sol.leftChild, sol.rightChild);
92
+ const parsed = parseAlgebraic(ans);
93
+ if (!isBinomialCoefficientNode(parsed))
94
+ return false;
95
+ const vec = new Vector("u", parsed.leftChild, parsed.rightChild).simplify();
96
+ return (rationalVEA(solVector.x.toTex(), vec.x.toTex()) &&
97
+ rationalVEA(solVector.y.toTex(), vec.y.toTex()));
98
+ }
99
+ catch (err) {
100
+ return handleVEAError(err);
101
+ }
102
+ };
103
+ const getComputeFixedMatrixInRecurrenceSequenceQuestion = () => {
104
+ const iMinusA = MatrixConstructor.randomInversible(2, 2, {
105
+ niceInversible: true,
106
+ });
107
+ const id = MatrixConstructor.identity(2);
108
+ const a = id.substract(iMinusA).simplify();
109
+ const b = MatrixConstructor.random(2, 1);
110
+ const identifiers = {
111
+ aIds: a.toIdentifiers(),
112
+ bIds: b.toIdentifiers(),
113
+ };
114
+ return getQuestionFromIdentifiers(identifiers);
115
+ };
116
+ const getQuestionFromIdentifiers = (identifiers) => {
117
+ return {
118
+ answer: getAnswer(identifiers),
119
+ instruction: getInstruction(identifiers),
120
+ keys: getKeys(identifiers),
121
+ answerFormat: "tex",
122
+ identifiers,
123
+ hint: getHint(identifiers),
124
+ correction: getCorrection(identifiers),
125
+ };
126
+ };
127
+ export const computeFixedMatrixInRecurrenceSequence = {
128
+ id: "computeFixedMatrixInRecurrenceSequence",
129
+ connector: "=",
130
+ label: "Déterminer une matrice $U$ tel que $U = AU+B$",
131
+ isSingleStep: true,
132
+ generator: (nb, opts) => getDistinctQuestions(() => getComputeFixedMatrixInRecurrenceSequenceQuestion(opts), nb),
133
+ qcmTimer: 60,
134
+ freeTimer: 60,
135
+ getPropositions,
136
+ isAnswerValid,
137
+ subject: "Mathématiques",
138
+ getInstruction,
139
+ getHint,
140
+ getCorrection,
141
+ getAnswer,
142
+ getQuestionFromIdentifiers,
143
+ hasHintAndCorrection: true,
144
+ };
@@ -0,0 +1,8 @@
1
+ import { Exercise } from "../../../exercises/exercise.js";
2
+ import { GeneralSystemIdentifiers } from "../../../math/systems/generalSystem.js";
3
+ type Identifiers = {
4
+ systemIds: GeneralSystemIdentifiers;
5
+ };
6
+ export declare const findInversedMatrixFromSystem: Exercise<Identifiers>;
7
+ export {};
8
+ //# sourceMappingURL=findInversedMatrixFromSystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findInversedMatrixFromSystem.d.ts","sourceRoot":"","sources":["../../../../src/exercises/math/matrices/findInversedMatrixFromSystem.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAeT,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAGL,wBAAwB,EACzB,MAAM,qCAAqC,CAAC;AAG7C,KAAK,WAAW,GAAG;IACjB,SAAS,EAAE,wBAAwB,CAAC;CACrC,CAAC;AA0IF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,WAAW,CAsB9D,CAAC"}
@@ -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"}