User:Marty/UCSC Math 110 Fall 2008/Week 0

=The first activity=

Introduction
We begin the class straight away with an activity, called "1-dimensional Hop and Skip".

Each student in the class is paired with a partner (or triple). The instructions of the activity are as follows:
 * This game is played on a number line. You begin at zero.
 * You are allowed to move along the number line in two ways:
 * You can "hop" by moving 123 units to the left or to the right.
 * You can "skip" by moving 73 units to the left or to the right.
 * The object of the game is to reach the number 1, by a sequence of hops and skips.

Students are given a few minutes to work on this game, without interruption and without shouting out the answer!

Discussion
After playing the game for a few minutes, students are invited to discuss how they solved it. In particular, the following items should be discussed:
 * Can the game be won?
 * How do "compound moves" (call them "jumps" or "leaps", for example) help to solve the game?
 * What solutions were found? How many hops and how many skips did it take?
 * Is there a unique way to win the game?
 * How can you get from one winning way to another?

Transition to the Euclidean algorithm
Set up a table on the board, with the Euclidean algorithm for 123 and 73:

Of course, when done on paper, it looks more like this:

The "sequence of remainders": 50, 23, 4, 3, 1, are "compound moves" in the game of Hop and Skip. Since 1 is a compound move, it follows that it is possible to get from 0 to 1, using only hops and skips.

A variation
Now, play the same game, but with the following two changes:
 * You can "hop" 91 units to the left or right.
 * You can "skip" 56 units to the left or right.

Where on the number line can you get to?

=The Euclidean Algorithm=

The Covers::Def/Euclidean algorithm is the foundation for much of number theory. It will be used over and over in this class, both in computations and proofs. Here, on the first day, we use it to find the Covers::Def/Greatest common divisor of two positive natural numbers.

Divides and GCD
Number theorists use the verb "divides" to mean the following: if $a$ and $b$ are two integers, then it is said that $a$ divides $b$ if:
 * There exists an integer $m$, such that $b = am$.

The following are useful facts to remember, using the word "divides":
 * If $a$ divides $b$, then $\vert a \vert \leq \vert b \vert$.
 * $0$ divides $0$.
 * $0$ does not divide anything other than zero.
 * $2$ divides every even number. $2$ divides no odd number.
 * Every integer divides $0$.
 * If $a$ divides $b$, and $b$ divides $c$, then $a$ divides $c$.

If $a$ and $b$ are integers, and $d$ is an integer, then we say that $d$ is a common divisor of $a$ and $b$ if $d$ divides $a$, and $d$ divides $b$. We say that $d$ is a greatest common divisor of $a$ and $b$, if:
 * $d$ is a common divisor of $a$ and $b$.
 * If $e$ is a common divisor of $a$ and $b$, then $e$ divides $d$.

This is somewhat different from the elementary school definition. For example, the pair of numbers $14,21$ have two greatest common divisors: $7$ and $-7$. However, we often use the positive greatest common divisor, $7$, and write $GCD(14,21) = 7$, in elementary contexts.

Division with remainder
A fundamental fact, learned (sort of) in grade school), is the following: Suppose that $a,b \in \NN$ , and $b \neq 0$.  Then, there exist integers $q,r$, such that: Here is a proof of this fact.
 * $a = qb + r$, and
 * $0 \leq r < b$.

Greatest common divisors can be computed with the Euclidean algorithm
Beginning with two natural numbers $a$ and $b$ (with $b \neq 0$), the Euclidean algorithm can be used to compute the greatest common divisor of $a$ and $b$. This can be seen from the following " two out of three principle" for divisibility: Suppose that $x,y,z \in \NN$, and $d \in \NN$, and $x + y = z$.

Then, if $d$ divides any two elements of the set $\{x,y,z \}$, then $d$ divides all three elements of the set $\{ x, y, z \}$.

Consider the following proof that $GCD(123,73) = 1$, using the Euclidean algorithm and this principle: Suppose that $d$ were a common divisor of $123$ and $73$. Then, by the "two out of three principle", $d$ divides $50$. Then, since $d$ is a common divisor of $73$ and $50$, the same principle demonstrates that $d$ divides $23$. Continuing, applying the two out of three principle to each line in the Euclidean algorithm, demonstrates that $d$ divides $1$. Hence, every common divisor of $123$ and $73$ is also a divisor of $1$. The only positive divisor of $1$ is $1$ itself; hence $1 = GCD(123,73)$.

Consider now, the Euclidean algorithm applied to $42$ and $30$:

One does not reach $1$, as a remainder in the above sequence. The last nonzero remainder is $6$. We demonstrate that $6$ is the greatest common divisor of $42$ and $30$, as follows:
 * By the two out of three principle, applied to the first and second lines above, we find that every common divisor $d$ of $42$ and $30$, also must divide $6$.
 * Now, we can use the two out of three principle, from the bottom-up:
 * From the final line, we find that $6$ divides $12$.
 * From the penultimate (second-to-last) line, and the two out of three principle, we find that $6$ divides $30$.
 * From the first line, we find that $6$ divides $12$ and $30$, and hence divides $42$.
 * Thus, $6$ is a common divisor of $30$ and $42$.

These observations, obtained by "going down and up", demonstrate that $6$ is a common divisor of $30$ and $42$, and every common divisor of $30$ and $42$ is also a divisor of $6$. Thus, $6 = GCD(30,42)$.

One may turn this argument into a general proof that greatest common divisors can be found with the Euclidean algorithm.