Skip to content

Multiplication can be undone

Level: 101 → 201 · for anyone who has multiplied out (a + b)(c + d)

One line: The obvious way to multiply pairs, entry by entry, lets two nonzero pairs multiply to (0, 0), and after that nothing can be divided; the complex rule never does, so every pair in ℂ* = ℂ \ {(0, 0)} has a reciprocal, and that is why the rule is this one.

The obvious rule, and what it breaks

Multiplication as pairs writes down the complex rule, (x₁, y₁)(x₂, y₂) = (x₁x₂ − y₁y₂, x₁y₂ + x₂y₁), and shows what it produces. It leaves one question open: why that rule? Pairs are added entry by entry, so the obvious guess for multiplying them is entry by entry too:

(x₁, y₁)(x₂, y₂) = (x₁x₂, y₁y₂)

That is a legitimate operation, and it fails in two ways. Section 1 of the program shows the first: entry by entry, a square is (x², y²), and neither entry can be negative, so there is no square root of −1. The new numbers could do nothing the old ones could not.

The second failure is worse, and it is the subject of this page. Entry by entry,

(1, 0)(0, 1) = (0, 0)

Two pairs, neither of them zero, multiply to zero.

What the program prints

Verified output of multiplication_can_be_undone.py — regenerated by tools/run_examples.py, never hand-typed.

1. THE OBVIOUS RULE: MULTIPLY ENTRY BY ENTRY
   entry by entry:    (x1, y1)(x2, y2) = (x1 x2, y1 y2)
   the complex rule:  (x1, y1)(x2, y2) = (x1 x2 - y1 y2, x1 y2 + x2 y1)
   Test values: G = {-2, -1, -1/2, 0, 1/3, 1, 3/2}, making 49 test pairs (x, y).

   Entry by entry, z z = (x^2, y^2), on all 49 test pairs: True
                                                 entry by entry   the complex rule
     pairs z with z z = (-1, 0)                  0                2
   Neither entry of (x^2, y^2) can be negative, so the obvious rule has no
   square root of -1. The complex rule has two: (0, -1), (0, 1)

2. TWO NONZERO PAIRS, PRODUCT ZERO
   entry by entry:    (1, 0)(0, 1) = (0, 0)
   the complex rule:  (1, 0)(0, 1) = (0, 1)
                                                 entry by entry   the complex rule
     pairs of nonzero z, w with z w = (0, 0)     72               0
   A nonzero pair that multiplies some other nonzero pair to (0, 0) is a ZERO DIVISOR.
   Entry by entry, (1, 0) is one, and it can never be divided by:
     (1, 0)(0, 1) = (0, 0) = (1, 0)(0, 0), so dividing both sides by (1, 0)
     would make (0, 1) = (0, 0).
   Entry by entry the 1 is (1, 1): z (1, 1) = z for all 49 test pairs: True
   and (1, 0) w is (w_x, 0), never (1, 1): no test pair w solves (1, 0) w = (1, 1): True

3. WHY THE COMPLEX RULE NEVER DOES THAT
     (x1^2 + y1^2)(x2^2 + y2^2) = (x1 x2 - y1 y2)^2 + (x1 y2 + x2 y1)^2
   checked on all 2,401 products of test pairs: True
   If neither factor is (0, 0), the left side is positive, so the product is not (0, 0).

4. C* = C \ {(0, 0)}: THE PAIRS YOU CAN DIVIDE BY
   The backslash is set difference: C* is every pair except (0, 0).
   Of the 49 test pairs, C* keeps 48.
   (1, 0) is the 1 of C:  z (1, 0) = z for all 49 test pairs: True
   Every z = (x, y) in C* has a reciprocal:  1/z = (x / (x^2 + y^2), -y / (x^2 + y^2))
     z          x^2 + y^2   1/z               z (1/z)
     (0, 1)     1           (0, -1)           (1, 0)
     (1, 1)     2           (1/2, -1/2)       (1, 0)
     (3, -4)    25          (3/25, 4/25)      (1, 0)
     (-5, 6)    61          (-5/61, -6/61)    (1, 0)
   z (1/z) = (1, 0) for all 48 test pairs in C*: True
   (0, 0) has no reciprocal: (0, 0) w = (0, 0) for all 49 test pairs w, never (1, 0): True
   Division z / w means z (1/w), for w in C*, and it undoes multiplication:
     (z w)(1/w) = z for all 49 x 48 = 2,352 choices of z and w: True

