Is there a reason that the binary byte sequence $2^{10n}$ and decimal byte sequence $10^{3n}$ are so closely related?

74 Views Asked by At

Computer storage is measured in decimal (base 10) or binary (base 2) notations of bytes.

IMB Spectrum - Data Storage Values

Series

Name Symbol Value (base-10) Name Symbol Value (base-2)
kilo K $10^{3}$ kibi Ki $2^{10}$
mega M $10^{6}$ mebi Mi $2^{20}$
giga G $10^{9}$ gibi Gi $2^{30}$
tera T $10^{12}$ tebi Ti $2^{40}$
peta P $10^{15}$ pebi Pi $2^{50}$
exa E $10^{18}$ exbi Ei $2^{60}$

Value comparisons

Decimal value Binary value Percentage difference
100 kilobytes (KB) 97.65 kibibytes (KiB) 2.35%
100 megabytes (MB) 95.36 mebibytes (MiB) 4.64%
100 gigabytes (GB) 93.13 gibibytes (GiB) 6.87%
100 terabytes (TB) 90.94 tebibytes (TiB) 9.06%
100 petabytes (PB) 88.81 pebibytes (PiB) 11.19%
100 exabytes (EB) 86.73 exbibytes (EiB) 13.27%

The values are surprisingly close for the exponents used. Maybe I'm lacking an intuitive foundation for exponents, but it seems coincidental that these two exponential sequences are so close. Is there a relationship here I'm not seeing?

2

There are 2 best solutions below

3
On

Because $2^{10}=1024$ and $10^3=1000$.

These are only $2.4\%$ apart.

This numeric coincidence (for that is all it is) has been taken advantage of in the naming of values.

4
On

It's a coincidence, related to the fact that $\frac{\log 2}{\log 10} \approx 0.30103$ is really close to a rational number ($\frac{3}{10}$).


But out of curiosity, what if we didn't have a base-ten number system? Which power of the base would be close to a power of two? So, I did the math. For each number base between 3 and 36 (except powers of 2, because those are obvious), I found the minimum power of two that's within 5% of a power of the base. And here are the results:

$3^{12} \approx 2^{19}$; $5^{3} \approx 2^{7}$; $6^{12} \approx 2^{31}$; $7^{5} \approx 2^{14}$; $9^{6} \approx 2^{19}$; $10^{3} \approx 2^{10}$; $11^{11} \approx 2^{38}$; $12^{12} \approx 2^{43}$; $13^{10} \approx 2^{37}$; $14^{5} \approx 2^{19}$; $15^{10} \approx 2^{39}$; $17^{11} \approx 2^{45}$; $18^{6} \approx 2^{25}$; $19^{4} \approx 2^{17}$; $20^{3} \approx 2^{13}$; $21^{5} \approx 2^{22}$; $22^{11} \approx 2^{49}$; $23^{2} \approx 2^{9}$; $24^{12} \approx 2^{55}$; $25^{3} \approx 2^{14}$; $26^{10} \approx 2^{47}$; $27^{4} \approx 2^{19}$; $28^{5} \approx 2^{24}$; $29^{7} \approx 2^{34}$; $30^{10} \approx 2^{49}$; $31^{1} \approx 2^{5}$; $33^{1} \approx 2^{5}$; $34^{11} \approx 2^{56}$; $35^{8} \approx 2^{41}$; $36^{6} \approx 2^{31}$

Bases 5, 10, 23, 31, and 33 have a binary-power coincidence at a relatively small power of two (no higher than $2^{10} = 1024$). This would allow terminology similar to “kilobyte” to be used early in the computer industry's development, when memory sizes were small.

  • In Base 5, there would be a word for a 128 ($\approx 1000_5 = 125)$ byte unit.
  • In Base 10, we have a word (“kilobyte”, or the pedantic “kibibyte”) for a 1024 ($\approx 1000$) byte unit.
  • In Base 23, there would be a word for a 512 ($\approx 100_{23} = 529$) byte unit.
  • In Base 31 or 33, there would be a word for a 32-byte unit, and for a $32^2 = 1024$ byte unit.

In other bases, the coincidence doesn't occur until a higher power of two. For example, if we used dozenal (Base 12), we might have a word for $2^{43}$ bytes, but that's 8 terabytes (tebibytes), which is still larger than many hard drives today, so it probably wouldn't be a very practical unit.

There is one “out of range” binary power approximation I'd like to mention: $3^{12} \approx 2^{19}$, equivalent to $\log_2 \frac{3}{2} \approx \frac{7}{12}$, which is the mathematical basis of the standard 12-tone equal temperament musical tuning, which approximates the “perfect fifth” frequency ratio of $\frac{3}{2} = 1.5$ as $2^{7/12} \approx 1.498307$. Similarly, the familiar $10^{3} \approx 2^{10}$ (and its relatives $5^3 \approx 2^7$, $20^3 \approx 2^{13}$, and $25^3 \approx 2^{14}$) gives us $\log_2 \frac{5}{4} \approx \frac{1}{3}$, approximating a “major third” frequency ratio of $\frac{5}{4} = 1.25$ as $2^{1/3} \approx 1.259921$, or four semitones in the 12-tone equal temperament system.