Page 140 - 'Blast_Into_Math
P. 140
Blast into Math! Mathematical perspectives: all aour mase are melong to us
6.4 Examples and hints
• Hint for #2: Think about the steps we use to write a number in a given base and use these
steps to write your algorithm. Like with the Euclidean Algorithm, it is important to indicate
when to STOP. It doesn’t matter if you have a programmable computer or calculator or
not, because a person can also follow the steps of an algorithm. If you have a computer or
programmable calculator, you can code your algorithm into your computer or calculator to
make a base 10 to base 2 translation program. Thinking about running the algorithm on a
computer or calculator, you can see why it’s important for the algorithm to indicate when it
is complete, because otherwise your computer or calculator could crash.
• Examples for # 3: In base 2, let’s do some addition. For example, in base 2 we would write 4
as 100. Let’s write 4+ 4 in base 2. This is
100 + 100.
We could write this as 200, but 2 is not a digit in base 2. What does the 2 mean? It means 2
times the corresponding power of 2. In this case, it means 2 ∗ 2 . But, 2 ∗ 2 =2 . So, we have
2
3
2
100 + 100 = 1000 in base 2.
In general, when we add in base 2, we need to carry like we do when we add in base 10. Keep
doing examples until you understand the carrying rule for addition in base 2.
Let’s compute 100 ∗ 100 in base 2. In base 10, 100 =4. So, 100 ∗ 100 in base 10 is
4 ∗ 4= 16 =2 . Then, writing 2 in base 2, it is 10000. If we multiply like usual in base 10,
4
4
100 ∗ 100 = 10000.
Does this always work?
To prove your addition and multiplication algorithms, you need to prove that for
n m
j
x = x j 2 , y = y j 2 j
j=0 j=0
where n and m ∈ N , and each x j and y j is a digit in base 2, if you add or multiply them
together and follow your corresponding algorithms for addition and multiplication, the result
is correct. Since x and y are non-negative integers, you know that either x ≤ y or y ≤ x .
By possibly switching their names, you may assume x ≤ y . How do they look in base 2?
Which of them has more digits? How would you line them up and add them? What about
multiplication?
140