5. PRACTICE, SOLVED
   Kata 1. The book's two examples (Andreescu and Andrica, section 1.1.1)
     z1 = (-5, 6),  z2 = (1, -2)
       z1 + z2 = (-5 + 1, 6 + (-2)) = (-4, 4)
       first entry:   x1 x2 - y1 y2 = (-5)(1) - (6)(-2) = -5 - (-12) = 7
       second entry:  x1 y2 + x2 y1 = (-5)(-2) + (1)(6) = 10 + 6 = 16
       z1 z2 = (7, 16)      the book: (-4, 4) and (7, 16)   same: True
     z1 = (-1/2, 1),  z2 = (-1/3, 1/2)
       z1 + z2 = (-1/2 + (-1/3), 1 + 1/2) = (-5/6, 3/2)
       first entry:   x1 x2 - y1 y2 = (-1/2)(-1/3) - (1)(1/2) = 1/6 - 1/2 = -1/3
       second entry:  x1 y2 + x2 y1 = (-1/2)(1/2) + (-1/3)(1) = -1/4 + (-1/3) = -7/12
       z1 z2 = (-1/3, -7/12)      the book: (-5/6, 3/2) and (-1/3, -7/12)   same: True

   Kata 2. Every (x, y) with (x, y)(x, y) = (-1, 0)
     (x, y)(x, y) = (x^2 - y^2, 2xy), so  x^2 - y^2 = -1  and  2xy = 0.
     2xy = 0 means x = 0 or y = 0. y = 0 needs x^2 = -1: impossible. x = 0 needs y^2 = 1.
     Exactly two: (0, -1) and (0, 1). Among the 49 test pairs the search finds: (0, -1), (0, 1)

   Kata 3. Find z with z (1, 2) = (5, 0)
     z = (x, y) gives (x - 2y, 2x + y) = (5, 0): x - 2y = 5 and 2x + y = 0, so z = (1, -2).
     Or divide: z = (5, 0)(1 / (1, 2)) = (5, 0)(1/5, -2/5) = (1, -2)
     check: (1, -2)(1, 2) = (5, 0): True
     z (0, 0) = (5, 0) has no solution: z (0, 0) = (0, 0) for every z.
     No test pair solves it: True

Zero divisors end division

A nonzero number that multiplies some other nonzero number to zero is called a zero divisor. Among the 48 nonzero test pairs, entry-by-entry multiplication has 72 products that come out as (0, 0). The complex rule has none (section 2).

