{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Counterexample\n\nLet $A = \\begin{pmatrix} 0 \u0026 1 \\\\ 0 \u0026 0 \\end{pmatrix}$ and $B = \\begin{pmatrix} 0 \u0026 0 \\\\ 1 \u0026 0 \\end{pmatrix}$, as real $2 \\times 2$ matrices.\nThen\n$$AB = \\begin{pmatrix} 1 \u0026 0 \\\\ 0 \u0026 0 \\end{pmatrix}, \\qquad BA = \\begin{pmatrix} 0 \u0026 0 \\\\ 0 \u0026 1 \\end{pmatrix}.$$\nThus $AB \\ne BA$.\nThis shows that [[matrix multiplication|032Q9FB8MT]] of $n \\times n$ matrices is not commutative for $n = 2$.\n\n## Remarks\n\nThe same example, extended with zero rows and zero columns, shows that $M_n(R)$ is not commutative for each $n \\ge 2$ and each nonzero ring $R$.\nTwo matrices $A$ and $B$ with $AB = BA$ are said to *commute*.\nSome pairs commute, for example a matrix and the [[identity matrix|06DW9BAWB1]], or two [[diagonal matrices|044JNC7ZAA]].\n\n## Explanations\n\n### L1 human\n\nFor numbers, $2 \\cdot 3 = 3 \\cdot 2$, but for matrices the order of the factors matters.\nHere $AB$ and $BA$ are different matrices.\nA reason is that $AB$ means \"first apply $B$, then $A$\", and two actions done in a different order can give different results.\n",
  "commit": "f591989ed15704e9d8755a7a5a6426d73de7a3ae",
  "front": {
    "kind": "counterexample",
    "msc": [
      "15A27"
    ],
    "name": "Non-commutativity of matrix multiplication",
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Commuting_matrices"
      }
    ],
    "tag": "0P506SPZP2",
    "uses": [
      "076JGP6R3T"
    ]
  },
  "kind": "counterexample",
  "link": "https://math2.tamnd.com/node/0P506SPZP2/",
  "links": [
    {
      "field": "uses",
      "target": "076JGP6R3T"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/0P506SPZP2.md",
  "msc": [
    "15A27"
  ],
  "name": "Non-commutativity of matrix multiplication",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0P5/0P506SPZP2.md",
  "status": null,
  "tag": "0P506SPZP2",
  "uri": "m2://0P506SPZP2",
  "url": "https://math2.tamnd.com/wiki/non-commutativity-of-matrix-multiplication/",
  "writing": {
    "tag": "0P506SPZP2",
    "kind": "counterexample",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge refutes or not_instance_of out",
        "have": 0,
        "want": 1
      }
    ]
  }
}
