3.1: Binary Representations
( \newcommand{\kernel}{\mathrm{null}\,}\)
Suppose {an}∞n=1 is a sequence such that, for each n=1,2,3,…, either an=0 or an=1 and, for any integer N, there exists an integer n>N such that an=0. Then
0≤an2n≤12n
for n=1,2,3,…, so the infinite series
∞∑n=1an2n
converges to some real number x by the comparison test. Moreover,
0≤x<∞∑n=112n=1.
We call the sequence {an}∞n=1 the binary representation for x, and write
x=.a1a2a3a4….
Suppose {an}∞n=1 and {bn}∞n=1 are both binary representations for x. Show that an=bn for n=1,2,3,….
Now suppose x∈R with 0≤x<1. Construct a sequence {an}∞n=1 as follows: If 0≤x<12, let a1=0; otherwise, let a1=1. For n=1,2,3,…, let
sn=n∑i=1ai2i
and set an+1=1 if
sn+12n+1≤x
and an+1=0 otherwise.
With the notation as above,
sn≤x<sn+12n
for n=1,2,3,….
- Proof
-
Since
s1={0, if 0≤x<1212, if 12≤x<1
it is clear that s1≤x<s1+12. So suppose n>1 and sn−1≤x<sn−1+12n−1. If sn−1+12n≤x, then an=1 and
sn=sn−1+12n≤x<sn−1+12n−1=sn−1+12n+12n=sn+12n.
If x<sn−1+12n, then an=0 and
sn=sn−1≤x<sn−1+12n=sn+12n.
Q.E.D.
With the notation as above,
x=∞∑n=1an2n.
- Proof
-
Given ϵ>0, choose an integer N such that 12n<ϵ. Then, for any n>N, it follows from the lemma that
|sn−x|<12n<12N<ϵ.
Hence
x=limn→∞sn=∞∑n=1an2n.
Q.E.D.
With the notation as above, given any integer N there exists an integer n>N such that an=0.
- Proof
-
If an=1 for n=1,2,3,…, then
x=∞∑n=112n=1,
contradicting the assumption that 0≤x<1. Now suppose there exists an integer N such that aN=0 but an=1 for every n>N. Then
x=sN+∞∑n=N+112n=sN−1+∞∑n=N+112n=sN−1+12N,
implying that aN=1, and thus contradicting the assumption that aN=0. Q.E.D.
Combining the previous lemma with the previous proposition yields the following result.
With the notation as above, x=.a1a2a3a4….
The next theorem now follows from Exercise 3.1.1 and the previous proposition.
Every real number 0≤x<1 has a unique binary representation.