Tuesday, May 24, 2011

PFE025: Statistics

Statistics seem like one of the least interesting aspects of science. There's the idea, the experiment, the data, and the results. Each of which is exciting, so why do statistics have to butt in like that?

To be honest, I'm writing now on statistics after too many failed attempts to explain the necessity of statistical analysis to the world around us.

First, I'll use one of the classic examples from grade school. The game is: Let's Make A Deal. The main game here is that they show you three doors and tell you that two doors have goats and one has a Ferrari (Ferrari $\gg$ Goats in case that was unclear). You guess a door at random, but, before he opens that door, he opens another door and shows you a goat is inside. You then get to choose if you want to keep your same door or switch to the remaining door.

The surprising result (if you haven't heard it before) is that if you switch you are twice as likely to be driving a Ferrari than riding a goat. A quick google search will yield web applets to play this out and see for yourself.

Not that bad of a prize really.

Let's look at why switching is better than staying. First, we note that picking the original door is of no consequence. Nobody knows anything at this point. Except for the host. And the staff. And the pretty lady opening the doors. Okay, YOU don't know anything. So say you pick a door.

Now, note that, while you don't know this yet, you have either picked the right door or the wrong door [so many possibilities!]. There is a 1/3 chance that your door is the door, and a 2/3 chance of goat times. They then show you a goat and you have two doors left. Looks like your odds of winning are 1/2 right? One of the doors has a goat and one has a car.

But remember that your first door has a 2/3 chance of being a goat. Which means that the other door has a 2/3 chance of being a car. It doesn't matter that you don't know what is behind your door, unless they're pulling fast ones on you back stage, if you switch, you will win 2/3 times and if you stay you will only win 1/3 times.

As a side note, the game takes advantage of contestants attachment to their guesses.

So, statistics is good for game shows (and probably casinos and such too), but what else? There were statistics majors at my college! If beating video poker was their only incentive for exhaustive studies of confusing subtleties, they would have lost funding ages ago.

In any experiment, statistics needs to be used. Scientists attempt to measure reality, but there is always some error in that measurement.

Suppose you want to measure your arm
and you record that it is twenty inches long. What does that mean? The length of your bones? From somewhere on your shoulder to somewhere around your wrist? Even with a standard definition of "length of arm", that doesn't explain if your arm is exactly twenty inches. Your ruler probably only goes down to 16ths or 32nds of inches. Plus you're measuring by eyeballing it. How accurate is that?

Unfortunately, this problem doesn't end with fancy special equipment.
Let's scale back a moment though, to a more practical example.

Suppose a friend brings you a die and claims that someone has been cheating and weighted the die towards the six (Risk anyone?) and wants you, an expert on rolling dice and such, to confirm or deny this belief. What would you do?

Assuming that it looks and feels normal, you would probably roll it a whole lot of times and record what you get. Maybe you roll it 100 times and get 100 sixes. Whoops, cheater exposed!

What happens if you only got 98 sixes. Still probably a weighted die. On the other hand, 16 sixes [the expected value is $16.66\bar6$] suggests a non-weighted die. But what about values inbetween? When do you change your mind from "bad luck" to "cheating-friend-we're-never-talking-to-again-because-of-a-really-important-Risk-game"? Well, you could always roll the die more times. After all, it's not that hard, and it's apparently quite important to get it right. If it doesn't approach 1/6 now, we know someone's cheating.

Perhaps a more relevant scenario is to consider the same one as above, but instead suppose that it costs $\$$50 million per roll of the die.

All of a sudden, rolling it as many times as you want is no longer an option. If you're given an operation budget to perform three rolls and return an answer, what then? Three sixes sounds like a cheater, but Yahtzee players know that this happens. What about no sixes? Sounds like it passed the test. But what if it wasn't weighted that much and just got a(n) (un?)lucky set of rolls? Not to mention any ground in between. It's not like you can just redo the experiment, and yet you have to report your results. How confident can you be that three sixes implies a cheater?

Luckily, statistics can help. In fact, statistics makes quite clear statements on "confidence levels". For example, if we roll three out of three sixes, we can be $>99.5\%$ sure that the die isn't normal.

Moreover, statistics can be used a priori to determine things like how many rolls are necessary to be sure  to a certain confidence level that the die is weighted or not. Regardless, though, you can never be $100\%$ sure.

That's statistics.

Monday, May 23, 2011

PFE024: Buoyancy

Ever been swimming? Do you float? Sink? Never mind, don't answer that.

Answer this: Why do some things float and others sink?

Anyone who answers with something relating to ducks gets cement shoes.

Some of you might know that floating and sinking has less to do with weight or mass and more to do with density. This is... too true! That's it. Things less dense than water float, and things more dense than water sink. And we're done.

But we can think this through a little more with the next obvious question: Why does anything float in the first place? What force is acting on my floaties to help keep me above water? Is there some special additional force for things in water [or, more generally, liquids [or, more generally, fluids]]?

Nope! Read my lips: No new forces!

It may seem surprising at first to think that the same thing that holds up your floaties is holding you up right now [unless you're reading this while sky-diving in which case HOLY-BATMAN-AWESOME]. You don't fall through your chair/floor/ground into the center of the earth because of the electro-magnetic force. I know, boring. All the little electron clouds in your butt/feet push on the electron clouds of the chair/ground and repel, thus holding you up - blah blah blah.

The same happens in water. Your electron clouds and the electron clouds in the water repel, which is why we don't become one with the water upon entering it.

Yet, this is so unsatisfying.
It still doesn't get to the meat of the issue. Sometimes water can muster up enough strength to keep things afloat, and other times it just drops the ball.

The missing key is gravity. Since water can slosh around [unlike my chair, presumably] gravity is going to be busy keeping it in check, keeping it as low and flat as it can be [waves notwithstanding]. But gravity wants to pull the giant boat underwater too yet to do so requires pushing the water up higher. So only one thing gets to go down and fill up that volume. If the boat is more dense than the water, then it sinks since it is easier for the water to go up, against gravity, than the boat. And vice-versa. If the water in the volume that would be occupied by the boat weighs more than the whole boat, then water occupies that volume and the boat floats. In fact: <major surprising fact of the lesson> the weight of the water of the space that the boat takes up is exactly equal to the boat itself. [Whoa.]

Of course, how much floating action happens depends on just how different the densities are. As the density of an object approaches that of water, more and more of it sinks. Once it is greater than that of water, it sinks straight to the bottom [I hope we're all thinking of DiCaprio sinking in the Titanic. Or just the Titanic sinking, that works too.].

That's buoyancy.

Friday, May 20, 2011

PFE023: Waves

After a semester long hiatus, PFE is BACK.

Waves may be a purely mathematical construct and as such confusing, worrisome, and/or boring to most. Yet that doesn't mean that they don't show up everywhere.

Sound waves, light waves, ocean waves, radio waves, and "the wave" are just a few examples that we experience on a regular basis. Some more subtle examples are the vibrating waves on a string or a drum head (see oil slicks and music for more background).

Waves can be classified in a number of ways, but for now we'll just stick to two main categories: standing waves and traveling waves.

For a standing wave, think of a piano string vibrating up and down in any of the following fashions:
Note that the endpoints are fixed as well as certain points in the middle. Standing waves oscillate at a certain frequency. If the wave is on a string in air, it will produce a certain pitch of sound.

The alternative is a traveling wave which moves and does not have fixed points or nodes of the wave. An example of such is shown here

Whoa! PFE goes animated!

An example of such is when you whip the vacuum cleaner cord to get it unstuck from something. You can briefly see a short traveling wave in the cord.

Ocean waves are a form of traveling wave. Keep in mind though, that even as the wave moves across the ocean, the water itself is not moving horizontally, instead it is just moving up and down. In this sense it should start to become clear that when a wave is moving, it is typically not carrying actual stuff, but rather is carrying energy.

In the same way, as sound saves travel through air, the air particles themselves are not traveling any great distance, instead, they merely travel far enough to let the other air particles near them know how the wave is moving. So again, a sound wave is really a transfer of energy.

Finally, we get to light, which is the most confusing wave of all. Light is certainly the transfer of energy [as anyone who has ever tried to cook anything with a 60 Watt light bulb [think easy-bake ovens] knows] that propagates forward not unlike a sound wave.

That's waves.