% This file was converted to LaTeX by Writer2LaTeX ver. 0.5
% see http://www.hj-gym.dk/~hj/writer2latex for more info
\documentclass[12pt]{article}
\usepackage{amsmath,amssymb,amsfonts}
\usepackage{fullpage}

\begin{document}
Daniela Monroig

MAE301 Class Notes

2/19/09


\bigskip

Counting with repeating decimals:
\bigskip

Recall that the decimal for $p/q$ terminates after $t$ places if and only if
$q=2^r5^s$, where $t=max(r,s)$. In the last class we showed that an
eventually repeating decimal is a rational number. We proved that a
rational number can be a repeating decimal, and that eventually
repeating decimals are rational by noticing that only finitely many
($q-1$) possible remainders before having to reuse any.


\bigskip

So why \textit{are} decimals useful? 

Some advantages of decimals:

\begin{itemize}
\item Decimals make it easier to see the quantitative value of a number.
That is, they make relative comparisons easy. 
\\
For example: we know that $.25>.2$ just by looking at it, but
it isn't so easy to make this distinction when the
decimals are in their equivalent fraction form ( $1/4 > 1/5$ ).
A less obvious example would be comparing $11/17$ and $24/37$; 


\item Decimals also make it easier to approximate.
\\
For example, we have a complicated looking fraction $221/1973$ which is
approximately $22/197$ which is approximately $.112$. In this case, it is
easy to see how less complicated the decimal is to understand.

\item Decimals are also better to use for calculations. You can add and
subtract decimals in the same fashion as you would for the integers,
but when you add or subtract a fraction, you first have
to find a common denominator before you can do anything else. 
\end{itemize}


Some disadvantages of decimals:
\begin{itemize}
\item Decimals are not always as succinct, or concise.
\\
For example, consider the fraction $1/19$. This equals
.052163158947368421052163{\dots} This long repeating decimal is much
more consise in fraction form.

\item There can also be some confusion when representing a number in
decimal form.
\\
For example: The numbers $123,456$ and $123.456$ can be easily
confused.  This is especially problematic when Europeans and Americans
are both involved, since Europeans use ``,'' for the decimal point.


\item Significant figures, sometimes called ``sig-figs'', may also
  cause some confusion.  Sig-figs are typically an issue when dealing
  with measurements in science.  The issue arises because students
  often don't understand the purpose.

For example, when employing significant figures two represent a
measurement of 2 units to within $\pm .05$, this is written as $2.0$.
If we were to add a more precisely measured quantity, say $1.234$, we
would claim
$$2.0 + 1.234 \approx 3.2, $$
which is correct to two significant figures.  However, students often
get confused about when to add more figures and when to drop them.
\end{itemize}

\bigskip

When we have a long rational decimal, what exactly does it mean? Take,
for example, the number $2.94723$.  By this we mean
$2+\frac{9}{10}+\frac{4}{100}+\frac{7}{1000}+\frac{2}{10000}+\frac{3}{100000}.$

However, we don't necessarily have to represent numbers using powers
of 10.  In some cases, it might be more convenient to use powers of
two, or three, or some other convenient base.

\medskip
For example, we could represent the number $3/4$ in base 10 as $0.75$,
by which we mean
  $$ \frac{3}{4} = \frac{7}{10} + \frac{5}{100}.$$
However, we could also use powers of two:
  $$ \frac{3}{4} = \frac{1}{2} + \frac{1}{4}. $$

In this case, we could write this as a ``base-2 decimal'' or
``bicimal'',  that is,
  $$\frac{3}{4} = 0.11_{[2]}$$

We can generalize this to any number.  More precisely, every real
number $x$ between 0 and 1 can be written uniquely as 
 $$x=\sum_{i=1}^{\infty} \frac{a_i}{2^i}, $$