A zero divisor can never be divided by. Suppose you could divide by (1, 0). Both (1, 0)(0, 1) and (1, 0)(0, 0) equal (0, 0), so dividing both by (1, 0) would give (0, 1) = (0, 0), which is false. So entry by entry, (1, 0) has no reciprocal. Section 2 confirms it directly: the entry-by-entry 1 is (1, 1), and (1, 0) times any pair w is (w's first entry, 0), which is never (1, 1).

Why the complex rule never does that

(x₁² + y₁²)(x₂² + y₂²) = (x₁x₂ − y₁y₂)² + (x₁y₂ + x₂y₁)²

Multiply out both sides and they agree term for term. On the right, the cross terms −2x₁x₂y₁y₂ and +2x₁x₂y₁y₂ cancel. If neither factor is (0, 0), the left side is a product of two positive numbers. So the right side is positive, and the product is not (0, 0). Section 3 checks the identity on all 2,401 products of test pairs, and the algebra is why it holds for every pair.

This is the Brahmagupta–Fibonacci identity, which Diophantus already knew in the third century. Multiplication rotates reads the same identity as lengths multiply: the distance of a product from (0, 0) is the product of the two distances. Two nonzero lengths cannot multiply to zero.

ℂ*: the pairs you can divide by

Andreescu and Andrica's Complex Numbers from A to … Z defines ℂ in its §1.1.1 and names one subset in the same breath:

The notation ℂ* is used to indicate the set ℂ \ {(0, 0)}.

The backslash is set difference: A \ B is everything in A that is not in B. The braces around (0, 0) are needed because set difference removes a set, here the set whose only member is (0, 0). The star is a common convention, though not a universal one, for "with 0 removed"; ℝ* means ℝ \ {0} in the same way.

The book singles out ℂ because it is exactly the set of pairs you can divide by. The pair (1, 0) is the 1 of ℂ, and every z = (x, y) in ℂ has a reciprocal, the formula lesson 1 derives:

1/z = ( x / (x² + y²),  −y / (x² + y²) )

The denominator x² + y² is the quantity from the identity above, and it is zero only at (0, 0). (0, 0) has no reciprocal at all, because (0, 0) times anything is (0, 0) and never (1, 0). Section 4 checks both on the test pairs, and then checks that division undoes multiplication: (zw) · (1/w) = z for all 2,352 choices of z and a nonzero w. That is the sense of this page's title. Multiplying by any w in ℂ* can be reversed, and the entry-by-entry product cannot promise that for (1, 0), (0, 1) or any other pair with a zero entry.

Practice

Kata 1 — the book's two examples. Andreescu and Andrica work these right after the definition. Compute z₁ + z₂ and z₁z₂ for z₁ = (−5, 6), z₂ = (1, −2), and for z₁ = (−1/2, 1), z₂ = (−1/3, 1/2).

Solution

Section 5 runs both, term by term. The one place to go slowly is the minus sign in the first entry. In the first example y₁y₂ = (6)(−2) = −12, and subtracting −12 adds 12:

first entry:   x₁x₂ − y₁y₂ = (−5)(1) − (6)(−2)  = −5 − (−12) = 7
second entry:  x₁y₂ + x₂y₁ = (−5)(−2) + (1)(6)  = 10 + 6     = 16

The book writes this as (−5 + 12, 10 + 6) = (7, 16), and the sum is (−4, 4). The second example gives (−5/6, 3/2) and (−1/3, −7/12). The program uses exact fractions, so both answers are checked for equality with the book's, not for closeness.

Kata 2 — every square root of −1. Find all pairs (x, y) with (x, y)(x, y) = (−1, 0).

Solution

(x, y)(x, y) = (x² − y², 2xy). Two pairs are equal only when both entries match, so this one equation between pairs is two equations between reals: x² − y² = −1 and 2xy = 0. The second says x = 0 or y = 0. If y = 0, the first needs x² = −1, which no real x satisfies. If x = 0, it needs y² = 1, so y = 1 or y = −1. That leaves exactly two pairs, (0, 1) and (0, −1). Section 5 finds those two among the test pairs; the algebra is why there are no others.

Kata 3 — division. Find z with z · (1, 2) = (5, 0). Then try z · (0, 0) = (5, 0).

Solution

Put z = (x, y). Then z · (1, 2) = (x − 2y, 2x + y), so x − 2y = 5 and 2x + y = 0. The second gives y = −2x, and the first becomes 5x = 5, so z = (1, −2). The shortcut is to divide, which means multiplying (5, 0) by 1/(1, 2) = (1/5, −2/5). Section 5 does both and gets the same answer. The second equation has no solution, because z · (0, 0) is (0, 0) whatever z is. That is the whole reason ℂ* leaves (0, 0) out.

Run it yourself

From the root of your clone of this repository:

python3 03_Complex_Numbers/multiplication_can_be_undone/examples/multiplication_can_be_undone.py

Further reading

  • Titu Andreescu and Dorin Andrica, Complex Numbers from A to … Z, 2nd edition, Birkhäuser 2014 (doi:10.1007/978-0-8176-8415-0 ↗). §1.1.1 "Definition of Complex Numbers" gives the pair definition, the two worked examples in kata 1, and ℂ*.

Auf Deutsch: Stichwörter

Jedes Paar außer (0, 0) hat ein Inverses; Division ist Multiplikation mit dem Konjugierten geteilt durch den Betrag im Quadrat.

Stichwörter: Inverses, Division, konjugiert komplexe Zahl, Betrag, Umkehrung, Nullteilerfreiheit.

See also