# CS2500: Problem Set 1

## Due: Wednesday, January 20 at 4:35 PM

Please Note: This assignment is to be completed individually, not in pairs. You will begin working with your partner for Problem Set 2.

#### Purpose

The goal of this problem set is to refresh pattern matching skills that should already be familiar to you. In particular, the ability to perceive a pattern and formulate a rule to describe the pattern is necessary for being a efficient web site administrator, computer programmer, analyst, etc.

#### Problems

1. The NASA space probe New Horizons, en route to Pluto, stalled while passing Jupiter. Objects falling on Jupiter accelerate at 23 m/s2, like this:

 after t = 0 1 2 3 4 ... 10 ... 15 seconds it has traveled 0 11.5 46 103.5 184 ... ?? ... ?? meters

Guess a formula for calculating how far New Horizons will fall in t seconds. (For physicists: ignore the change in gravity that results from changing elevation, as well as other implausible assumptions.)

Check the formula for the first five table entries. If the formula doesn’t work, guess again until you find one that does.

Once the formula works for the first five entries, use it and DrScheme’s Interactions Window (as a calculator) to fill in the two boxes with ?? in the above table.

2. The City of Boston regulates taxi fares, setting two kinds of rates: there are meter fares for most pickups, and flat-rate fares for known distances such as rides from hotels to the airport. The flat rates are set as follows: The base fare for any ride is \$2.60, and it costs \$3.20 per mile of travel.

How much does a 1/2 mi. ride cost? How about 1 mi.? 2 mi.?

Make a table that shows the fare for distances of 0.5 mi., 1 mi, 1.5 mi, 2 mi., ..., 5 mi.

Create a formula for calculating fares from trip distances.

Use the formula to determine the fare for a trip from Northeastern University to Logan Airport, 7.5 miles away.

3. To supplement my meager teaching income, I shovel snow for some of my neighbors. For shoveling a sidewalk and driveway, I charge each neighbor \$10 per job plus \$5 per inch of snowfall to be shoveled.

How much do I get paid if I shovel for one neighbor after a storm that drops 1 inch of snow? What if 4 neighbors hire me after a blizzard puts down 14 inches?

Make a table that shows my income in terms of both inches of snow and the number of neighbors that hire me. (The table should have at least 9 values.)

Create a formula for calculating how much I earn if I shovel d inches of snow for each of n neighbors.

Use the formula and the Interactions Window in DrScheme to find out how much I earn after an unlikely 4 feet of snow when hired by 12 neighbors.

4. Blackjack Pasta Bar (across the fens from NU, at 52 Queensberry St.) offers ravioli with 3 fillings (ricotta, butternut squash, lobster) with a choice of 3 sauces (tomato, cream, wild mushroom). Suppose that one wants to try all possible combinations of one kind of ravioli and with one kind of sauce. Figure out and enumerate (list) all possible combinations. Explain how you arrived at this result.

#### Turn In

Please turn this problem set on paper to the instructor at the beginning of lecture on Wednesday, January 20, following the paper submission instructions. You may type or handwrite it, so long as it’s legible.

Last updated 14 January 2010.