## More Snow for Boston, Says Calculus

In a recent Huffington Post article I calculated the probability that Boston will get even more snow than its current historical record. The function I ended up with was

$P(s)=e^{-0.079s}, \$

where is the additional inches of snow beyond the 45.5 inch record set on Saturday (February 15th). Let me explain how I got that function.

### First, Some Background in Probability

Let’s start with some basics. The total snowfall in any given month is a variable. But it’s not your “usual” kind of variable, it’s what we mathematicians call a “continuous random variable.” These type of variables have a function associated with them—called a “probability density function” or “PDF”—that tells us the probability that the random variable’s value will fall within a certain range (the “continuous” part means that the values of the random variable can be any real number). In our case the random variable of interest is the total snowfall in February in Boston, which I’ll denote by S, and it’s associated PDF, which I’ll denote by p(x). Then the probability that S is between, say, 45.5 inches and 45.5+h, where h is small (like, way less than 1), is approximately

$P(S=45.5) \approx p(45.5)h. \$

To approximate the probability that S is between, say, 45.5 and 46.5 we’d need to add up many terms like the one on the right-hand side. One such approximation is

$P(45.5 < S \leq 46.5) \approx p(45.5)(0.1)+p(45.6)(0.1)+\ldots+p(46.4)(0.1). \$

(This is the case when all h’s are equal to 0.1). If we want the exact answer we’d need to add up infinitely many terms, each corresponding to an h-value that is infinitesimally small. The way we do that in calculus is by integrating. So, in calculus speak,

