Download Assignment 2 Prof. John MacDonald

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Location arithmetic wikipedia , lookup

Four color theorem wikipedia , lookup

Mathematical proof wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Transcript
Assignment 2
Prof. John MacDonald
Spencer Frei
January 28, 2014
1. 2.1.8. Two thousand years ago, a noble Arabian king wished to reward his minister of science.
Although the modest minister resisted any reward from the king, the king fi nally forced him to
state a desired reward. Impishly the minister said that he would be content with the following
token: Let us take a checkerboard. On the fi rst square I would be most grateful if you would
place one piece of gold. Then on the next square twice as much as before, thus placing two
pieces, and on each subsequent square, placing twice as many pieces of gold as in the previous
square. I would be most content with all the gold that is on the board once your majesty has
fi nished. This sounded extremely reasonable, and the king agreed. Given that there are 64
squares on a checkerboard, roughly how many pieces of gold did the king have to give to our
modest minister of science? Why did the king have him executed?
Proof. He had to give quite a lot of pieces. The first square has one piece, the second has two
pieces, the third has four pieces, and so on, where the k-th square has 2k−1 pieces of gold on it,
which means that the 64-th square has 263 pieces of gold on it, and if the minister gets all of the
gold on the board, that means he gets
1 + 2 + 22 + 23 + · · · + 262 + 263 =
64
X
k=1
2k−1 =
264 − 1
.
2−1
This is an absurd amount of gold (it’s about 1.8 × 1019 pieces of gold), so that’s why he was
executed.
2. 2.1.14. You have 10 pairs of socks, fi ve black and fi ve blue, but they are not paired up. Instead,
they are all mixed up in a drawer. It s early in the morning, and you don t want to turn on
the lights in your dark room. How many socks must you pull out to guarantee that you have a
pair of one color? How many must you pull out to have two good pairs (each pair is the same
color)? How many must you pull out to be certain you have a pair of black socks?
Proof. To get one pair of a certain color, you are required to pull at least three out, since if you
just pull two out it’s possible to get one blue and one black.
To get two pairs of the same color, we need to pull 7 sock since it is possible to pull three of each
color in a row, but on the 7th pull we are guaranteed to complete the second pair of some color.
To be certain of getting a pair of black socks, it is necessary to pull out 12 socks since it is
possible to pull out 10 of the same color initially, but upon drawing the 11th you are guaranteed
to get the opposite color, and on the 12th you are guaranteed to get that color again to complete
the pair.
1
3. 2.2.5. Solve the equation for x:
x=2+
1
,
x
x=3+
1
.
x
Proof. Multiplying both equations by x, we get that
x2 = 2x + 1,
x2 = 3x + 1 .
For the first equation, we have
x2 − 2x − 1 = 0 ,
and using the quadratic equation gives
p
√
2 ± 22 − 4(1)(−1)
2± 8
=
.
x=
2(1)
2
√
√
√
We can keep it in this form, or rewrite 8 = 22 × 2 = 2 2, and get
√
√
√
x = 1 ± 2 = {1 + 2, 1 − 2} .
For the second equation, we rearrange
x2 − 3x − 1 = 0 ,
and use the quadratic formula to get
x=
3±
p
√
32 − 4(1)(−1)
3 ± 13
=
.
2(1)
2
It’s not possible to rewrite the square root here, so the answer is just
√
√
3 + 13
3 − 13
x=
or
.
2
2
4. 2.2.6. Baby bunnies . This question gave the Fibonacci sequence its name. It was posed and
answered by Leonardo of Pisa, better known as Fibonacci. Suppose we have a pair of baby
rabbits: one male and one female. Let us assume that rabbits cannot reproduce until they are
one month old and that they have a one - month gestation period. Once they start reproducing,
they produce a pair of bunnies each month (one of each sex). Assuming that no pair ever dies,
how many pairs of rabbits will exist in a particular month? During the fi rst month, the bunnies
grow into rabbits. After two months, they are the proud parents of a pair of bunnies. There
will now be two pairs of rabbits: the original, mature pair and a new pair of bunnies. The next
month, the original pair produces another pair of bunnies, but the new pair of bunnies is unable
to reproduce until the following month. Thus we have:
Time (months)
Number of pairs
Start
1
1
1
2
2
3
x
4
x
5
x
6
x
7
x
Proof. This is just a Fibonacci sequence defined by Fn = Fn−1 + Fn−2 , because the current
generation is always the sum of the previous generation and two generations ago. Since F1 = 1
and F2 = 1, we can fill out the chart as
2
Time (months)
Number of pairs
Start
1
1
1
2
2
3
3
4
5
5
8
6
13
7
21
5. 2.2.9. Suppose we start with one pair of baby rabbits, and again they create a new pair every
month, but this time let s suppose that it takes two months before a pair of bunnies is mature
enough to reproduce. Make a table for the fi rst 10 months, indicating how many pairs there
would be at the end of each month. Do you see a pattern? Describe a general formula for
generating the sequence of rabbit - pair c ounts.
Proof. This is a delayed Fibonacci sequence, where the recursion relation is now
Fn = Fn−1 + Fn−3 .
This is because there is a 2 month waiting period before they can begin to reproduce. Thus we
can fill out the table as
Time (months)
Number of pairs
Start
1
1
1
2
1
3
2
4
3
5
4
6
6
7
9
8
13
9
19
10
28
6. 2.2.20. Suppose you are about to begin a game of Fibonacci nim. You start with 500 sticks.
What is your fi rst m ove?
Proof. As suggested in the text, start by writing out the sequence of Fibonacci numbers:
1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, . . . .
We can write 500 as a sum of non-consecutive Fibonacci numbers, which we can try out and see
that it’s possible to do it as
500 = 377 + 89 + 34 .
We choose the smallest number in the sum first, which is 34, so that is our first move.
7. 2.3.9. The dividing line . Does a nonprime divided by a nonprime ever result in a prime? Does
it ever result in a nonprime? Always? Sometimes? Never? Explain your answers.
Proof. Consider prime powers, say 23 and 24 . Both 8 and 16 are not prime, but 24 /23 = 2 is
prime. This is true for any prime power pk+1 divided by pk .
A nonprime divided by a nonprime can also result in nonprimes: think about 2 × 3 × 4. This
number is not prime, and when divided by nonprime 4 it yields 2×3, which is not prime either.
8. 2.3.11 Are there infi nitely many natural numbers that are not prime? If so, prove it.
Proof. You can just consider the sequence of powers of any nonprime number: for instance,
consider 4, 42 , 43 , 44 , . . . . This is an infinite collection of nonprime numbers, hence there are
infinitely many nonprime natural numbers.
9. 2.3.25. Suppose a certain number when divided by 91 yields a remainder of 52. If we add 103 to
our original number, what is the remainder when this new number is divided by 7?
3
Proof. First, notice that 7 × 13 = 91. Call x the number that when divided by 91 we have a
remainder of 52. Since 91 divided by 7 gives a zero remainder, we also know that x divided by
7 gives a “remainder” of 52. But a remainder of 52 doesn’t make sense when dividing by seven,
since 52 = 7 × 7 + 3. So in fact, x divided by 7 gives a remainder of 3. Now, 103 = 7 × 14 + 5, and
so 103 divided by 7 gives a remainder of 5. Thus, x + 103 divided by seven has a “remainder” of
3 + 5 = 8. But since 8 = 7 + 1, x + 103 really has remainder 1 when divided by 7.
10. 2.3.34. Let A and B be two natural numbers. Suppose that the remainder when A is divided by
n is a , and the remainder when B is divided by n is b . How does the remainder when AB is
divided by n compare with the remainder when ab is divided by n ? Try some specifi c examples
fi rst. Can you prove your answer?
Proof. To see how this works, try A = 24 and B = 21 with n = 5. Then 24 = 5 × 4 + 4, so that
A has remainder a = 4 when divided by n, while B = 21 = 5 × 4 + 1 has remainder b = 1 when
divided by n. Now, A × B = 504 = 100 × 5 + 4 has remainder 4 = a × b when divided by n. So
we may think that AB has remainder a × b when divided by n. To prove this, since A/n has
remainder a, there is an integer k such that A = kn + a, and since B/n has remainder b, there
is an integer ` such that B = `n + b. Then
AB = (kn + a)(`n + b) = k`n + (a` + bk)n + ab = (k` + a` + bk)n + ab .
Thus we see that AB has remainder ab when divided by n. Now, if ab > n, then we can further
reduce ab: say that for some integer s we can write ab = sn + r, where 0 ≤ r < n, then we can
rewrite the above as
AB = (k` + a` + bk + s)n + r ,
so that both AB and ab have remainder r when divided by n.
4