Você está na página 1de 16

Euclid's Algorithm

Given A Given B A/B Floor A/B B*Floor


8554 224654 0.038076331 0 0
224654 8554 26.26303484 26 222404
8554 2250 3.801777778 3 6750
2250 1804 1.247228381 1 1804
1804 446 4.044843049 4 1784
446 20 22.3 22 440
20 6 3.333333333 3 18
6 2 3 3 6
2 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
0 0
A-B*Floor
8554
2250
1804
446
20
6
2
0
Heron's Algorithm
Find Root of … Number x(number)
35 1 25.000000000000000
2 13.200000000000000
Starting Value … 3 7.925757575757580
25 4 6.170869611813030
5 5.921339808096060
Root of A4 6 5.916082119383620
5.9160797831 7 5.916079783100080
8 5.916079783099620
9 5.916079783099620
10 5.916079783099620
11 5.916079783099620
12 5.916079783099620
13 5.916079783099620
14 5.916079783099620
15 5.916079783099620
16 5.916079783099620
17 5.916079783099620
18 5.916079783099620
19 5.916079783099620
20 5.916079783099620
21 5.916079783099620
22 5.916079783099620
23 5.916079783099620
24 5.916079783099620
25 5.916079783099620
26 5.916079783099620
27 5.916079783099620
28 5.916079783099620
29 5.916079783099620
30 5.916079783099620
31 5.916079783099620
32 5.916079783099620
33 5.916079783099620
34 5.916079783099620
35 5.916079783099620
36 5.916079783099620
37 5.916079783099620
38 5.916079783099620
39 5.916079783099620
40 5.916079783099620
41 5.916079783099620
42 5.916079783099620
43 5.916079783099620
44 5.916079783099620
45 5.916079783099620
46 5.916079783099620
47 5.916079783099620
48 5.916079783099620
49 5.916079783099620
50 5.916079783099620
Difference between x(number)
and SQRT(A4):
19.083920216900400
7.283920216900380
2.009677792657960
0.254789828713410
0.005260024996439
0.000002336284004
0.000000000000461
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
0.000000000000000
Estimation of Pi
# of sides of regular polygon: length of a side:
n 2(tan(180/n))
555 0.0113211755

Measure of a central angle: perimeter:


360/n n(2(tan(180/n)))
0.6486486486 6.2832524157

.5 length of a side: perimeter:diameter ratio


tan(180/n)
0.0056605878 3.1416262079

Known value of Pi (15 places:) 3.141592653589790


area one right triangle:
.5(tan(180/n))
0.0028302939

Polygon area:
n(tan(180/n))
3.1416262079

Difference between area and PI:


(area)-(pi)
3.35542830200985E-05
Euclid's Algorithm-the method:
Euclid's
Euclid's Algorithm-Goals
Algorithm is a method that can be used to find the greatest common divisor
(gcd) of two integers. The columns in the spreadsheet are as follows:
1.) Become more familiar with Euclid's Algorithm by programming the algorithm into an
Excel
given a, spreadsheet.
given b. a, b integers, a>b. These are the two numbers for which we want
to
2.) Gain an understanding
find the gcd.of the "IF" command in Excel.
a/b The quotient of a and b.
3.) Become
Floor a/b more adept
The at using
greatest Excel,less
integer in general.
than a/b, known as the "Floor of a/b."
b*Floor The product of b and the floor of a/b.
a-(b*Floor) The difference between a and b*floor.

Here is an example of the algorithm:

1.) (a, b) = (240,90)


The first step is to find how many multiples of 90 are in 240.

2.) 240 = 90*(2) + 60


There are 2 multiples of 90 in 240, with 60 left over.

3.) (90, 60)


We now take the larger number from the first set of numbers (240), replace it with the
smaller number (90), and replace the smaller number with the "left over" part from the
equation in (2).

4.) 90 = 60*(1) +30


Repeat the algorithm.

5.) (60, 30) --> 60 = 30*(2) + 0


Since there is no remainder upon dividing 60 by 30, 30 is the gcd of 240 and 90.
mmon divisor
e algorithm into an
r which we want

Floor of a/b."

ace it with the


" part from the

0 and 90.
Heron's Algorithm-the method:
Heron's Algorithm-Goals:
The formula:
1.) Allows students to see how Heron's Algorithm, a recursion algorithm, converges to
square
x(1)= root,number
any real regardless of the starting value.
x(n+1) = .5 ( x(n) + (a/x(n)))
The2.) Recognize
sequence a way totoapproximate
converges square
Sqrt (a) for n=1, roots
2, 3, … with some ease and degree of prec

Two3.) Gain
steps inathe
better understanding of how to use Ecxel as a way to manipulate recursive
recursion:
functions.
What is the square root of 2?

x(1) = 5
x(2) = .5(5+(2/5)) = 2.7
x(3) = .5(2.7+(2/2.7)) = 1.7203...
x(4) = .5(1.7203+(2/1.7203)) = 1.44145...
x(5) = .5(1.44145+(2/1.44145) = 1.41447...

Sqrt(2) = 1.414213562...

Notice that x(5) is very close to the actual value of Sqrt(2).


ithm, converges to a

and degree of precision.

anipulate recursive
Estimation of Pi-Goals:

1.) Answer the question, "What IS p?"


a.) Learn the "meaning of pi."
b.) Understand how pi is related to the unit circle and how we find a value
for pi.

2.) Understand how pi was calculated by inscribing regular polygons in the unit circle
and circumscribing regular polygons about the unit circle.

3.) Excel is a good tool for calculating the vast number of quantities needed to
approximate pi. (See: Barnes, Sue. "Perimeters, Patterns, and Pi." Mathematics
Teacher, April 1996, pg. 284-288.)
a value

the unit circle

eded to
athematics
Advantages of using Excel:

1.) Saves time. Allows the teacher to spend more time discussing the concept of
the algorithms instead of spending that time actually calculating with the algorithm.

2.) Excel makes it easy to "see" numbers converge to a limit. For instance, in the
Heron's Algorithm worksheet, the table of calculated roots clearly converges to the
actual square root.

3.) In general, using Excel allows students to become more familiar with the use
of computer technologies.

Disadvantages of using Excel:

1.) Excel makes it easy for students to simply punch numbers into the computer
instead of understanding why they are doing in the computer really does work.

2.) Excel has many, many features, some of which can be quite difficult to figure
out. Class time that has to be devoted to teaching how to use Excel may better be
spent learning new topics in math.
e concept of
he algorithm.

tance, in the
verges to the

with the use

e computer
es work.

ult to figure
may better be

Você também pode gostar