CS 2104 OOC 2 Summer 2014 ------------------------------------------------------------------------------- 1. Given: FORTY TEN TEN ----- SIXTY Y + N + N equals either Y or Y + 10; so N is either 0 or 5. The carry out of column 1 is either 0 or 1, so we have: carry = 0: T + E + E = T or T + 10 and so E is either 0 or 5 carry = 1: 1 + T + E + E = T or T + 10, but neither is possible since 2E would have to be -1 or 9. Since the carry from column 1 must be 0, N = 0 and E = 5: FORTY T50 T50 ----- SIXTY There must be a carry into (and out of) the fourth column, so O + 1or2 equals I + 10, and O is either 8 or 9. But I cannot be 0 (already used), so O + carry must yield 11 and I must be 1, and therefore O must be 9 and the carry from column 3 must be 2. F9RTY T50 T50 ----- S1XTY 2 3 4 6 7 8 Now, 1 + R + 2T = X + 20. Since R + 1 cannot be larger than 9, 2T >= X + 11 and so X cannot be 6, 7 or 8. X = 4 --> T = 8 and R = 7 X = 3 --> T = 7 and R = 8 8 and R = 6 X = 2 --> T = 7 and R = 7 nope, already used 7 8 and R = 5 nope, already used 5 So T is 7 or 8 in any case, and X is 3 or 4. There must be a carry into the last column from the fourth column, and that carry can only be 1, so S = F + 1. S = 8 --> F = 7 nope, contradicts T being either 7 or S = 7 --> F = 6 and T = 8 nope, R must then be 6 or 7 S = 4 --> F = 3 and X = 2 nope, from above S = 3 --> F = 2 and X = 4 and T = 8 So S is 3 and F is 2, and X is 4 and 5 is 8, and Y must be 6. 29786 850 850 ----- 31486 2. Under the original asking price, the cook would have paid 12 cents for an unknown number of eggs, let's say it was N dozen. Then she paid 12/N cents per dozen eggs. But, she actually paid 12 cents for N dozen plus 2 eggs, which is N + 1/6 dozen. That made her actual cost 12/(N + 1/6) cents per dozen. And we are told that was 1 cent less per dozen, so we must have that 12/N - 1 = 12/(N + 1/6) and a little algebra reveals that N must be 1 1/2, so she got 18 eggs. 3. It's a bit of a trick. If the books are arranged as described on the shelf, page 1 of Book 1 is on the RIGHT side of the book, and so the worm doesn't eat any pages from Book 1 at all. On the other hand, the worm eats all the way through Books 1 through 6 (The End of the Third Age). And when it reaches the Appendix, page 1 of that is also on the right side, so the worm will eat all through all but one page of the Appendix. So the total number of pages the worm eats through would be 253 + 252 + 189 + 197 + 182 + 188 or 1261. 4. This is obviously a pigeonhole problem. If the team member did have a shoebox that was 4x6x12 inches, how many of them would it take to fill the utility shed? We could fit 72 x 36 x 9 = 23328 of them into the shed, packing them as efficiently as possible. (Since the boxes would fill the utility shed exactly, we don't have to consider different ways of orienting them.) Now, to guarantee there would be a box-sized volume that held at least 10 flies, the number of flies would have to be at least 9 x 23328 + 1, or 209,953. You might also argue this would still not make the claim reasonable, since the shoebox would have to be in just the right place. It might be more reasonble to argue that EVERY shoebox-sized volume would have to hold at least 10 flies. But... we'd need to have some facts about the dimensions of a greenbottle fly in order to complete that argument.