Skip to content
BetterDL

Commutative law

Also called: commutative, commutativity, commutative laws, commutative property

The Boolean laws A + B = B + A and AB = BA: the order of the inputs to an OR or an AND makes no difference.

The commutative law says order does not matter:

  • =
  • =

It matches everyday sense: "armed AND door open" means the same as "door open AND armed". In a circuit, swapping the two input wires of an AND or OR gate does not change its output.

You use it constantly without naming it, mostly to line terms up so you can see a pattern. After multiplying out, you might get , and it helps to rewrite it as so it sits next to for combining.

Convention: write literals in alphabetical order inside a term (, not ). That makes it easy to spot duplicates and pairs.

The law holds for XOR too, = . There is no Boolean subtraction or division to worry about.

Worked example

Example

Reordering to spot a pair

Simplify .

  1. 1.

    Commutative: write as .

  2. 2.

    Now differs only in B.

  3. 3.

    Factor: = = .

  4. 4.

    Result: .

Common mistakes

  • Confusing commutative with associative. Commutative is about order (A + B vs B + A); associative is about grouping ((A + B) + C vs A + (B + C)).

  • Overlooking that two terms are the same because their letters are in a different order, such as and .

Practice Commutative law

Interactive questions with instant feedback and a worked solution for every wrong answer.

Boolean Algebra lesson

Learn it step by step

Commutative law is taught in Boolean Algebra.