---
tag: 9W6KMR96R9
kind: definition
name: Commuting probability
msc: [20D60, 20P05]
defines: 4MBYAVB0PY
uses: [0B85S2V2DR, 0DEBXAJ5SA, 02YYV36BFM]
sources:
  - url: https://en.wikipedia.org/wiki/Commuting_probability
---

## Definition

Let $G$ be a finite [[group|G5S1M9]].
The *commuting probability* of $G$ is
$$\mathrm{cp}(G) = \frac{\abs{\set{(x, y) \in G \times G : xy = yx}}}{\abs{G}^2}.$$

## Remarks

Counting the pairs by their first entry gives $\mathrm{cp}(G) = \frac{1}{\abs{G}^2} \sum_{x \in G} \abs{C_G(x)}$, where $C_G(x)$ is the [[centraliser|02YYV36BFM]] of $x$.
Since the [[conjugacy class|0DEBXAJ5SA]] of $x$ has $\abs{G}/\abs{C_G(x)}$ elements, this sum gives $\mathrm{cp}(G) = k(G)/\abs{G}$, where $k(G)$ is the number of conjugacy classes of $G$.
Example: $S_3$ has $3$ conjugacy classes, so $\mathrm{cp}(S_3) = 3/6 = 1/2$.
Example: the [[quaternion group|0NRJGW864D]] $Q_8$ has $5$ conjugacy classes, $\{1\}$, $\{-1\}$, $\{\pm i\}$, $\{\pm j\}$, $\{\pm k\}$, so $\mathrm{cp}(Q_8) = 5/8$.
The value $\mathrm{cp}(G) = 1$ holds exactly when $G$ is [[abelian|082GHNPJ53]]; if $G$ is not abelian, then $\mathrm{cp}(G) \le 5/8$.

## Explanations

### L1 human

The commuting probability is the chance that two random elements of the group commute.
