What would you call a function that is incorrect 99.999999% of the time? Broken?

Let’s take a look: what happens if you multiply two (unsigned) 4-bit numbers?

×0000000100100011010001010110011110001001101010111100110111101111
00000000000000000000000000000000000000000000000000000000000000000000
00010000000100100011010001010110011110001001101010111100110111101111
001000000010010001101000101011001110NONONONONONONONO
0011000000110110100111001111NONONONONONONONONONO
01000000010010001100NONONONONONONONONONONONO
01010000010110101111NONONONONONONONONONONONO
0110000001101100NONONONONONONONONONONONONO
0111000001111110NONONONONONONONONONONONONO
100000001000NONONONONONONONONONONONONONO
100100001001NONONONONONONONONONONONONONO
101000001010NONONONONONONONONONONONONONO
101100001011NONONONONONONONONONONONONONO
110000001100NONONONONONONONONONONONONONO
110100001101NONONONONONONONONONONONONONO
111000001110NONONONONONONONONONONONONONO
111100001111NONONONONONONONONONONONONONO
  • All numbers multiplied by zero or one are okay.
  • If we multiply by 2, half the numbers are incorrect.
  • If we multiply by 3, two-thirds of the numbers are incorrect.
  • If we multiply by 4, three-quarters of the numbers are incorrect.
  • etc

So for four-bit numbers, out of 256 possible combinations, 180 results are incorrect, and 76 results are correct. This makes the result incorrect about 70% of the time.

But: it gets much, much worse the more bits your numbers have. The possible value space increases dramatically, but the same results as above apply: when multiplying by two, half are incorrect, etc, etc. This means that when we use longer numbers, there are more incorrect results:

LengthPossible resultsIncorrect resultsPercentage incorrect
425618070%
8655366356897%
164294967296429409926899.98%
32184467440737095520001844674396919091611099.999999%

Thus, 32-bit multiplication is incorrect 99.999999% of the time.

The next fun thing to consider is why computers seem to be able to multiply, despite not being able to.