Sunday, October 25, 2009

Games with Wolfram Alpha

Last week Wolfram Research, the makers of Mathematica and more recently Wolfram Alpha, had their first annual Wolfram Alpha Homework Day.
Having nothing better to do that day but suffer from the effects of the H1N1 flu, I tuned in and watched the festivities.
The whole point of the day was to encourage students to send in their homework problems online, and the wizards at Wolfram would show you how to use Wolfram Alpha (W|A) to find the answer.
Actually, the whole point of the day was to advertise W|A out the wazoo, but I digress on the obvious. =)

The event lasted 14 hours, and had a live video feed of interviews with people like Brian Greene and Lawrence Krauss discussing the roll of computable knowledge in education, pitching W|A and the like, and a painful interview with Richard Dreyfuss.

Also featured were various educators singing the praises of Wolfram Alpha and Mathematica in their classes.

Throughout this whole presentation I was constantly feeling like many the teachers and students intervewied were pushing for a rather shallow understanding of the subjects they were teaching, or learning.
For instance, rather than letting a student come up with further questions after W|A gave them their answers, W|A would do that sort of chain of thought thinking for the student.
And example would be after a student calculates a volume of an object, W|A then goes on to compare that volume to a bunch of other objects. I myself would like the student to be thinking to herself: "Humm... how does this compare to say, a baseball?" and then go looking for or calculating the answer themselves.

I think that tools like W|A, if misused, can atrophy the already poor critical thinking skills of many students, and put them in a mindset that answers should be given to them rather than sought out or figured out on their own.

However, when used correctly W|A is an exceedingly powerful tool, and fun as heck to use! Just like I am apt get caught up in a wiki hunt, where each link takes me to something new and fun to learn, I can get caught up in the same sort of thing with W|A.

To this end, I would like to explore last Friday's Fermi Problem of the Week: The Great Flood
I will introduce a neat little trick to add to your toolbox, go over three of the questions using basic back of the envelope calculations and also show how W|A can be used to rapidly come up with and explore answers to back of the envelope calculations.

----- Start Playing! -------

I will not give away the answer to the first part of the question, which is asking how much the oceans will rise if the polar ice caps melt.
Instead, we will go over another question:

Estimate how much water is needed to cover the Earth such that the highest mountain was under water.

To calculate this answer as a back of the envelope, you need to know the following:

Radius of Earth

Height of the tallest mountain.

The radius of the Earth can be found with some Google-Fu. As you may realize, the Earth is not a sphere, but because of its spin angular momentum is an oblate spheroid with a polar radius of approximately 6356.8 km, an equatorial radius of 6378.1 km, and a mean radius of 6371.0 km.

Since this is a Fermi problem, we will assume the Earth is a sphere of mean radius r = 6371 km.

The tallest mountain is Mt. Everest and is h 8848 m tall (above sea level, which we take as Earth mean radius)

What we would like to do is compute the volume of a spherical shell of inner radius r, and outer radius (r + h), which will give us the volume of water (not including the oceans) that will cover the Earth to a depth of the highest mountain. 
Of course, this volume will be different than the actual volume, due to other mountain ranges and the like, but we are estimating to order of magnitude.

One may calculate this volume by subtracting the volume of the Earth from the volume of the water covered Earth as:

And then we would be done, and by plugging in the numbers we would obtain a volume of water of:

Vss = 4.52034*10^9 km^3

However, at this point I would like to introduce you to a common trick that physicists like to use when dealing with small changes, such as in the term (r + h)^3.
This trick involves simplifying the Vss equation to a more tractable form for computation.
One may wonder why we would care to do so, when in this day and age of Mathematica we can simply plug and chug? The answer in terms of a Fermi problem solution is that making calculations of this type as simple as possible is a great thing to do, as it saves writing, and the chance of making errors.

In a general sense, a physicist is always interested in how the model behaves at extreme values, such as the very small, the very large, very slow and very fast. Being able to know what terms affect the solution in various regimes is an important skill do develop. Knowing how to deal with infinitesimal changes is one of those skills.

Cute Trick Digression, AKA the binomial series

First we note that h << r. In some cases, if we were to simply approximate the volume of the sphere of radius (r + h) we could neglect the h term, and be done. But in this case doing so would yield a spherical shell volume of zero.
To solve this problem we manipulate the sphere radius equation as follows:

Here we notice that h/r << 1. Again we could neglect the h/r term, but we will use the binomial series, which states:

where n is an integer.

In our example we will take the binomial series to order 1 and we obtain:

Plugging this into our spherical shell equation and simplifying gives us:

Plugging in the numbers:

Vssa = 4.51407*10^9 km^3

Note that this is much simpler to compute with than the first version, and indeed for our problem the answer differs from the "exact" solution by a bit over 0.1%

At this point we can see how the rest of the problem goes. We can calculate the rain fall over 40 days and 40 nights, we can assume the earth is 75% covered by water to a depth of on average 2 km and calculate the volume of water already in the oceans. Indeed it would be a good exercise to do so, as it will work your problem solving muscles.
However, after all this is done it will be interesting to see how we can solve this problem using W|A.

Wolfram Alpha Solution

Lets answer the question above using W|A.

First, the site to go to, if you have not already found it, is:

The current incarnation of the site as of 10-25-09 looks like the following:

Lets try a simple search term: "Volume of earth"

Lo and behold we get the volume of the Earth with the assumption of a perfect sphere. Note the radius is the same we used.
What is cool to note is that there are many conversions to different units

Lets try: "height of mt everest"

This is pretty cool! We not only get the height of mount Everest, but also some other possibly useful results such as air pressure, temperature etc.

Lets go for the money shot here and calculate the volume of water needed to cover the earth to a depth of the height of Mt. Everest.

Note the answer is in cubic feet, which for some reason W|A decided to use. That is ok because one can click on the answer and open a separate query and convert to other units. The answer given by W|A to our question is the same order of magnitude as our result, because it decided to use different radius for the various calculations. So while W|A allows you to, with a few queries, "solve" this problem, the student may not realize that different radii were used in the calculation.
This can most likely be fixed by a person who is very facile with W|A, but the average student would not get a consistent result.

The upshot of this post in my opinion is that one should go to pen and paper first, then afterwards you can explore using W|A. At some point you will develop to the point where you can go to W|A first, and be able to understand the limitations of the search queries you use.


  1. yeah i was also thinking of some tricks to calculate nos (w/o plugging in values ) in the solutions I posted for the flood and snow Fermi problems. I would try to present some (if they are different from yours ) by the end of friday (along with solution of a new fermi problem if you post one )

  2. Cool. As Martin pointed out in an earlier post in another blog entry, we can do the simplification as a differential of the votive of the sphere.
    However, the binomial series expansion allows for arbitrary number of terms. I use it all the time!