4/12/2006 Numerical Algorithms 1
4/12/2006 Numerical Algorithms 1
x 0 1 2 3 4 5 6 7 8 9
x−1 1 7 3 9
x 0 1 2 3 4 5 6 7 8 9 10
x−1 1 6 4 3 9 2 8 7 5 10
x 0 1 2 3 4 5 6 7 8 9
x−1 1 7 3 9
4/12/2006 Numerical Algorithms 9
Example: Measuring Lengths
Consider a stick of length a and a stick of length b such that a and
b are relatively prime
Given two integers i and j, we can measure length
n = ia + jb
We show that any integer n can be written as n = ia + jb for some
integers i and j
Let s be the inverse of a in Zb We have sa mod b = 1
There exists integer t such that sa + tb = 1
Pick i = ns and j = nt
Thus, given two sticks of relatively prime integer lengths, we can
measure any integer length
Example, measure length 2 with sticks of length 3 and 7
3 3 3 3
7 7