where each of the numbers $a_i$ are either $0$ or $1$ (and we make the
convention that we don't end in an infinite string of $1$s).  We can
write this in base 2 as the string
  $$0.a_1a_2a_3a_4\ldots_{[2]}$$
(if all of the $a_i$ beyond some point are 0, we usually just
stop writing them and terminate the expansion.)

This is in exact analogy to our usual decimal representation, where we
write
 $$x=\sum_{i=1}^{\infty} \frac{b_i}{10^i} \quad= 0.b_1b_2b_3b_4\ldots $$
(with the convention that if all the $b_i$ are 0 after some point, we
terminate the decimal, and we don't write a decimal ending in all
$9$s.

These base-2 decimals are what is used internally in computers, for
example.

\medskip
Note that in base 2, the decimal will terminate exactly when the
fraction represented is a dyadic rational, that is, can be written in
the form $p/2^k$.  The consequence of this is that many of our
terminating (base 10) decimals cannot be represented exactly in a
computer.
For example, in base 2, $1/10$ does not have a terminating
representation.  Rather, it is has a repeating expansion, since 
$$\frac{1}{10} = 2^{-4} + 2^{-5} + 2^{-8} + 2^{-9} + 2^{-12} + 2^{-13}
+ \ldots = 0.000110011\overline{0011}_{[2]}$$

\bigskip
How can we determine the base-2 representation of a number? Let's go
through it for $1/10$ a little more carefully.

First, $1/10 < 1/2$, so the first digit is $0$ (we have no halves).

Next, $1/10 < 1/4$, so the next digit is also $0$ (no quarters,
either).

Also, $1/10 < 1/8$, so the next is $0$ as well.

But, $1/10 > 1/16$, so the next digit is $1$.

Now it gets a little more complex.  We now compare $1/10 - 1/16$ to
$1/32$ (it is still bigger), so the next digit is $1$ as well, and
then we look at how $1/10 - 1/16 - 1/32$ compares to $1/64$, and my
head is starting to hurt.

\bigskip
Let's try to be a little smarter, and start over.

$1/10 < 1/2$, so the first digit is $0$.  Now, rather than halving $1/2$,
let's double the $1/10$, and compare that to $1/2$ (doubling
corresponds to shifting right one place).  When the result of doubling
is bigger than $1/2$, we get a $1$ in the expansion. Then we subtract
$1/2$ from the number we are trying to represent,  and continue.

Let's try:
\begin{center}
\begin{tabular}{rrrrrrrrrr}
$\frac{1}{10}$, &$\frac{2}{10}$, &$\frac{4}{10}$, 
              &$\frac{8}{10}\rightarrow\frac{3}{10}$,
              &$\frac{6}{10}\rightarrow\frac{1}{10}$,
&$\frac{2}{10}$, &$\frac{4}{10}$, 
              &$\frac{8}{10}\rightarrow\frac{3}{10}$,
              &$\frac{6}{10}\rightarrow\frac{1}{10}$, &$\ldots$ \cr
.0 & 0 & 0 & 1 & 1
   & 0 & 0 & 1 & 1 & \ldots
\end{tabular}
\end{center}

Here it is clear the pattern will repeat.


\bigskip
We can adapt this algorithm to represent a number in other bases.  For
example, to get $1/4$ in base three (here we triple, and compare to
$1/3$ or $2/3$):

\begin{center}
\begin{tabular}{rrrrrrrrrr}
 $\frac{1}{4}$, 
&$\frac{3}{4}-\frac{2}{3}\rightarrow \frac{1}{12}$, 
&$\frac{3}{12}=\frac{1}{4}$, 
&$\frac{3}{4}-\frac{2}{3}\rightarrow \frac{1}{12}$, &$\ldots$ \cr
.0 & 2 & 0 & 2 & $\ldots$
\end{tabular}
\end{center}

So $1/4 = 0.02\overline{02}_{[3]}$, which we already knew since 
$$\sum\frac{2}{9^n} = \frac{1}{4}.$$


\end{document}
