math-exercises 3.0.208 → 3.0.209

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 (73) hide show
  1. package/lib/exercises/math/arithmetic/congruenceBasicComputation.d.ts +8 -0
  2. package/lib/exercises/math/arithmetic/congruenceBasicComputation.d.ts.map +1 -0
  3. package/lib/exercises/math/arithmetic/congruenceBasicComputation.js +93 -0
  4. package/lib/exercises/math/arithmetic/index.d.ts +2 -0
  5. package/lib/exercises/math/arithmetic/index.d.ts.map +1 -0
  6. package/lib/exercises/math/arithmetic/index.js +1 -0
  7. package/lib/exercises/math/functions/affines/adjustment/affineAdjustment.d.ts.map +1 -1
  8. package/lib/exercises/math/functions/affines/adjustment/affineAdjustment.js +15 -0
  9. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.d.ts.map +1 -1
  10. package/lib/exercises/math/functions/affines/adjustment/affineAdjustmentRsquared.js +15 -0
  11. package/lib/exercises/math/functions/logarithm/log10Simplifying.d.ts.map +1 -1
  12. package/lib/exercises/math/functions/logarithm/log10Simplifying.js +72 -33
  13. package/lib/exercises/math/functions/logarithm/logEquation.d.ts.map +1 -1
  14. package/lib/exercises/math/functions/logarithm/logEquation.js +40 -2
  15. package/lib/exercises/math/functions/logarithm/logPowerEquation.d.ts.map +1 -1
  16. package/lib/exercises/math/functions/logarithm/logPowerEquation.js +55 -6
  17. package/lib/exercises/math/functions/logarithm/logSimplifiying.d.ts.map +1 -1
  18. package/lib/exercises/math/functions/logarithm/logSimplifiying.js +45 -5
  19. package/lib/exercises/math/index.d.ts +1 -0
  20. package/lib/exercises/math/index.d.ts.map +1 -1
  21. package/lib/exercises/math/index.js +1 -0
  22. package/lib/exercises/math/probaStat/density/findParamToMakeDensity.d.ts +8 -0
  23. package/lib/exercises/math/probaStat/density/findParamToMakeDensity.d.ts.map +1 -0
  24. package/lib/exercises/math/probaStat/density/findParamToMakeDensity.js +127 -0
  25. package/lib/exercises/math/probaStat/density/index.d.ts +2 -0
  26. package/lib/exercises/math/probaStat/density/index.d.ts.map +1 -0
  27. package/lib/exercises/math/probaStat/density/index.js +1 -0
  28. package/lib/exercises/math/probaStat/exponential/exponentialLawAverage.d.ts +7 -0
  29. package/lib/exercises/math/probaStat/exponential/exponentialLawAverage.d.ts.map +1 -0
  30. package/lib/exercises/math/probaStat/exponential/exponentialLawAverage.js +95 -0
  31. package/lib/exercises/math/probaStat/exponential/exponentialLawComputeIntervalProba.d.ts +9 -0
  32. package/lib/exercises/math/probaStat/exponential/exponentialLawComputeIntervalProba.d.ts.map +1 -0
  33. package/lib/exercises/math/probaStat/exponential/exponentialLawComputeIntervalProba.js +115 -0
  34. package/lib/exercises/math/probaStat/exponential/exponentialLawComputeProba.d.ts +8 -0
  35. package/lib/exercises/math/probaStat/exponential/exponentialLawComputeProba.d.ts.map +1 -0
  36. package/lib/exercises/math/probaStat/exponential/exponentialLawComputeProba.js +110 -0
  37. package/lib/exercises/math/probaStat/exponential/index.d.ts +4 -0
  38. package/lib/exercises/math/probaStat/exponential/index.d.ts.map +1 -0
  39. package/lib/exercises/math/probaStat/exponential/index.js +3 -0
  40. package/lib/exercises/math/probaStat/geometric/geometricLawAverage.d.ts +8 -0
  41. package/lib/exercises/math/probaStat/geometric/geometricLawAverage.d.ts.map +1 -0
  42. package/lib/exercises/math/probaStat/geometric/geometricLawAverage.js +124 -0
  43. package/lib/exercises/math/probaStat/geometric/geometricLawComputeProba.d.ts +9 -0
  44. package/lib/exercises/math/probaStat/geometric/geometricLawComputeProba.d.ts.map +1 -0
  45. package/lib/exercises/math/probaStat/geometric/geometricLawComputeProba.js +121 -0
  46. package/lib/exercises/math/probaStat/geometric/index.d.ts +3 -0
  47. package/lib/exercises/math/probaStat/geometric/index.d.ts.map +1 -0
  48. package/lib/exercises/math/probaStat/geometric/index.js +2 -0
  49. package/lib/exercises/math/probaStat/index.d.ts +4 -0
  50. package/lib/exercises/math/probaStat/index.d.ts.map +1 -1
  51. package/lib/exercises/math/probaStat/index.js +4 -0
  52. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.d.ts.map +1 -1
  53. package/lib/exercises/math/probaStat/stats2var/fineAdjustementExercise.js +15 -0
  54. package/lib/exercises/math/probaStat/uniform/index.d.ts +3 -0
  55. package/lib/exercises/math/probaStat/uniform/index.d.ts.map +1 -0
  56. package/lib/exercises/math/probaStat/uniform/index.js +2 -0
  57. package/lib/exercises/math/probaStat/uniform/uniformAverage.d.ts +8 -0
  58. package/lib/exercises/math/probaStat/uniform/uniformAverage.d.ts.map +1 -0
  59. package/lib/exercises/math/probaStat/uniform/uniformAverage.js +100 -0
  60. package/lib/exercises/math/probaStat/uniform/uniformLawComputeProba.d.ts +10 -0
  61. package/lib/exercises/math/probaStat/uniform/uniformLawComputeProba.d.ts.map +1 -0
  62. package/lib/exercises/math/probaStat/uniform/uniformLawComputeProba.js +105 -0
  63. package/lib/index.d.ts +29 -1
  64. package/lib/index.d.ts.map +1 -1
  65. package/lib/latexTester.js +1 -0
  66. package/lib/tests/pdfs/formatMdToLatex.js +1 -1
  67. package/lib/tree/nodes/functions/log10Node.d.ts +1 -0
  68. package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
  69. package/lib/tree/nodes/functions/log10Node.js +12 -1
  70. package/lib/tree/nodes/functions/logNode.d.ts +1 -0
  71. package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
  72. package/lib/tree/nodes/functions/logNode.js +12 -1
  73. package/package.json +1 -1
