To do: October 15
Suppose we have the following classes:
· High School Student, Teacher, Student, Person, College Student
On the whiteboard, draw a hierarchy of the classes showing the relationships among the classes in the space below.
The connectors between classes should be arrows, with the head of the arrow pointing towards the superclass.
Go over homework
Recall this problem...
Suppose we have a 60 ft by 100 ft rectangular room and we want to cover the floor with square tiles completely without gaps nor overlapping.
We also want to use the smallest number of square tiles possible. What will be the size of the square tiles?
What is the mathematics significance of the dimensions of the square tiles?
Recall this problem...
Suppose we have a 60 ft by 100 ft rectangular room and we want to cover the floor with square tiles completely without gaps nor overlapping.
We also want to use the smallest number of square tiles possible. What will be the size of the square tiles?
What is the mathematics significance of this dimensions of the square tiles? The greatest common factor of the dimensions: 60 and 100.
GCD
GCD
a,b positive integers, a > b
GCF (a,b) = GCF(b, a%b)
GCD
Find the greatest common divisor of a = 315 and b = 168.
How can we visualize this problem?
GCD
Find the greatest common divisor of a = 315 and b = 168.
How can we visualize this problem?
Example: a = 1071 and b = 462 at https://en.wikipedia.org/wiki/Euclidean_algorithm
GCD
Find the greatest common divisor of a = 1071 and b = 462.
How can we visualize this problem? https://en.wikipedia.org/wiki/Euclidean_algorithm
Assuming a > b:
GCD(a,b) == GCD(b,a%b)
Loop until a%b==0. b is the GCD.
Repl.it lab - gcd
linear (brute force) vs Euclidean (recursive and iterative)
Troop and Dinosaur class worksheet
Homework due Friday