{
  "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": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "kind": "concept",
    "msc": [
      "11D04"
    ],
    "name": "Linear Diophantine equation",
    "sources": [
      {
        "locator": "Linear Diophantine equations",
        "url": "https://en.wikipedia.org/wiki/Diophantine_equation"
      }
    ],
    "tag": "0R9GF3JD0K"
  },
  "kind": "concept",
  "link": "https://math2.tamnd.com/node/0R9GF3JD0K/",
  "links": null,
  "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": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
