Math 413 Exam 2

advertisement
Math 413 Exam 2
Apr 11, 2012
1. (10 pts) In a warehouse you obtain a 20% discount but you must pay a 15% sales tax. Which
would you prefer to have calculated first, discount or tax?
It does not matter, the result is the same. Let the original price of the item be p. If we
deduct the discount first then add the sales tax, the final price is (1.15)(0.8)p. If we add the
sales tax first and then deduct the discount, the final price is (0.8)(1.15)p. But
(1.15)(0.8)p = (0.8)(1.15)p
by the commutitavity of multiplication.
2. (5 pts each) Eric the sheep is at the end of a line of sheep waiting to be shorn. Being an
impatient sort of sheep, Eric sneaks up the line two places every time the shearer takes a
sheep from the front to be shorn. So for example, while the first sheep is being shorn, Eric
moves ahead so there are two sheep behind him in line. If at some point it is possible for
Eric to move only one place, he does that instead of moving ahead two places.
(a) If the line initially consists of 50 sheep including Eric, how many sheep get shorn before
Eric? Why?
So intially, Eric has 49 sheep in front of him. While one of these is shorn, Eric sneaks
ahead of another two. So he now has 46 sheep in front of him. And so it continues. Each
time, the number of sheep in front of Eric decreases by 3 while one sheep is shorn. This
happens 16 times until there is just one sheep in front of Eric. Now while this sheep is
shorn, Eric has no one to sneak around, so he just waits and is next to be shorn. So 17
sheep are shorn before Eric.
(b) If the line initially consists of n sheep including Eric, how many sheep get shorn before
Eric? Why?
The logic is the same as in part (a). We start with n − 1 sheep in front of Eric. That
number is decreased by 3 each time a sheep is shorn. This happens ⌊(n − 1)/3⌋ times,
where ⌊x⌋ stands for the floor of the number x, i.e. the largest integer that does not
exceed x. Now, if n − 1 is divisible by 3, then after exactly (n − 1)/3 rounds, there are
no sheep left in front of Eric, and he is next to be shorn. In this case (n − 1)/3 were
shorn before him. If n − 1 is not divisible by 3, then there will be one or two sheep left
in front of Eric in the end. In that case, one more sheep is shorn before Eric advances
to the head of the line. We can combine these cases together by saying that the number
of sheep shorn before Eric is (n − 1)/3, rounded up if not an integer. If you want a
formula, you can use the ceiling function, ⌈(n − 1)/3⌉. (The ceiling ⌈x⌉ of a real number
x is the smallest integer n such that x ≤ n.)
(c) What if Eric sneaks past 3 sheep at a time? Describe how to find the answer to part
(b) in this case.
No problem at all. The same argument works as in part (b), except now Eric advances
4 places each time. In the final round, he could have 0, 1, 2, or 3 sheep left in front of
him. If it is 0, he is next. If it is 1, 2, or 3, then one more sheep is shorn before he can
get to the front of the line. In any case, ⌈(n − 1)/4⌉ gives the right result.
(d) What if Eric sneaks past 4 sheep at a time? Describe how to find the answer to part
(b) in this case.
Nothing’s really new here, now the correct number is ⌈(n − 1)/5⌉.
3. (10 pts) Recall that a number is a palindrome if it reads the backwards as forwards. E.g.
275572 is a palindrome. Show that all 6-digit palindromic integers are divisible by 11.
A 6-digit palindromic number is of the xyzzyx where x, y, z are digits. The value of that
number is
x105 + y104 + z103 + z102 + y10 + x = 100001x + 10010y + 1100z.
Now notice
100001x + 10010y + 1100z = 11(9091x + 910y + 100z).
Since 9091x + 910y + 100z is integer, this shows that the number xyzzyx is a multiple of 11.
4. (10 pts) A piggy bank contains 100 coins. The coins consist of pennies, dimes, and half
dollars. Their total value is exactly $5. How many of each type of coin is in the piggy bank?
Find all possible solutions.
Suppose there are x half dollars and y dimes. Then there must be 100 − x − y pennies.
The value of all those coins in cents is 50x + 10y + (100 − x − y), which must be 500. This
gives us the following equation to solve:
50x + 10y + (100 − x − y) = 500
49x + 9y + 100 = 500
49x + 9y = 400
That is two unknowns and only one equation. But wait, we know x and y are integers. So
this is a Diophantine equation. We know how to solve linear Diophantine equations. In fact,
in this case, we even know 0 ≤ x ≤ 10 and 0 ≤ y ≤ 50. I will use the same algorithm I
showed you in class:
49x + 9y = 400
4 − 4x
400 − 49x
= 44 − 5x +
y=
9
9
Since x and y are integers, (4 − 4x)/9 must be some integer k too. So
4 − 4x
9
9k = 4 − 4x
k
4 − 9k
= 1 − 2k −
x=
4
4
Since x and k are integers, k/4 must be some integer n. Hence
k=
k
400 − 49x
= 1 − 9n =⇒ y =
= 39 + 45n.
4
9
Now since 0 ≤ x ≤ 10, n = 0 or n = −1. But n = −1 would make y < 0. So n = 0, x = 1
and y = 39. That is the only solution is that the piggy bank contains one half dollar, 39
dimes, and 60 pennies.
k = 4n =⇒ x = 1 − 2k −
5. (10 pts) As Mr. Callahan was reviewing his students’ work from the day’s lesson on multiplication, he noticed that Todd had invented an algorithm that was different from the one
taught in class. Todd’s work looked like this:
983
6
488
+ 5410
5898
×
What is Todd doing here? Is his a valid algorithm for multiplying numbers?
Notice that what Todd is doing is that he is multiplying each digit of 983 by 6, then he
is writing the resulting numbers (18, 48, and 54) down so that their ones digit goes in its
correct place in the first row, and the tens digit in the second row, shifted to the left by one
place value. So he puts every digit in the correct place according to its place values. Now he
adds the two numbers. That he gets the correct result is not a coincidence, it is because he
follows a correct–if nonstandard–algorithm. If you want to see this spelled out in a different
form, here it is:
(983)(6) = (9 · 102 + 8 · 10 + 3)(6)
= (54 · 102 + 48 · 10 + 18)
2
2
40 · 10 + 10})
= (4
| · 10 + {z
| · 10 +{z8 · 10 + 8}) + (50
488
5410
= 5898
Todd’s algorithm is based on the same two basic concepts as the standard long-hand multiplication algorithm: the distributive law and place value. Incidentally, this question is a
released item from the Learning Math for Teaching test for middle school teachers, which
measures the kind of specialized math content knowledge a middle school teacher should
have.
6. (10 pts) Extra credit problem. Let m and n be positive integers. How many squares
can you find on an m by n chessboard? A square is any square region whose sides are the
gridlines on the board. E.g. here is a 2 by 2 square on a 5 by 4 chessboard.
This problem can be solved the same way we counted the squares on an 8 by 8 chessboard
in class. We can count the number of places where we could put the upper left corner of a k
by k square on the chessboard. An m by n chessboard is a grid of m + 1 vertical and n + 1
horizontal lines. The vertices of this grid are potential places to put the upper left corners
of squares. But they don’t all work. For example, the upper left corner of a 1 by 1 square
could not be on the rightmost vertical or bottom horintal line. So it can be in mn places.
The upper left corner of a 2 by 2 square could not be on the two rightmost vertical lines
or on the two bottom lines. This leaves (m − 1)(n − 1) places for it. Etc. Without loss of
generality, we may assume m ≤ n. Otherwise we can just turn the chessboard by 90◦ . So
the largest square on the board is m by m. The following sum gives the number all squares
on the board:
mn + (m − 1)(n − 1) + (m − 2)(n − 2)
+ · · · + 1(n + 1 − m) =
m
X
(m + 1 − i)(n + 1 − i).
i=1
This is a good enough answer. If you want a closed formula, here is what you can do.
mn + (m − 1)(n − 1) + · · · + 1(n + 1 − m) =
= 1(n − m + 1) + 2(n − m + 2) + · · · + m(n − m + m)
= 1(n − m) + 12 + 2(n − m) + 22 + · · · + m(n − m) + m2
= (n − m)(1 + 2 + · · · + m) + 12 + 22 + · · · + m2
Now, you know how to find the sum of an arithmetic series
m(m + 1)
1 + 2 + ··· + m =
2
and you may perhaps know that the sum of the first m perfect squares is
m(m + 1)(2m + 1)
.
12 + 22 + · · · + m2 =
6
So the number of squares on an m by n chessboard is
m(m + 1)(3n − m + 1)
m(m + 1) m(m + 1)(2m + 1)
+
=
.
(n − m)
2
6
6
Download