Tuesday, February 07, 2006

Consider two pitchers of Gatorade

Update: As I was eating breakfast this morning, I realized that there was one thing on this page that was wrong, and one that could be simplified. I have changed them below.

I was thinking about taking this Econ class that would fulfill my Peoples and Cultures requirement (argh, Peoples and Cultures requirement) so I went to the first class. It was very interesting and all, but I started thinking about this problem that was in my middle school math textbook, and so I was very excited when he handed out the syllabus so that I had a piece of paper to work it out. I didn't have the slightest idea how to solve it in eighth grade, but now I have more "mathematical maturity," so such problems are piddly and most of all FUN!

Here is the situation. You have two pitchers. The pitcher on the left contains two quarts of full-strength Gatorade. The pitcher on the right contains one quart of water.

Pour half of the contents of the pitcher on the left (one quart of full-strength Gatorade) into the pitcher on the right. Then pour half of the contents of the pitcher on the right (one quart of half-strength Gatorade) into the pitcher on the left. And so on.

Q. How many iterations does it take until the concentrations of Gatorade are the same in both pitchers?
A. Infinitely long. Don't ask stupid questions.

Q. How many iterations does it take until the concentrations of Gatorade are the same in both pitchers, to three decimal places of accuracy?
A. Surprisingly, 10.

This problem is not very hard if you leave everything as a fraction. And if you don't leave everything as a fraction, you really don't deserve to be doing math problems. Go sit in the corner with a calculator and punch the buttons like the rest of the stupid Americans who don't bother to use half of their brain cells.

But wait, you said to three decimal places of accuracy. Ha! That means you used a calculator! (Diana Davis is a strange person who likes to refer to herself in the first, second, and third person, all in one post. Deal with it.)

Don't be silly. After ten iterations, I had two fractions, 683/1024 on the left and 341/512 on the right. I did long division and calculated them to five decimal places. During economics class. And I participated in the class discussion. Take that.

After class, I went and waited outside the crew office for half an hour. I had nothing better to do than try to find an explicit formula for the concentrations after n iterations, so that is what I did. Unfortunately, I was only able to come up with a recursive formula, and a recursive formula is vastly inferior to an explicit equation, but a recursive formula is better than no formula at all.

Here it is, because I am just mathy like that.

Let Ln, Rn be the numerators of the concentrations of the pitchers on the left and right, respectively, after n pourings from left to right or right to left, respectively. Then:

Ln = 4 Ln-1 - 1
Nn = 4 Nn-1 - 1 4 Nn-1 + 1

where L0 = 1 (full-strength Gatorade)
and R0 = 0 (water).

The denominator of the concentration is 22n 4n.

Now you know.

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

A similar problem is to start with two pitchers of water, and pour half of the volume back and forth as above, without worrying about the concentrations. I think this was the original problem in the math book. As you might expect, you eventually get 2/3 in one and 1/3 in the other, with 1/3 of the total volume being passed back and forth each time. This is the stable solution, so you'd expect to get it eventually.

You can start with whatever volumes of water in the pitchers that you like, and eventually you will always reach the 1/3 2/3 situation. If the initial volumes are equal, it only takes about six pourings to get .33 and .67 to two decimal places. If the volumes are very different, it would take about the same amount of time, because if one is empty and the other has all the water, after one pouring the volumes are equal and you are back to the situation just described. I suppose it wouldn't take very long in any case. Is this surprising? Maybe.

I think the actual problem back in eighth grade -- it wasn't assigned; it was just there in the book -- was to say what the volumes would be after 1982 pourings back and forth. This is what textbook authors do to try to stay trendy, use the publication year to make the math seem interesting and current. But if you go to public school and the teachers realize that basic algebra hasn't really changed much in the past couple of millennia and that textbooks are very expensive, they don't buy new textbooks all that often, and a problem involving 1982 doesn't seem so current and trendy in 1998 or 1999.

So you see, I really am learning things in college. They're just all in my head.

3 comments:

Anonymous said...

So, when I go to crew races, we always have dozens and dozens of bottles of Gatorade hanging around. And since it is better to drink Gatorade than water between races, I am encouraged to drink the contents of said bottles. But if I drink full-srength Gatorade right after a race, it makes me feel not-so-well, so I have to take a bottle of water and a bottle of Gatorade and mix them. I remember one such occassion a few years ago, and while I was sitting there with my two bottles, I said out loud, "I wonder how many times I have to do this to get a homogeneous mixture in each." The person next to me just kind of smiled and looked the other way, but I still wondered. Not enough to take a pencil and paper to it and make a formula, but enough to remember that mixing liquids can be mathematically interesting.

Yes, math majors are weird. Get over it.

Diana said...

Infinitely many times. Don't ask stupid questions.

It's much harder, of course, just to do the physical pouring, if both of the bottles are full. Yeah, that really doesn't work.

The other thing I was thinking about was, what if you pour about half of the volume back and forth, but not exactly -- say 1/2 +/- up to one ounce or something. So on a computer you'd ask it to pour half and then pick a decimal to add or subtract. It would approach the right concentrations just as quickly, I expect, but you wouldn't stay there; you'd have a wiggly curve whose average was the nice concentrations.

I'm glad you had pondered this in real life. I didn't realize that people wondered that sort of thing, but if someone had to, I'm glad it was you. Now you know. About 10.

Diana said...

Oh, and the reason for that wondering about the about half was that there's no way you're going to be able to pour, or care enough to pour, exactly half. I had people like you in mind when I did my wondering. Now you, go and do your little computer sciency thingy and get me an answer. Sometime in the next seven years. Please.