{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Summary\n\nA linear congruence is a [[congruence|0TPW25CBN6]] $a x \\equiv b \\pmod n$, with given integers $a$ and $b$ and a positive integer $n$.\nIts solutions are the integers $x$ that satisfy it.\nLet $d = \\gcd(a, n)$. The congruence has a solution if and only if $d \\mid b$.\nIn this case, the solutions form exactly $d$ residue classes modulo $n$, and one residue class modulo $n / d$.\n\n## Remarks\n\nWhen $\\gcd(a, n) = 1$, the unique solution modulo $n$ is $x \\equiv a^{-1} b \\pmod n$, where $a^{-1}$ is the [[modular multiplicative inverse|00GXTQMY8Z]] of $a$.\nThe congruence $a x \\equiv b \\pmod n$ is the same as the [[linear Diophantine equation|0R9GF3JD0K]] $a x - n y = b$.\nFor example, $6 x \\equiv 4 \\pmod{10}$ has $d = 2$. Its solutions are $x \\equiv 4 \\pmod 5$, that is, $x \\equiv 4$ or $x \\equiv 9 \\pmod{10}$.\n\n## Explanations\n\n### L1 human\n\nA linear congruence is a linear equation in modular arithmetic.\nTo solve $2 x \\equiv 3 \\pmod 5$, find the inverse $3$ of $2$ modulo $5$, and multiply: $x \\equiv 9 \\equiv 4 \\pmod 5$.\nCheck: $2 \\cdot 4 = 8 \\equiv 3 \\pmod 5$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "kind": "concept",
    "msc": [
      "11A07"
    ],
    "name": "Linear congruence",
    "sources": [
      {
        "locator": "Advanced properties",
        "url": "https://en.wikipedia.org/wiki/Modular_arithmetic"
      }
    ],
    "tag": "0PTVNH4GPS"
  },
  "kind": "concept",
  "link": "https://math2.tamnd.com/node/0PTVNH4GPS/",
  "links": null,
  "markdown": "https://math2.tamnd.com/node/0PTVNH4GPS.md",
  "msc": [
    "11A07"
  ],
  "name": "Linear congruence",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0PT/0PTVNH4GPS.md",
  "status": null,
  "tag": "0PTVNH4GPS",
  "uri": "m2://0PTVNH4GPS",
  "url": "https://math2.tamnd.com/wiki/linear-congruence/",
  "writing": {
    "tag": "0PTVNH4GPS",
    "kind": "concept",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
