Comparing infinite binary fractions to infinite decimal fractions

2.3k Views Asked by At

I'm trying to understand the cardinality between the set of all infinite binary (base-2) fractions and the set of all infinite decimal (base-10) fractions.

I can easily think of infinite binary fractions that do not match up with infinite decimal fractions, such as $\frac{1}{1010} = 0.00011001100110011\ldots$ (in binary) is not infinite in decimal $\frac{1}{2} = 0.5$ but does every infinite decimal fraction pair up with an infinite binary one (ex: $\frac{1}{3} = 0.333333\ldots$ maps to $\frac{1}{11} = 0.010101\ldots$)? Or does the infinite binary set have greater cardinality?

Clarification

By "infinite" fraction I mean a fraction that only repeats non-zero values.

Example: $\frac{1}{2} = 0.5000\ldots$ (in decimal) and $\frac{1}{10} = 0.1000\ldots$ (in binary) would not be considered infinite fractions.

For context: I'm trying to determine if programming using decimal floating points is better than binary floating points because of less rounding issues due to these infinite fractions. I already know they are better in regard to having the same rounding issues as is experienced in the real world, which primarily uses a base-10 numeric system.

2

There are 2 best solutions below

3
On BEST ANSWER

Fractions have terminating decimal representations exactly when the (reduced) denominator factors into powers of $2$ and $5$ only, while they have terminating binary representations exactly when the denominator is a power of $2$.

So yes (if I understand the question), if a fraction does not terminate in decimal, its (reduced) denominator has a prime factor other that $2$ or $5$, and so it will repeat in binary too.

2
On

Let $B,D$ denote the sets of all infinite binary fractions and infinite decimal fractions respec. Since all the infinite binary fractions of the form $$0.b_0b_1b_2\cdots$$have their $b$'s from $\{0,1\}$, they are just a subset of all the infinite decimal fractions of the form $$0.d_0d_1d_2\cdots$$ where the $d$'s are from $\{0,1,\cdots\ ,9\}$. So there exist a surjection from $B$ to some subset of $D$, namely $B$ itself. Now, clearly, if $0.d_1d_2d_3\cdots $ is any element from $D$, one can find a unique representation of that in $B$. So there exists a surjection from $D$ to some subset of $B$. Then, by Schroeder-Bernstein theorem $B$ and $D$ have the same cardinality.