Your textbook tells you addition and multiplication are commutative; subtraction and division are not. You memorised that fact for the test. Three years later a new operation shows up — modular exponentiation, matrix multiplication, function composition — and you have no idea if it commutes. You go back to the textbook. Wrong move. There is a one-second test you can run on any operation, without looking anything up.

The test

Take any two concrete inputs. Apply the operation one way. Apply it the other way. Compare.

a \star b \stackrel{?}{=} b \star a

If the two answers disagree for even one pair (a, b), the operation is not commutative. Full stop. One counter-example is enough to kill commutativity forever — no amount of agreeing pairs can resurrect it.

If the two answers agree for every pair you can think of, the operation is probably commutative (and if you want to be sure, you prove it abstractly). But the quick, no-memory version of the rule is: swap and compare.

Subtraction and division fail instantly

Try subtraction with a = 5, b = 3:

5 - 3 = 2 \qquad 3 - 5 = -2

Different. Subtraction is not commutative. Done — you did not have to remember, you computed.

Try division with a = 8, b = 2:

8 \div 2 = 4 \qquad 2 \div 8 = 0.25

Different. Division is not commutative. Done.

Addition with a = 5, b = 3:

5 + 3 = 8 \qquad 3 + 5 = 8

Same. One pair is not a proof that addition commutes, but it is evidence consistent with the commutative rule. Try more pairs — they always agree. For addition on reals, the agreement is universal, and we call it commutative.

The swap test on four operationsA table with four rows. Each row shows one operation tested on the same inputs five and three. Addition: five plus three equals eight, three plus five equals eight — match, commutative. Multiplication: five times three equals fifteen, three times five equals fifteen — match, commutative. Subtraction: five minus three equals two, three minus five equals negative two — mismatch, not commutative. Division: five divided by three is approximately one point six six, three divided by five is zero point six — mismatch, not commutative. operation a ⋆ b b ⋆ a verdict + 5 + 3 = 8 3 + 5 = 8 match ✓ × 5 × 3 = 15 3 × 5 = 15 match ✓ 5 − 3 = 2 3 − 5 = −2 mismatch ✗ ÷ 5 ÷ 3 ≈ 1.67 3 ÷ 5 = 0.6 mismatch ✗ one mismatched pair is enough to prove "not commutative"
Four operations, the same two inputs, four swap tests. Addition and multiplication pass — at least on this pair. Subtraction and division fail on the first pair you try. The asymmetry is not subtle; it announces itself immediately.

Why one counter-example suffices

The statement "operation \star is commutative" is a universal claim: it says a \star b = b \star a for every pair of inputs in the set. A universal claim is refuted by a single exception. If even one specific pair gives different answers, the universal statement is false. This is why mathematicians sometimes call commutative-ness a "forall" property — it lives or dies on the worst single pair in the entire set.

Agreement, by contrast, is not a proof. Finding 5 + 3 = 3 + 5 does not prove addition commutes on all reals — it only proves it commutes for that one pair. The proof of commutativity for real addition comes from the Peano axioms and builds up through induction; the swap test is a quick check, not a substitute. But the swap test is more than enough to spot non-commutativity, and that is what you usually need to do in practice.

Try it: swap and watch

Interactive swap test on addition versus subtractionA horizontal number line from negative ten to ten with two draggable red points labelled a and b. Four readouts above the line show the results of four operations: a plus b, b plus a, a minus b, b minus a. As the reader drags the points, the first two always agree (addition commutes) and the last two agree only when a and b are equal (subtraction does not commute). −10 0 10 ↔ drag either point
Drag the two points. $a + b$ and $b + a$ agree for every position — addition is commutative. $a - b$ and $b - a$ agree only at the single moment when $a = b$ (and are zero there); everywhere else they are opposite-sign mirrors. Subtraction fails the swap test on a full "half" of the configuration space.

The test works on any operation

The swap test is not about arithmetic — it is about commutativity. Apply it to any operation you care about.

In every case above, you did not look anything up. You picked two concrete inputs, ran the operation both ways, and compared. Commutativity is decided by computation.

Why: commutativity is a universal statement — "for all a, b." Testing two concrete inputs is the fastest way to falsify such a statement. If the test passes on a few pairs, you have weak evidence for commutativity but no proof. If it fails on even one pair, the universal claim dies on the spot.

When the swap test accidentally passes

There is one subtle trap. Sometimes an operation appears commutative on specific pairs while actually failing in general. For example, in matrix multiplication, the identity matrix I commutes with every matrix: AI = IA = A. If you happened to pick B = I for your test, the swap would succeed, and you might wrongly conclude matrix multiplication commutes. The fix is to pick generic inputs — two matrices with no special structure. The trap is unusual in practice but worth knowing: when your first test pair passes, try a different pair before declaring commutativity.

For subtraction, there is a similar edge case: if you pick a = b, then a - b = b - a = 0. Not a counter-example. So pick a \neq b and the test bites immediately.

Why this matters for JEE

JEE Advanced loves to test whether a student has internalised which operations commute. Questions appear where you have to swap operators in matrix equations, function compositions, or modular arithmetic — and if you forget which commute, you will swap illegally and get the wrong answer. The swap test is your portable no-memory check: whenever you are about to swap two operands, pause for one second, pick a concrete pair, and verify.

Related: Operations and Properties · Commutative, Associative, Distributive — Three Laws as Three Rearrangements · Swap the Order of a Subtraction and Watch It Land Somewhere Else · Is Subtraction Just 'Adding a Negative' — or Is It Its Own Operation?