katex -> mathjax
[exercicis-automatics-matematiques.git] / ng-exercicis.py
blob5af55bfef9b5bc1b4796cc6783fd3b6004bb09d4
1 # SPDX-FileCopyrightText: 2024 Xavier Bordoy
3 # SPDX-License-Identifier: GPL-3.0-or-later
5 - token: "1"
6 title: "Equacions de primer grau senzilles"
7 category: "equacions-grau-1"
8 description: "ax+b=c, a, b, c estrictament positius i menors o iguals que 20"
9 pre: |
10 a = random.randrange(1, 20)
11 b = random.randrange(1, 20)
12 c = random.randrange(1, 20)
13 solucio = fractions.Fraction(c-b,a)
14 text: "Resoleu: ${{a}} x + {{b}} = {{c}}$"
15 solution: |
16 La solució és $({{c}}-{{b}})/{{a}}$, és a dir, ${{ c-b }}/{{ a }}$, que simplificat és $ {{solucio.numerator}}/{{solucio.denominator }}$.
17 resolution: |
18 Tenim que ${{a}}x + {{b}} = {{c}}$, per tant, ${{a}}x = {{c}} - {{b}}$ $\Rightarrow$ $x = \frac{ {{c}} -{{b}} }{ {{a}} }$ $\Rightarrow$ $x = \frac{ {{c - b}} }{ {{a}} }$, que simplificat és $x = \frac{ {{solucio.numerator}} }{ {{solucio.denominator}} }$.
19 - token: "2"
20 title: "Equacions de primer grau senzilles"
21 category: "equacions-grau-1"
22 description: "ax-b=c, a, b, c estrictament positius i menors o iguals que 20"
23 pre: |
24 a = random.randrange(1, 20)
25 b = random.randrange(1, 20)
26 c = random.randrange(1, 20)
27 solucio = fractions.Fraction(c+b,a)
28 text: "Resoleu: ${{a}} x - {{b}} = {{c}}$"
29 solution: |
30 La solució és $({{c}}+{{b}})/{{a}}$, és a dir, ${{ c+b }}/{{a}}$, que simplificat és ${{solucio.numerator}}/{{solucio.denominator}}$.
31 resolution: |
32 Tenim que ${{a}}x - {{b}} = {{c}}$, per tant, ${{a}}x = {{c}} + {{b}}$ $\Rightarrow$ $x = \frac{ {{c}} + {{b}} }{ {{a}} }$ $\Rightarrow$ $x = \frac{ {{c + b}} }{ {{a}} }$, que simplificat és $x = \frac{ {{solucio.numerator}} }{ {{solucio.denominator}} }$.