Quiz 2 Key
Quiz 2 Key
Calculator:
An application
Problem: Given a 3 pint can, a 5 pint can, a large tank of
water, and a large empty tank, how can we get exactly 1
pint of water into the empty tank?
Long division:
Recall 4 grade
th
More examples
3 does not divide 5 since there is no
whole number Q such that 5 = 3*Q
9 does not divide 10 since there is no
whole number Q such that 10 = 9*Q
Visualizing division
6
6 = 2*3
2 divides 6
7
7 = 2*3 + 1
Division Algorithm
A and B are whole numbers and B is not 0. To determine if B divides A do the
following:
i. If A = 0 then B divides A
ii. If 0 < A < B then B does not divide A
ii. If B <= A then replace A by B A and repeat i.
7 2 - 2 2 = 7 3*2 = 1 < 2
(step 4)
7 2 - 2 = 7 2*2 = 3 > 2
(step 3)
7 1*2 = 5 > 2
7 >2
(step2)
(step 1)
The process subtracts B from A as many times as it can. At some point A is reduced
to 0 or B cannot be subtracted from what remains. The effect is to write
A = BQ + R with R = 0 or 0 < R < B
R is called the remainder when A is divided by B. Q is called the quotient.
Long Division
__3 _
7 | 220
210
10
31
7 | 220
210
10
_7
3
220 = 7*30 + 10
(does 30 subtractions)
Quotient = 31 remainder = 3
220 = 7*31 + 3
Division Algorithm
If A and B are integers with B not zero then
there are unique integers Q and R such that
A = BQ + R with 0 <= R < |B|
Note this allows A and B to be negative
5 = (-2)(-2) + 1 0 < 1 <|-2|
-7 = (-2)(4) + 1
0 < 1<|-2|
x 1
since
2
x 1 ( x 1 ) ( x 1 )
2
does not divide x 1
Also ( x 1 ) ( 1x x )x 1
2
which says that the remainder when
x
3
2
x ( x 1 ) ( 1x x )1
so
is divided by x -1 is 1.
Algebra of Remainders
(modular arithmetic)
Principle: When calculating the remainder when an algebraic expression of
polynomials is divided by a polynomial B, one can replace any factor or
summand by its remainder upon division by B.
The remainder upon dividing the sum of two polynomials by B is the same as the
remainder if either (or both) terms is first replaced by its remainder (or any
polynomial that has the same remainder).
The remainder upon dividing the product of two polynomials by B is the same as
the remainder if either (or both) terms is first replaced by its remainder (or any
polynomial that has the same remainder).
2
4
3
2
2
x 3 x x 1( x ) 3 x x x 1
We can replace x
4
3
2
x 3 x x 1( 1x ) 3 x ( 1x )x 1 = 12 x x 23 x 3 x 2x 1
=
4 x 4 x
again to get
8 x 4
Similarly
Calculate the remainder when x 4
is divided by
2
4 x 4 x 1
This says
1 2
Replace x by
is
is a root of
2x+1
( 2 x 1 )
or
4 ( 2 x 1 )4 x 112 x 5
4
2
x ( x 2 x 1 ) Q( x )12 x 5
2
x 2 x 1
1 2
Since it is a root of
2
x 2 x 1
2
x 2 x 1
in
What is ( 1 2 )
4
2
x ( x 2 x 1 ) Q( x )12 x 5
we have
4
( 1 2 ) 12 ( 1 2 )5
or 1712 2
GCD 12 and 20
Factors of 12 = {-12,-6,-4,-3,-2,-1,1,2,3,4,6,12}
Factors of 20 = {-20,-10,-5,-4,-2,-1,1,2, 4, 5,10,20}
Common factors = {-4, -2,-1,1,2,4}
Greatest common factor = 4
Factors of 5280
10
11
12
15
16
22
24
30
32
20
33
44
48
55
60
40
66
88
96
110
120
80
132
165
176
220
240
160
264
330
352
440
480
528
660
1760 2640
5280
10
20
24
18
40
45
39
78
90
72
180
130 156
312 360
390
12
13
15
26
30
36
52
60
65
104 117
120
195 234
260
468 520
585
Factors of 4680
GCD(5280,4680) = ?
Euclid Algorithm
To find the gcd of numbers A1 and A2 with A1 > A2 >= 0
a. If A2 = 0 then gcd = A1
b. If A2 > 0 then A1 = A2 q2 + A3 with A2>A3 >=0
c. Replace A1 by A2, A2 by A3 and go to step a.
Example: gcd(120,85)
120 = 85*1 + 35
85 = 35*2 + 15
35 = 15*2 + 5
15 = 5*3 + 0
gcd = 5
Tabulate: note
pattern
120
120 = 85*1 + 35
85
85 = 35*2 + 15
35
35 = 15*2 + 5
15
15 = 5*3 + 0
" "
" "
GCD=5 obviously 85 1
85 1
*
5*1 0*0 = 5
35
15
Add column to
left
35
15
+5
" "
" "
120
Have
85
15 5*3 = 0
35
15
0
1
" "
" "
120
85
*
*
35
=5
15
+5
0
" "
" "
120
85
*?
35
0
1
15
-0
" "
" "
120
85
35
15
0
1
" "
" "
+
-
7
120
"Begin"
5
85
1
2
35
2
1
15
2
0
5
3
1
0
"done"
+
5*120-7*85 = 5
2*85-5*35 = -5
1*35-2*15 = 5
0*15 -1* 5 = -5
1*5 - 0*0=5
Note we are
differing from the
book slightly. The
book would ask that
the gcd be monic.
That is it wants the
gcd in this problem
to be x-2 so it
would put a at
the lower left
instead of 1. ( 5 x
"Polynomials"
1x
2
3
5 x 24 x x
2
x 5 x 6
4 x 8
"Divisions"
"Begin"
1x
x 3
4 4
"done"
2
3
2
2
4
x
x
)
1
(1+x)
(
x
5 x 6 )4 x 8
2
3
5 x 24 x x
and
2
x 5 x 6
"Answers"
3x 5
2 2
1*(
"Polynomials"
"Divisions"
2
3
"Begin"
38 x 8 x 3 x
3 x 5
2
2 x 2 x
2
2
2x
33 x
0
"done"
38 x 8 x 3 x
)-(
3x
2
5
2
)*( 2 x 2 x
) = -3 - 3x