$P(45.5

### Now Back to Boston’s Snowy Month

If you’ve made it this far one thing is clear: we can’t calculate anything without the PDF. That’s where the data linked above comes in. By downloading the total snowfall column in the data into a spreadsheet we can create the histogram below.

This histogram tells us how frequently (in the 95 years between 1920 and 2014) the Feburary snowfall total was between 0 and 5 inches, 5 and 10 inches, etc. (For example, the first bar says that the total snowfall was between 0 and 5 inches 26% of that time.) The black curve is the exponential function

$f(x)=0.511e^{-0.079x}, \$

where is the total snowfall (in inches). This curve is Excel’s best fit to the data. It’s not perfect, but it does a better job than other fits (like a linear function).

To make f(x) into a PDF we need to make sure that the probability that S is between zero and infinity is 1. (Roughly speaking, this expresses the fact that all probabilities must add to 1.) In calculus jargon, this means that we first need to calculate the integral of f(x) between zero and infinity and then divide f(x) by that value. And since

$\displaystyle\int_{0}^{\infty}0.511e^{-0.079x}\,dx=\frac{0.511}{0.079} \approx 6.416. \$

Our PDF—which I’ll call p(x)—is therefore

$p(x)=\frac{f(x)}{6.416}=0.079e^{-0.079x}. \$

(This is the PDF of an exponential distribution, a well known PDF from probability theory that has many applications to business, physics, and engineering—see here for more.)

We’ve found our PDF…woohoo! We can now calculate the probability that S—the total snowfall amount in February in Boston—will be between zero and some other number y. As before, that’s just the following integral:

$P(0 \leq S \leq y) = \displaystyle\int_{0}^{y}0.079e^{-0.079x}\,dx. \$

This is a pretty straightforward integral to calculate using a technique called u-substitution. The answer is

$1-e^{-0.079y}. \$

We’re almost done, I promise. The last step is to use the fact that 45.5 inches have already fallen. So, given that 45.5 inches of snow have already accumulated, what is the probability that s more inches will fall? Well, if we denote by y the total snowfall (i.e., y=s+45.5), then in math-speak we want to calculate

$P(S>y|S>45.5). \$

This is an example of a “conditional probability,” and by the laws of probability, this simplifies to

$1-P(S \leq y|S>45.5)=1-\frac{P(45.545.5)}, \$

and in terms of integrals becomes

$1-\frac{\displaystyle\int_{45.5}^{y}0.079e^{-0.079x}\,dx}{e^{-0.079(45.5)}}. \$

Finally, calculating and simplifying gives

$1-\frac{e^{-0.079(45.5)}-e^{-0.079y}}{e^{-0.079(45.5)}}=e^{-0.079(y-45.5)}=e^{-0.079s}. \$

This is the P(s) formula I gave at the start of the article. It’s amazing what the internet, math (oh, and Excel) can accomplish. Pretty neat huh?

## 6 Free to Low-Cost Resources to Teach You Calculus in a Fun and Interactive Way

(This post originally appeared in Huffington Post’s Education section.)

Calculus. There, I said it. If your heart skipped a beat, you might be one of the roughly 1 million students–or the parent of one of these brave souls–that will take the class this coming school year. Math is already tough, you might have been told, and calculus is supposed to be the “make or break” math class that may determine whether you have a future in STEM (science, technology, engineering, or mathematics); no pressure huh?

But you’ve got a little under two months to go. That’s plenty of time to brush up on your precalculus, learn a bit of calculus, and walk in on day one well prepared–assuming you know where to start.

That’s where this article comes in. As a math professor myself I use several free to low-cost resources that help my students prepare for calculus. I’ve grouped these resources below into two categories: Learning Calculus and Interacting with Calculus.

Learning Calculus.

This online site from Paul Dawkins, math professor at Lamar University, is arguably the best (free) online site for learning calculus. In a nutshell, it’s an interactive textbook. There are tons of examples, each followed by a complete solution, and various links that take you to different parts of the course as needed (i.e., instead of saying, for example, “recall in Section 2.1…” the links take you right back to the relevant section). I consider Prof. Dawkins’ site to be just as good, if not better, at teaching calculus than many actual calculus textbooks (and it’s free!). I should also mention that Prof. Dawkins’ site also includes fairly comprehensive precalculus and algebra sections.

2. Khan Academy–short video lectures (free).

A non-profit run by educator Salman Khan, the Khan academy is a popular online site featuring over 6,000 (according to Wikipedia) video mini-lectures–typically lasting about 15 minutes–on everything from art history to mathematics. The link I’ve included here is to the differential calculus set of videos. You can change subjects to integral calculus, or to trigonometry or algebra once you jump onto the site.

One of the earliest institutions to do so, MIT records actual courses and puts up the lecture videos and, in some cases, homeworks, class notes, and exams on its Open Courseware site. The link above is to the math section. There you’ll find several calculus courses, in addition to more advanced math courses. Clicking on the videos may take you to iTunes U, Apple’s online library of video lectures. Once there you can also search for “calculus” and you’ll find other universities that have followed in MIT’s footsteps and put their recorded lectures online.

4. How to Ace Calculus: The Streetwise Guide, by Colin Adams, Abigail Thompson, and Joel Hass ($18.29 from Amazon.com). If you’re looking for something in print, this book is a great resource. The book will teach you calculus, probably have you laughing throughout due to the authors’ good sense of humor, and also includes content not found in other calculus books, like tips for taking calculus exams and interacting with your instructor. You can read the first few pages on the book’s site. Interacting with Calculus. 1. Calculus java applets–online interactive demonstrations of calculus topics (free). There are many sites that include java-based demonstrations that will help you visualize math. Two good ones I’ve come across are David Little’s site and the University of Notre Dame’s site. By dragging a point or function, or changing specific parameters, these applets make important concepts in calculus come alive; they also make it far easier to understand certain things. For example, take this statement: “as the number of sides of a regular polygon inscribed in a circle increases, the area of that polygon better approximates the area of the circle.” Even if you followed that, text is no comparison to this interactive animation. One technological note: Because these are java applets, some of you will likely run into technology issues (especially if you’re on a Mac). For example, your computer may block these applets because it thinks that they are malicious. Here is a workaround from Java themselves that may help you in these cases. 2. Everyday Calculus, by Oscar E. Fernandez ($13.99 to \$18.60 from Amazon.com).

Self-promotion aside, calculus teachers often sell students (and parents) on the need to study calculus by telling them about how applicable the subject is. The problem is that the vast majority of the applications usually discussed are to things that many of us will likely never experience, like space shuttle launches and the optimization of company profits. The result: math becomes seen as an abstract subject that, although has applications, only become “real” if you become a scientist or engineer.

In Everyday Calculus I flip this script and start with ordinary experiences, like taking a shower and driving to work, and showcase the hidden calculus behind these everyday events and things. For example, there’s some neat trigonometry that helps explain why we sometimes wake up feeling groggy, and thinking more carefully about how coffee cools reveals derivatives at work. This sort of approach makes it possible to use the book as an experiential learning tool to discover the calculus hidden all around you.

With so many good resources it’s hard to know where to start and how to use them all effectively. Let me suggest one approach that uses the resources above synergistically.

For starters, the link to Paul’s site takes you to the table of contents of his site. The topic ordering there is roughly the same as what you’d find in a calculus textbook. So, you’d probably want to start with his review of functions. From there, the next steps depend on the sort of learning experience you want.

1. If you’re comfortable learning from Paul’s site you can just stay there, using the other resources to complement your learning along the way.

2. If you learn better from lectures, then use Paul’s topics list and jump on the Khan Academy site and/or the MIT and iTunes U sites to find video lectures on the corresponding topics.

3. If you’re more of a print person, then How to Ace Calculus would be a great way to start. That book’s topics ordering is pretty much the same as Paul’s, so there’d be no need to go back and forth.

Whatever method you decided on, I still recommend that you use Paul’s site, the interactive java applets, and Everyday Calculus. These three resources, used together, will allow you to completely interact with the calculus you’ll be learning. From working through examples and checking your answer (on Paul’s site), to interacting directly with functions, derivatives, and integrals (on the java applet sites), to exploring and experiencing the calculus all around you (Everyday Calculus), you’ll gain an appreciation and understanding of calculus that will no doubt put you miles ahead of your classmates come September.

## These Two Numbers Make Spring Possible (and the other seasons too)

(This post originally appeared on Princeton Press’ blog.)

March 20th. Don’t recognize that date? You should, it’s the official start of spring! I won’t blame you for not knowing, because after the unusually cold winter we’ve had it’s easy to forget that higher temperatures are coming. But why March 20th, and not the 21st or the 19th? And while we’re at it, why are there even seasons at all? Read on to find out the answers.

The answer has to do with 2 numbers. Don’t worry, they’re simple numbers (not like pi [1]). Stick around and I’ll show you some neat graphs to help you understand where they come from, and hopefully entertain you in the process too.

The first star of this show is the number 92 million. No, it’s not the current Powerball jackpot; it’s also not the number of times a teenager texts per day. To appreciate its significance, have a look at our first chart:

That first planet on the left is Mercury. It’s about 36 million miles away from the sun and has an average surface temperature of 333o. (Bring LOTS of sunscreen.) Fourth down the line is the red planet, Mars. At a distance of about 141 million miles from the sun, Mars’ average temperature is -85o. (Bring LOTS of hot chocolate.) We could keep going, but the general trend is clear: planets farther away from the sun have lower average temperatures [2].

If neither 333o nor -85o sound inviting, I’ve got just the place for you: Earth! At a cool 59o this planet is … drumroll please … 92 million miles from the sun.

We actually got lucky here. You see, it turns out that a planet’s temperature T is related to its distance r from the sun by the formula , where k is a number that depends on certain properties of the planet. I’ve graphed this curve in Figure 1. Notice that all the planets (except for the pesky Venus) closely follow the curve. But there’s more here than meets the eye. Specifically, the formula $T=k/sqrt{r}$ predicts that a 1% change in distance will result in a 0.5% change in temperature [3]. For example, were Earth just 3% closer to the sun—about 89 million miles away instead of 92 million—the average temperature would be about 1.5o higher. To put that in perspective, note that at the end of the last ice age average temperatures were only 5o to 9o cooler than today [4].

So our distance from the sun gets us more reasonable temperatures than Mercury and Mars have, but where do the seasons come from? That’s where our second number comes in: 23.4.

Imagine yourself in a park sitting in front of a bonfire. You’re standing close enough to feel the heat but not close enough to feel the burn. Now lean in. Your head is now hotter than your toes; this tilthas produced a temperature difference between your “northern hemisphere” and your “southern hemisphere.” This “tilt effect” is exactly what happens as Earth orbits the sun. More specifically, our planet is tilted about 23.4o from its vertical axis (Figure 2).

Because of its tilt, as the Earth orbits the sun sometimes the Northern Hemisphere tilts toward the sun—roughly March-September—and other times it tilts away from the sun—roughly September-March (Figure 3) [5].

Now that you know how two numbers—92 million and 23.4—explain the seasons, let’s get back to spring in particular. As Figure 3 shows, there are two days each year when Earth’s tilt neither points toward nor away from the sun. Those two days, called the equinoxes, divide the warmer months from the colder ones. And that’s exactly what happened on March 20th: we passed the spring equinox.

Before you go, I have a little confession to make. It’s not entirely true that just two numbers explain the seasons. Distance to the sun and Earth’s tilt are arguably the most important factors, but other factors—like our atmosphere—are also important. But that would’ve made the title a lot longer. And anyway, I would’ve ended up explaining those factors using more numbers. The takeaway: math is powerful, and the more you learn the better you’ll understand just about anything [6].

[1] The ratio of a circle’s circumference to its diameter, pi is a never-ending, never repeating number. It is approximately 3.14.

[2] Venus is the exception. Its thick atmosphere prevents the planet from cooling.

[3] Here’s the explanation for the mathematically inclined. In calculus, changes in a function are described by the function’s derivative; the derivative of T is $T'(r)=-kr^{-3/2}/2$. This tells us that for a small change dr in r the temperature change dT is $(-kr^{-3/2}/2)dr$. Relative changes are ratios of small changes in a quantity to its original value. Thus, the relative change in temperature, dT/T, is

$frac{dT}{T}=left(-frac{kr^{-3/2}dr}{2}right)left(frac{r^{1/2}}{k}right),$

which is minus 0.5 times the relative change in distance, dr/r. The minus sign says that the temperature decreases as r increases, confirming the results of Figure 1.

[5] Just like in our thought experiment, the Southern Hemisphere’s seasons are swapped with our own; when one is cold the other is warm and vice versa.