{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Summary\n\nA linear Diophantine equation in two unknowns is an equation $a x + b y = c$ with given integers $a$, $b$ and $c$.\nIts solutions are the pairs of integers $(x, y)$ that satisfy it.\nWhen $a$ and $b$ are not both $0$, the equation has an integer solution if and only if $\\gcd(a, b)$ divides $c$.\nIn this case, let $d = \\gcd(a, b)$ and let $(x_0, y_0)$ be one solution. Then the solutions are the pairs $(x_0 + k b / d, \\; y_0 - k a / d)$ with $k$ an integer.\n\n## Remarks\n\n[[Bézout's identity|0DQVHMYAGA]] gives the existence of a solution, and the [[extended Euclidean algorithm|0964YQFSA8]] computes one.\nFor example, $6 x + 10 y = 7$ has no integer solution, because $\\gcd(6, 10) = 2$ does not divide $7$.\nThe equation is a special case of a [[Diophantine equation|08B1RTW7VZ]].\n\n## Explanations\n\n### L1 human\n\nAsk whether you can pay $c$ with coins of value $a$ and $b$, when you can also get coins back as change.\nEach amount that you can pay is a multiple of $\\gcd(a, b)$, and each such multiple is possible.\nFor example, $3 x + 5 y = 1$ has the solution $x = 2$, $y = -1$.\n",
  "commit": "4da93a4f525f10adcd3643fb06f785669846f797",
  "front": {
    "inventory": [
      "MT1PQTZ5T3"
    ],
    "kind": "concept",
    "msc": [
      "11D04"
    ],
    "name": "Linear Diophantine equation",
    "sources": [
      {
        "locator": "Linear Diophantine equations",
        "url": "https://en.wikipedia.org/wiki/Diophantine_equation"
      }
    ],
    "specializes": [
      "08B1RTW7VZ"
    ],
    "tag": "0R9GF3JD0K"
  },
  "kind": "concept",
  "link": "https://math2.tamnd.com/node/0R9GF3JD0K/",
  "links": [
    {
      "field": "specializes",
      "target": "08B1RTW7VZ"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0R9GF3JD0K.md",
  "msc": [
    "11D04"
  ],
  "name": "Linear Diophantine equation",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0R9/0R9GF3JD0K.md",
  "status": null,
  "tag": "0R9GF3JD0K",
  "uri": "m2://0R9GF3JD0K",
  "url": "https://math2.tamnd.com/wiki/linear-diophantine-equation/",
  "writing": {
    "tag": "0R9GF3JD0K",
    "kind": "concept",
    "level": "W1",
    "next": [
      {
        "what": "edge defines in",
        "note": "at least one definition",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge instance_of in",
        "note": "at least two examples",
        "have": 0,
        "want": 2
      },
      {
        "what": "edge not_instance_of in",
        "note": "at least one non-example",
        "have": 0,
        "want": 1
      }
    ]
  }
}
