COS 109: Problem Set 4

Tue Oct 14 14:59:07 EDT 2014

Due 5:00 PM, Wednesday, Oct 15, in the box outside Room 311, CS building, or in class. Answers need not be long, merely clear so we can understand what you have done. Please submit typed material, not hand-written, if at all possible, and keep a copy for yourself just in case something goes astray. Thanks.

Collaboration policy for COS 109: Working together to really understand the material in problem sets and labs is encouraged, but once you have things figured out, you must part company and compose your written answers independently. That helps you to be sure that you understand the material, and it obviates questions of whether the collaboration was too close.

You must list any other class members with whom you collaborated.

 

1. The Rule of 72

The "Rule of 72" is a very useful rule of thumb for estimating the effects of compounding, where some quantity grows by a fixed percentage in each of a series of identical time periods. The rule of 72 says that if a quantity is compounding at x percent per time period, it will double in approximately 72/x periods.

For example, if gas prices are rising 8% per year, in 72/8 or 9 years a gallon of gas will cost twice as much as it does today. But if prices are only rising 6% per year, doubling will take 72/6 or 12 years. Conversely, if the doubling time is given, you can compute the number of periods by dividing 72 by the rate: if something doubles in 10 years, the rate is 72/10, or about 7% per year. The approximation breaks down if the rate is too high, but it's good enough for typical values. (The web site given above has a good explanation of how it works, and a simple Javascript implementation that you might enjoy looking at. But don't use it to do the calculations below, and don't use your calculator; this problem is about learning to do your own arithmetic in your head.)

(a) Moore's Law is often expressed as "capacity doubles every year and a half." What is Moore's Law expressed as a percentage growth per month?

(b) Suppose that 25 years from now, you're trying to send your kids to Princeton and you discover that the tuition has quadrupled from what it is now. Approximately what annual rate of tuition increase would that correspond to? (Warning to prospective Princeton parents: college tuition rises much faster than inflation. Start saving.)

(c) Princeton's rate of return on its endowment investments was about 12% in 2013. Past performance certainly does not guarantee future results, but if this rate were to continue, roughly what would the value of today's $18B endowment be 25 years from now? (This assumes that nothing is spent from the endowment, which of course is not true.)

(d) But Princeton's rate of return in the previous recent fiscal year, was only 3.1%. Suppose that the endownment returns 3% annually for the next 25 years. What then will be the value of today's $18B endowment in 25 years?

(e) A NY Times story (11/7/07) says that total power consumption by Internet servers is doubling about every 6 years. Suppose that Internet servers used 10 gigawatts in 2007 and 20 gigawatts in 2013. How fast is power consumption growing per month?

(f) Suppose (improbably) that this power consumption continues to double at the same rate. In what year will servers consume 10 terawatts?

(g) An NPR story (10/3/08) states that getting 20% interest for five years doubles your money. Right or wrong, and why?

 

2. Estimation

Here are a few estimation problems for practice. Try to do them in your head or with pencil and paper before grabbing the calculator.

(a) "π seconds is a nanocentury." Too high, too low, or just about right, and why?

(b) "Sound travels about one foot in a millisecond." The speed of sound at sea level is about 340 meters/second. Is the quoted speed too high, too low, or just about right, and why?

(c) I was at an over-crowded cocktail party recently, and it started me wondering... Suppose that 10,000 people come to the same party. If they arrange themselves in a square (to make the arithmetic easier), what would be the approximate dimensions of the square? State clearly how much space you estimate that each person will occupy.

(d) Approximately what fraction of the football field at the stadium would they occupy? (Note for non-football types: the field is 100 yards long and 50 yards wide.)

(e) How does the width of the square depend on N, the number of people in it?

(f) [bwk, 10/14/14: This question doesn't make any sense when read carefully. Ignore it.] In The Information (p 127), James Gleick describes a Benjamin Franklin experiment in the 1700s "employing a Leyden jar and iron wire to send a shock through two hundred Carthusian monks arranged in a circle one mile around." How long is the arm of an average monk? How long is your arm?

(g) "In 1988 we used 2 billion pounds of HDPE [high density polyethylene] just to make bottles for household products. That's about the weight of 90,000 Honda Civics." [http://www.clemcorecycle.com/recycling_facts.htm] Approximately how much does a Honda Civic weigh, according to these numbers? Without looking it up, what do you think a Honda Civic weighs?

 

3. How do you get to Carnegie Hall? Practice, practice, practice.

A lot of problem set and exam questions are basically the same thing: how many bits does it take to hold numeric values up to a maximum value (number of freshmen, number of undergrads, number of cars, number of people, number of instructions, ...). These are all the same question! Figure out how many things there are, then figure out what's the smallest power of two that is at least that big. That's the minimum number of bits needed to assign a distinct bit pattern to each item. This power is also the log base 2 of the original number (rounded up to an integral value). The number of bytes is just the number of bits divided by 8, but rounded up (no fractional bytes).

For these practice questions, it is highly recommended that you work out the answer by using familiar powers of two, not by reaching for your calculator.

(a) How many bits and how many bytes for

  1. 7.2 billion people
  2. 320 million Americans
  3. 35 million Canadians
  4. 500,000 people at the Simon and Garfunkel concert in Central Park
  5. $98,000 median household income in Princeton (2012)
  6. 37,000 New York City marathoners
  7. 5,200 Princeton undergrads
  8. 535 members of Congress
  9. 193 countries in the United Nations
  10. 70 students in COS 109

(b) Going the other way, the number of bits determines how many different things could be encoded with that number of bits, though "bits" is often disguised, for instance as dots and dashes in Morse code, or fingers of a hand, or miles on a binary odometer. The number of different things you can encode with N bits is 2N, but the encoded values will start at 0 (all zeros) and go up to 2N-1 (all 1's).

For each integer N from 1 to 10, state how many things could be encoded with N bits, and give a plausible real-world example of some set of things that would require at least N bits but not N+1 bits. For example, for N=1, male/female; for N=2, frosh/soph/junior/senior. Your sets do not have to contain exactly 2N items. (The list in part (a) should give you ideas.)