A B C D EHomework

Solutions for Session 2, Homework

See solutions for Problems: H1 | H2 | H3 | H4

Problem H1

 a. Although there are not many entries in the table, one possible pattern is that each output number is 1 more than the square of each input number. b. One formula is O = n2 + 1, where n is the input number. Others are possible. c. If the table's pattern continues as expected, the formula gives O = 1002 + 1 = 10,001. Other answers are possible with other patterns. d. If the table's pattern continues, 102 will never appear. The 10th entry will be 101, and the 11th entry will be 122. (Why can't 102 appear later, or earlier, in the table?) Of course, the table lends itself to many other possible patterns, and some of these may include the number 102. For example, the list may include only those positive numbers that end in 2, 5, or 0, in which case 102 will be the 31st number in the list.

Problem H2

Mr. Lewis is making things a lot more difficult than they need to be! Here's the analysis on the number n:

 1 n * n = n2, multiplied by 6 is 6n2 2 6n2 plus 6 is (6n2 + 6) = A 3 The result here is n2 + 11 = B 4 The result here is 5n = C 5 B * C = (n2 + 11) * 5n = 5n3 + 55n, divided by 6 gives (5n2 + 55n) / 6 = D 6 The final answer is 6n2 + 6 - (5n3 + 55n) / 6. This value cannot be simplified, because it does not have any variables with the same exponent.

Let's look at a table for Mr. Lewis's rule for small values of n and compare it to the table for O = n2 + 1.

 Input(n) Output(n2 + 1) Mr. Lewis's Rule 1 2 6 + 6 - 10 = 2 2 5 24 + 6 - 25 = 5 3 10 54 + 6 - 50 = 10 4 17 96 + 6 - 90 = 12 5 26 150 + 6 - 150 = 6 10 101 600 + 6 - 1750 = -1144

As you can see from the table, Mr. Lewis's rule generates the three numbers we were given in the table, but begins to veer away from the table's values quickly. By n = 10 there is a drastic difference in the values from the two rules. This doesn't make Mr. Lewis's rule wrong, but it is definitely not the simplest rule that generates the table's values.

Problem H3

 a. Here is the completed table. There is only one way to complete the table, because we are trying to find the shortest time it will take the frog to escape the well. Therefore, there can only be one shortest time to put into the table.

 Height of well Time it takes to get out 1 1 minute 2 1 minute 3 1 4 1 5 3 6 3 7 5 8 5 9 7 10 7 11 9 12 9 13 11 14 11 15 13 16 13 17 15

Three observations: First, the values are all 1 minute until the well is 6 meters deep, because the frog can climb 5 meters in the 1st minute. Second, the times to climb out are all odd numbers, because it takes 2 minutes before the frog will climb again. Third, the times occur in pairs, because the difference between the frogıs jumping distance and sliding distance is 2 meters. This means that it wonıt matter if the frog needs to make 6 meters or 7 meters, because it will make either in 2 jumps.

 b. A 30-meter climb will take 27 minutes. A 100-meter climb will take 97 minutes. A 103-meter climb will take 99 minutes. Poor frog. c. According to the table, the well could have been either 16 or 17 meters deep.

Problem H4

a.

This extension will change the way the table is constructed. The first 6 meters will all take 1 minute, the next 4 will take 3 minutes, the next 4 will take 5 minutes, and so forth. This happens because the frog gains 4 meters in each 2-minute cycle of jumping and resting. So it will take 24 2-minute cycles for the frog to get within the 6-meter range for its escape, and it will take a total of 49 minutes for the frog to make it all the way out of a 100-meter well.

b.

Now the frog will take only 1 minute to escape if the well is n meters or less, and each extra minute the frog can climb (n ­ 2) more meters. The full formula here requires the greatest integer function, but a quick calculation would be to subtract 2, divide by (n ­ 2), round the answer up to the nearest whole number, double it, then subtract 1. The subtraction by 2 is done because the frog doesnıt slip right away, and the dividing by (n ­ 2) is done because it is the total height gained by the frog in one cycle of climbing and slipping. The doubling is done because one cycle takes 2 minutes, and the subtracting by 1 is done because the frog doesnıt slip in the cycle that he manages to escape.

c.

Let's call the climbing rate C, the slippage rate S, and the height H. It's pretty difficult to create a formula for T, the time for the frog to escape, but first a few observations:

 • If the given height H is less than or equal to C, the answer should be 1 minute. • Every 2 minutes after the first, if the frog is still stuck, it gains (C - S) meters.

This means that we'll need to calculate (H - C) / (C - S) to find how many 2-minute cycles the frog will need to go through to get within C meters of the top, then 1 more minute to escape. Additionally, because (H - C) / (C - S) often gives a fraction, we have to include instructions to round that number up to the next integer. (This is usually called the "ceiling" function, and is denoted by the oddly shaped brackets seen below. We used this function when we talked about Eric the Sheep.) Additionally (!), because (H - C) might be negative, we have to make an exception for those times that the frog can just hop on out. So, having done all that, here's the formula for T, the time that it takes the frog to escape:

Test it out on the previous problems if you like.

 Session 2: Index | Notes | Solutions | Video