@@ -272,4 +272,5 @@ const validCmds = [
272
272
  "\\mapsto",
273
273
  "\\color",
274
274
  "\\wedge",
275
+ "\\equiv",
275
276
  ];
@@ -2,7 +2,7 @@ import { mdCodeToLatex } from "./mdCodeToLatex.js";
2
2
  import { mdTableToLatexTabular } from "./mdTableToLatexTabular.js";
3
3
  export const formatMarkdownToLatex = (text) => {
4
4
  const format = text
5
- .replaceAll("\\left\\{", "\\left\\lbrace")
5
+ // .replaceAll("\\left\\{", "\\left\\lbrace")
6
6
  .replaceAll("\\\\", "\\tabularnewline ")
7
7
  .replaceAll("€", "\\euro");
8
8
  return mdCodeToLatex(mdTableToLatexTabular(format));
@@ -2,6 +2,7 @@ import { Node, NodeIds, NodeOptions, NodeType } from "../node.js";
2
2
  import { FunctionNode, FunctionsIds } from "./functionNode.js";
3
3
  import { AlgebraicNode } from "../algebraicNode.js";
4
4
  export declare function isLog10Node(a: Node): a is Log10Node;
5
+ export declare const log10: (a: AlgebraicNode | number | string) => Log10Node;
5
6
  export declare class Log10Node implements FunctionNode {
6
7
  id: FunctionsIds;
7
8
  child: AlgebraicNode;
@@ -1 +1 @@
1
- {"version":3,"file":"log10Node.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/log10Node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAE/E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMpD,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,SAAS,CAEnD;AACD,qBAAa,SAAU,YAAW,YAAY;IAC5C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAGtB,mBAAmB,IAAI,MAAM;IAG7B,KAAK,IAAI,MAAM;IAaf,iBAAiB,IAAI,aAAa,EAAE;IAQpC,mBAAmB;IAOnB,cAAc,IAAI,MAAM,EAAE;IAG1B,QAAQ,IAAI,aAAa;IAiCzB,QAAQ,CAAC,IAAI,CAAC,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AM,CAAC,MAAM,EAAE,aAAa,CAAC;IAGxD,UAAU,IAAI,aAAa;CAG5B"}
@@ -10,6 +10,10 @@ import { maxPowerDecomposition } from "../../../math/utils/arithmetic/maxPowerDe
10
10
  export function isLog10Node(a) {
11
11
  return isFunctionNode(a) && a.id === FunctionsIds.log10;
12
12
  }
13
+ export const log10 = (a) => {
14
+ const nodeA = typeof a === "number" ? a.toTree() : typeof a === "string" ? a.toTree() : a;
15
+ return new Log10Node(nodeA);
16
+ };
13
17
  export class Log10Node {
14
18
  id;
15
19
  child;
@@ -33,7 +37,14 @@ export class Log10Node {
33
37
  return `log_{10}(${this.child.toMathString()})`;
34
38
  }
35
39
  toSimplificationTex() {
36
- throw new Error("unimplemented");
40
+ const simplified = this.simplify();
41
+ const thisTex = this.toTex();
42
+ const simpTex = simplified.toTex();
43
+ const isSimplified = thisTex === simpTex;
44
+ if (isSimplified)
45
+ return thisTex;
46
+ else
47
+ return `${thisTex} = ${simpTex}`;
37
48
  }
38
49
  toTex() {
39
50
  const tex = this.child.toTex();
@@ -2,6 +2,7 @@ import { Node, NodeIds, NodeOptions, NodeType } from "../node.js";
2
2
  import { FunctionNode, FunctionsIds } from "./functionNode.js";
3
3
  import { AlgebraicNode, SimplifyOptions } from "../algebraicNode.js";
4
4
  export declare function isLogNode(a: Node): a is LogNode;
5
+ export declare const logn: (a: AlgebraicNode | number | string) => LogNode;
5
6
  export declare class LogNode implements FunctionNode {
6
7
  id: FunctionsIds;
7
8
  child: AlgebraicNode;
@@ -1 +1 @@
1
- {"version":3,"file":"logNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/functions/logNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAkB,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,qBA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YAItD,CAAC;AAEF,qBAAa,OAAQ,YAAW,YAAY;IAC1C,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;IAOpD,aAAa;;;;;;IAMb,YAAY,IAAI,MAAM;IAGtB,mBAAmB;IAQnB,KAAK,IAAI,MAAM;IAaf,iBAAiB,IAAI,aAAa,EAAE;IAQpC,mBAAmB;IAOnB,cAAc,IAAI,MAAM,EAAE;IAG1B,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,aAAa;IAoC/C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGtC,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;IAGpC,oBAAoB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC;IAGxD,UAAU,IAAI,aAAa;CAG5B"}
@@ -11,6 +11,10 @@ import { frac } from "../operators/fractionNode.js";
11
11
  export function isLogNode(a) {
12
12
  return isFunctionNode(a) && a.id === FunctionsIds.log;
13
13
  }
14
+ export const logn = (a) => {
15
+ const nodeA = typeof a === "number" ? a.toTree() : typeof a === "string" ? a.toTree() : a;
16
+ return new LogNode(nodeA);
17
+ };
14
18
  export class LogNode {
15
19
  id;
16
20
  child;
@@ -34,7 +38,14 @@ export class LogNode {
34
38
  return `log(${this.child.toMathString()})`;
35
39
  }
36
40
  toSimplificationTex() {
37
- throw new Error("unimplemented");
41
+ const simplified = this.simplify();
42
+ const thisTex = this.toTex();
43
+ const simpTex = simplified.toTex();
44
+ const isSimplified = thisTex === simpTex;
45
+ if (isSimplified)
46
+ return thisTex;
47
+ else
48
+ return `${thisTex} = ${simpTex}`;
38
49
  }
39
50
  toTex() {
40
51
  const tex = this.child.toTex();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "math-exercises",
3
3
  "type": "module",
4
- "version": "3.0.208",
4
+ "version": "3.0.209",
5
5
  "description": "Math exercises generator for middle school and high school",
6
6
  "main": "lib/index.js",
7
7
  "files": [