I'm actually intereseted in real numbers that belong to the interval $(0,1)$, but a more general answer will be great
-
All numbers have a binary representation. However every terminating rational number has two representations. One that terminates, and one that has an infinite tail of $1$s. It is exactly the some as decimal representations for exactly the same reason. – fleablood Nov 05 '18 at 19:37
2 Answers
Every number does have a binary representation but it is not necessarily unique.
For example $$1/2 = 1/4+1/8+1/16 +....$$ which means $$0.1 = 0.01+0.001 +0.0001+......=0.01111111.... $$
- 68,728
-
This sucks for me. I need this for a proof in an assigment. Does every irrational number in (0,1) have a unique binary representation? – McLovin Nov 05 '18 at 19:58
-
Be patient. If you need a proof, you can get one by bisection method and making a series of negative powers of $2$ to converge to your irrational number. Sketch a graph of $ (0,1)$ and pick an arbitrary point in it and see which half includes your point and keep finding your sequence by dividing your intervals into halves which include your point. – Mohammad Riazi-Kermani Nov 05 '18 at 20:06
-
@Pilpel Yes. The numbers like $.101100\bar 0 = .10101111\bar 1$ are all rational. – zhw. Nov 05 '18 at 20:06
-
-
-
Not a hat, it' a bar. For the first number it means all $0$'s from that point onward, for the second, same thing with all $1$'s – zhw. Nov 05 '18 at 20:09
-
hat means infinite zeros or infinite ones. It's the exact same argument as base 10. $4.561 = 4.56099999999......$ but for any x that doesn't terminate has exactly one rep. But the question is, do you know how to prove that? – fleablood Nov 05 '18 at 20:10
-
No. I don't need to. The assigment doesn't ask for a complete proof. I just want to make sure that every irrational number from (0,1) have a unique binary representation. Is this correct? (I hate to do this, sorry, but I have to submit this tomorrow) – McLovin Nov 05 '18 at 20:13
-
1If $x \in (0, 1)$ and $x$ is irational the either $0 < x < \frac 12$ (if so let $a_1=0$) or $\frac 12 < x < 1$ (if so let $a_1 = 1$). Now either $a_1\cdot \frac 12 < x < a_1\cdot \frac12 + \frac 14$ or $a_1\cdot \frac 12 + \frac 14 < x < a_1\cdot \frac 12 + \frac 12$. Let $a_2$ be $0$ or $1$ depending. Keep doing this forever. As $x$ is irrational it will never end and you will get infinitely closer and yet every division as exactly one unambiguous $a_k$. – fleablood Nov 05 '18 at 20:16
-
@Pilpel yes it is true for irrational numbers. The representations are unique. – Mohammad Riazi-Kermani Nov 05 '18 at 20:17
It's the same as for decimal representations and for the exact same reason.
For positive integer $b > 1$ and a real number $x$ (for simplicty I'll assume $x$ is positive) we can find an integer $m$ and infinite series of integer $a_k; 0 \le a_k < b$ so that $c_0 = m \le x < m+1$ and $c_1 = m + a_1\frac 1b \le x < m + (a_1\frac 1b); .....; c_k = m + a_1\frac 1b + a_2\frac 1{b^2} + ....+a_k\frac 1{b^k} \le x < m + a_1\frac 1b + a_2\frac 1{b^2} + ....+a_k\frac 1{b^k};....$.
These $c_k\to x$. I don't know your experience of real analysis but if you know some than $\{c_k\}$ is verifiable as a cauchy sequence converging to $x$ (just follow the definitions). If you don't know any analysis, just convince yourself those $c_k$ get closer and closer to $x$ and can get arbitrarily close.
So that $c_k$ are a base-$b$ representation of $x$.
If we replaced any $a_k$ with another value we will offset the whole value by at leat $\frac 1{b^k}$ and the only way we can "make" it up is if we can modifythe remaining $a_{j; j > k}$ to some $d_j$. But all the remaining $\sum_{j;j>k} d_j*\frac 1{b^j} \le \frac 1{b^k}$ with equality holding only if $d_j = (b-1)$.
So the only we can get a second base-$b$ representation is if we decrease $a_k$ to $a_k - 1$ (and borrow from $a_{k-1}$ is necessary) and if all the $a_{j; j> k} =0$ and we boost them $(b-1)$.
So all real $x$ have at least one base-$b$ representation. And if it terminates with infinite trailing $0$s it has a second representation with infinite trailing $b-1$'s.
- 124,253