COS 109: Problem Set 2

Tue Sep 10 09:18:00 EDT 2024

Due midnight, Wednesday Sep 18.

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.

Problem set answers need not be long, merely clear enough that we can understand what you have done, though for computational problems, show enough of your work that we can see where your answer came from, and perhaps offer partial credit. There is no need to repeat the question. Thanks.

And a couple of reminders from the first problem set...
Don't forget that if the data you start with is approximate, the results cannot be precise.
Don't use Google or other search engines, and don't use ChatGPT or similar generative AI programs. You will learn a lot more if you do the work yourself.
 

The world is full of big numbers, some of which mean something, but most people have no understanding or intuitive grasp of how big such numbers are, nor are they comfortable doing arithmetic on them. The purpose of this problem set is to get you to work with some big numbers. In these problems, and in the course in general, it's much better to use exponents like 1015 rather than words like "quadrillion" or long decimal numbers like 100000000000000; exponents are far easier to read and compute with, so you are less likely to make arithmetic errors. It's also easier for us to grade answers if you use scientific notation -- we don't have to count long strings of zeros.

Pay attention to units. In this course we will follow the standard convention that B is for bytes, b is for bits, and one byte is eight bits. So, 1 Gb is one gigabit and 1 GB is one gigabyte; 1 Gbps represents a transfer rate of 1 gigabit per second, abbreviated Gbps or Gb/sec or Gb/s.
 

1. Big Data, Big Numbers

Companies like Google and Facebook have multiple data centers that store replicated copies of their information, for example, all your searches and posts and pictures and transactions and locations (indeed, a scary amount). If a company builds a new data center, it must clone the data from an existing data center. Suppose that Google has 1 exabyte (EB) of Google Maps data. (I made up this number, but it's probably ok within a factor of ten in either direction.)

(a) Approximately how many days would it take to send the Google Maps data to a new data center over a 100 GB/sec data link?

(b) If instead you were to store 1 EB of data on 256GB micro SD cards like the ones in phones and cameras, and carry them by truck from California to New York, what is the approximate transfer rate in GB/sec? Make your own estimate of driving time from San Francisco to New York City first, then check it with Google Maps if you like.

(c) How many trucks like this one would you need to hold the SD cards?

(d) How much would the SD cards cost? To save you a trip to the web, here's one option from Amazon:

(e) Of course, you have to put the 1 EB of data on the SD cards before you ship them. The picture says the card has a transfer rate of 130 MB/s. Very roughly, how long would it take to write 1 EB on the cards? (Ignore the time it takes to put the cards into some writing device and them take them out again.)

(f) If a homing pigeon takes two hours to carry a 256GB micro SD card from Princeton to New York, what is its approximate throughput in MB/s? (This is not a new idea; check out this famous Internet standard on avian carriers.)

2. Powers of 2, powers of 10

Paper maps have pretty much disappeared from daily life, but you've surely seen them, and you're familiar with map scales.

The comedian Steven Wright says "I have a map of the United States...actual size. It says, 'Scale: 1 mile = 1 mile.' I spent last summer folding it."

(a) Suppose for simplicity that the map is 4000 km by 4000 km. How many times would you have to fold it in half to make it into a 1 meter by 1 meter square? (Ignore the practical reality that you can't fold a piece of paper more than a few times -- this is a gedanken experiment.)

(b) If the original map is made of standard paper, 0.1 mm thick, approximately how thick will the folded map be, in meters?

(c) Is the estimate of 0.1 mm for paper thickness much too high, much too low, or about right, and why? (You can make your own estimate by observation near printers.)
 

3. Bits, Bytes and Binary

"There are only 10 types of people in the world: those who can read binary and those who can't."


© Bill Amend, Foxtrot

This problem is a combination of estimation (how many cars are there in the US?) and converting decimal numbers into binary. If you are not yet comfortable with bits, bytes and binary numbers, check out the practice problem program. It's a couple of short Python examples that you can run directly, and can modify yourself if you make a copy of the notebook. Check out Chapter 7 of UDW for more info on Colab notebooks.

Get some practice on how many bits and bytes it takes to represent numbers of various sizes, then answer these questions.

(a) An electronic car door key and its car must share some unique identification number so that my key won't unlock your car and vice versa. Roughly how many bits would be needed to provide each car in the United States with a unique identification number? Briefly explain your reasoning.

(b) Exactly how many bytes would this number require? [Note: there are no fractional bytes; it's always an integral number.]

(c) Suppose we include Canadian cars. How many bytes would now be required?

(d) While we're talking about binary numbers, here's a question about smaller numbers and how they are represented with real digits. What range of numbers can you represent with the fingers and thumbs of two hands if you treat each finger and thumb as a binary digit?

(e) What is the range if you include toes as well as fingers? Ignore the fact that unless you are unusually dexterous, you can't move your toes independently.

Submission

Please use this Google Doc for your answers. It would be a great help if you could type your answers so I can read them, but if you prefer to write by hand, that's OK as long as you are exceptionally neat.

Either way, convert your answers to PDF and submit them by uploading a file called pset2.pdf to Gradescope. You can submit as many times as you like; we'll only look at the last one.