Archive for the ‘math’ Category

Hung up

Friday, August 6th, 2010

Men, if your penis is of average size or slightly above, and you’ve taken solace (while watching some well-hung stud in a porn film) in the thought that most other men are your size or smaller, mathematics and I are here to ruin your whole day.

After all, it’s not some hypothetical matchup against all other men that you’re interested in, is it? If you’re honest with yourself, what you really care about is whether yours is the biggest dick your partner’s ever had. And that’s where the bad news begins.

Suppose your size is exactly average; that you’re in the 50th percentile for penis length. That means that 50% of men are smaller than you, and 50% are bigger. Does this mean you have a fifty-fifty chance of blowing your lover’s mind? Only if your partner had one man before you. If your partner had two men before you, the odds of their both being smaller are 0.5×0.5, or 25%. If three, the odds they were all smaller are 0.5×0.5×0.5, or 12.5%. In other words, there’s an 87.5% chance — 7 chances in 8 — they’ve seen bigger.

Let’s say you’re one of the lucky ones in the 75th percentile. Your dick is bigger than that of three out of every four men you see. There’s still a 58% chance that your partner (who’s had three men before you) has seen bigger!

In order to have an even chance of having the biggest dick that a partner with three previous lovers has ever seen, you have to be in the 80th percentile for penis size (about 6.25 inches according to the condom manufacturer LifeStyles). But that’s just an even chance. To have a good chance — say, 90% — you have to be in the 97th percentile (about 7.5 inches). And that’s if your partner has had only 3 men before you. It’s not too unusual to be the fifth or tenth or twentieth man, especially of a partner who’s very desirable.

None of these numbers mean anything if you can’t get it up when the time comes, so now that I’ve given you the bad news — don’t think about it.

A most ingenious paradox

Thursday, February 11th, 2010

Here is a puzzle that I posed to Jonah last night, and then helped him to solve in fulfillment of his required ten minutes of nightly math homework:

What is the date (day, month, and year) at the beginning of The Pirates of Penzance?

Solution follows.

(more…)

Fit-ness

Thursday, November 6th, 2008
Survival of the “Fit”test

A lower price wasn’t the Fit’s only advantage over the Prius. While car shopping I rented a Prius for a one-day extended test drive, ending up with three specific complaints:

  1. Visibility through the rear window is poor;
  2. The console’s large, animated engine-performance display is dangerously distracting;
  3. The keyless engine-start button is (a) unsafe with small children around but (b) too cool to disable with the child-safety lock.

More than a year ago I replaced my 1998 Honda Civic hatchback with a new Honda Fit. Fuel efficiency was a key decision criterion for me, and naturally I considered the Toyota Prius; but the Prius gets its best gas mileage in city driving, and at the time of my purchase most of my driving was on the highway, where the Fit’s efficiency was close to that of the Prius, at a much lower price.

I’ve been tracking my Fit’s fuel consumption on a spreadsheet for several months now and the trend is clear: its efficiency is consistently in the 35 MPG range. Nothing to sneeze at, especially given the dismal fuel economy of almost all other cars on the market; but disappointingly it falls short of the mileage I was getting with my Civic at the end, which occasionally exceeded 40 MPG — with the previous decade’s engine technology!

You can see the mileage I’m getting, fill-up-by-fill-up, in my Google Docs spreadsheet.

What are the odds?

Friday, October 17th, 2008

Our PlayStation 3 is not just a gaming console; it is our entire living room entertainment delivery system. It has replaced our DVD and CD players, and with its front-facing USB port I don’t even need CD’s; I just load up a thumb drive with music, plug it in, and play.

I have a thousand songs on one of those thumb drives, and I always play them in “shuffle” mode. Yet it seems that there is always a lot of overlap between one listening session and another — the same songs that I heard yesterday are in today’s mix. You’d think that with a thousand songs to choose from, it would be a while before I hear the same song twice, unless there’s something not sufficiently random about the PlayStation’s song randomizer.

I was all prepared to fire off an indignant letter to Sony’s customer support department when I decided I first needed to understand exactly how unlikely was the overlap I was encountering.

Figure that a “listening session” includes twenty songs. There are 339,482,811,302,457,603,895,512,614,793,686,020,778,700 (339 duodecillion) different ways to choose twenty songs from a collection of a thousand. This result is given by the combinatorial formula:

n! / k!(n-k)!

where n is the number of items to choose from (1,000, in this case), k is the number of items to choose (20), and “!” is the “factorial” operator that means “multiply the preceding number by every other number between it and 1.” Five factorial, for instance, is written “5!” and is equal to 5×4×3×2×1, which is 120.

The combinatorial formula above is sometimes abbreviated “nCk,” pronounced “n choose k.” The very very big number is the result of calculating 1000 C 20.

So there is a vast number of possible listening sessions. But in how many ways can one listening session overlap with another? Let’s consider a second listening session that doesn’t overlap at all with the first. The way to think about this is that the first listening session “used up” twenty of the available songs, leaving 980 to choose from — specifically, 980 from which to choose 20, or 980 C 20, which is 225,752,650,356,644,030,123,857,337,771,499,346,518,885 (225 duodecillion).

So of the 339 duodecillion ways to choose 20 songs from a thousand, 225 duodecillion, or 66%, do not overlap — but that means that 34% do overlap. There is a one-in-three chance that at least one song in the second session will be the same as one in the first.

This was a stunning result to me. I never expected the odds of an overlap to be so high.

That doesn’t mean that the PlayStation is working correctly, necessarily; it’s my impression that I’m getting multiple-song overlaps, and I’m getting them much more than one-third of the time, so the PlayStation still may not be adequately randomizing its playlist. But this result does send me back to the drawing board to gather objective data about just how much overlap I am getting.

To the nerdth power

Monday, August 4th, 2008

Nerd confession: I just realized that my son Archer, who is 4, and my stepdaughter Pamela, who just turned 27, both have ages that can be expressed in the form nn — Archer is 22 and Pamela is 33. Barring a major advance in gerontology research I regret to say it is unlikely any of us will ever see 44.

(Didn’t know that I had an adult stepdaughter? I haven’t mentioned her here before, but we added her to the cast a couple of seasons ago in a Cousin Oliver moment to boost our sagging ratings.)

Update: Oh drat, Pamela’s 26, not 27. What’s interesting about the relationship between her age and Archer’s now? Umm… Archer’s is the number of suits in a deck of playing cards, and Pamela’s is the number of red (or black) cards? Sorry, that’s the best I’ve got.

At this rate…

Monday, July 28th, 2008

How do you like that — the same weekend that my blog turned two years old, my Google AdSense account — the little kickbacks I get every time one of you clicks on the ads that appear next to one of these posts — also passed a major milestone: I’ve earned ten dollars! At this rate I’ll be able to retire, when the time comes, on over one hundred AdSense dollars!

Come to think of it, that’s only if you consider my mounting AdSense balance to be an arithmetic progression. On the other hand, ten dollars is a thousandfold increase over my balance the last time I reported it almost two years ago. With just two data samples it’s impossible to tell whether the progression is arithmetic or geometric. If the latter, then my balance has been growing at better than 1% per day. At that rate, by the time I retire you will all bow before benevolent supreme dictator Bob and his 8.7 duodecillion dollars, mwa ha ha ha ha ha! Even if the dollar collapses, that oughta be worth something on eBay. Thanks, AdSense!

T minus 100

Monday, July 14th, 2008

It’s 100 days until my birthday! (And how cool that the hundredth day before my birthday is Bastille Day! Well, it’s a little cool. Oh, OK, it’s a meaningless coincidence.)

To goose my weight-loss regime, which appears to have stalled once again — though I am holding my own against the “Google 15” — I am adding a daily exercise regimen for the first time, inspired by hundredpushups.com: each day I will do one more push-up than the day before, starting with one today and culminating with a hundred push-ups by my birthday.

If I keep exactly to that plan, the total number of push-ups I’ll do is 5,050 — one today, two tomorrow, three on Wednesday, four on Thursday, and so on. The sum of the first N numbers from 1 through N is, in general,

(N+1) × N/2

an elegant intuitive proof of which is as follows. List the first N numbers, let’s say 6 for this example:

1 2 3 4 5 6

The sum of the two “outer” numbers is 7:

1 2 3 4 5 6

Removing those, the sum of the next two “outer” numbers is also 7:

2 3 4 5

Removing those, the sum of the final pair is also 7:

3 4

That sum — N+1 — is repeated N/2 times, giving rise to the formula

(N+1) × N/2

“Wait a minute,” I hear you say. “What about when N is odd? Then there’s one extra innermost number with no partner.” That’s true. In that case, the number of pairs that add up to N+1 isn’t N/2, it’s only (N-1)/2:

1 2 3 4 5 6 7

Here N is 7, and there are 3 pairs that add up to 8 — 1 and 7, 2 and 6, 3 and 5 — and 4 is all alone in middle. So the sum is:

(N+1) × (N-1)/2 + the middle number

But the middle number is always (N+1)/2, so this becomes:

(N+1) × (N-1)/2 + (N+1)/2

which is the same as

(N+1)/2 × (N-1) + (N+1)/2

which can be read as adding one more (N+1)/2 to a collection of N-1 of them, for a total of N (N+1)/2′s:

(N+1)/2 × N

which is the same as

(N+1) × N/2

which is the same as the original formula above whether N is odd or even. QED.

OK, let’s get this regimen started. Rrrrrnnnnngghh — one. Whew.

Bullet time

Tuesday, March 25th, 2008

I decided to apply a little physics to my KitchenAid mixer misadventure, in which I claim I was nearly killed by a hunk of metal propelled past my head by spinning mixer blades. When that projectile whizzed past my head, how much danger was I really in compared to, say, a bullet from a sniper’s rifle?

It comes down to a calculation of the kinetic energy of the projectile. Fortunately it’s very easy to approximate by making a few assumptions and by ignoring the effects of air resistance and the spray of cake batter.

The projectile was the mixer’s own removable endcap. As soon as it vibrated loose, fell into the bowl, and was struck by the spinning mixer blades, it was on a ballistic trajectory, arcing up, past my head, and then down behind me. Let’s assume that the highest point of the trajectory was about level with the top of my head, roughly 1.5 meters off the ground, and that this height was attained just as the projectile was passing me, meaning that once it did pass me, it had already started down.

We can decompose the motion of the projectile into a pair of vectors: the one pointing straight down to the floor and the one perpendicular to it, pointing horizontally past my head. The speed in that direction was constant until the endcap hit the floor. The speed in the floorward direction was increasing due to gravity.

Since we’ve assumed the endcap reached its apex as it passed my head, we know that its downward velocity at that moment was zero. We also know that the acceleration in that direction (due to gravity) is 9.8 meters per second per second. Finally we know from high school physics that:

distance = initial-velocity×time + acceleration×time2/2

and since we know initial-velocity is 0, we can rearrange this to say:

time = √distance/acceleration

And since we know “distance” is 1.5 meters and “acceleration” is 9.8 m/s2, we know that it took about 0.4 seconds for the endcap to fall from the height of my head, regardless of its motion in the horizontal direction.

In that 0.4 seconds I estimate (based on where I later found the endcap) that it covered a horizontal distance of 3 meters, giving it a speed of 7.5 meters per second.

I haven’t weighed the endcap but I’m going to guess it’s about 0.25 kilograms (around half a pound). Again, high school physics tells us that kinetic energy is:

mass×velocity2/2

which means the endcap, if aimed just a bit differently, would have struck me with about 7 joules of energy.

How bad would that have been, compared to a bullet? Apparently even the wimpiest guns deliver hundreds of joules to their targets, so we’re not looking at a shearing-off-the-top-of-my-head scenario here. On the other hand, I was there, and I’m not exaggerating when I say that hunk of metal could have dealt me a grievous injury at the very least. If that was what seven joules looks like, I have a whole new appreciation for the stopping power of a bullet.

How I wonder what you are

Monday, January 28th, 2008

Often when I’m gazing at the night sky I will focus on a very dim star and marvel at its ability to shine steadily. No matter how long I look, and no matter whether I move a few inches to the left or right, it keeps right on shining. (It may twinkle a bit, but as you probably know, that’s due to our fluid, shifting atmosphere causing the starlight to refract slightly differently from one moment to the next, not due to anything about the star.) Photons emitted by that star hundreds of years ago poured out in such numbers that, even as they fanned out across unimaginable distances, there are still enough of them landing continuously in the tiny target of my eyes that the star remains a constant point of light.

Knowing the distances involved, it seems implausible that enough photons would be headed in my exact direction — of all the other places in the universe they could have gone! How implausible? Let’s figure it out.

We’ll start by estimating that the area of my dilated, night-sky-gazing pupils is about one square centimeter, or (to keep all measurements using the same units) one ten-thousandth of a square meter.

Thanks to Wikipedia I know that a single photon of visible light carries about 4×10-19 joules of energy which is just enough to excite a photoreceptor in my eye. How many must arrive each second for me to perceive a continuous image? I know that movies, projected at 24 frames per second, are good enough to trigger the persistence-of-vision effect. Since a distant star has far less detail than a frame of movie film, I’m guessing that it can appear steady at even fewer than 24 “frames” per second. Let’s guess 10 photons per second must arrive in my eyes to perceive a steadily shining star. 10 photons delivering 4×10-19 joules every second is 4×10-18 watts (because one watt is equal to one joule per second).

Now, how far is that star? A bit of googling reveals that a typical faintly visible star is 200 light years away (though many are much closer and many are much farther). 200 light years is 1.89×1018 meters.

From the perspective of that star, what fraction of its “sky” is taken up by my eyes? If you imagine a gigantic spherical shell centered on and surrounding that star, with a radius of 200 light years and my eyes on the inner surface, then the total area of that inner surface — the star’s “sky” — is 4×π×200light-years2, which is 503,000 square light-years, which is 4.5×1037 square meters. My pupils, one ten-thousandth of a square meter, comprise 1/2.22×1042 of that “sky.” That’s two millionths of a trillionth of a trillionth of a trillionth — not like that’s going to make my big ego feel small or anything.

So if 4×10-18 watts of visible light is delivered to 1/2.22×1042 of the star’s sky, then the total power delivered to its full sky is that first number divided by that second, which is 1.8×1024 watts, or 1.8 trillion terawatts. Is that a plausible number?

Yes it is. Our own sun has a visible-light output of 3.8×1026 watts. Which means, incidentally, that (using my guesses from above) it would be visible as a steadily shining star to a distance of 2.7×1019 meters, or about 2,900 light-years. Future criminals exiled from our galaxy will lose sight of their home star while barely a thousandth of the way to their new home in Andromeda.

Do the abortion math

Tuesday, January 22nd, 2008

It’s the thirty-fifth anniversary of the famous Supreme Court decision in Roe v. Wade that affirmed the legality of abortion.

Of course abortion remains a fantastically polarizing subject. It seems like the country is divided fairly evenly in favor of choice and opposed to it (and not necessarily along traditional party or ideological lines); and that most opinions are strongly held.

I for one believe that Bill Clinton got it exactly right when he said that abortion should be “safe, legal, and rare,” but why do I believe that? No opinion is worth having if it can’t be examined, challenged, and defended, so here is my defense.

First we must determine whether it’s possible to attack or defend abortion dispassionately, without appeal to emotion. Most people who oppose abortion do so because they believe that it is murder, a naturally emotional subject. We could try to remove or distort the emotional component (e.g., by confining ourselves to a discussion of costs and benefits — as routinely happens in cases of state-sponsored murder such as executions and wars), but I think there’s another way that sidesteps the question of murder altogether.

Whether or not abortion is murder depends on whether or not a life exists to terminate. Indeed that’s what it came down to in the Roe v. Wade decision:

We need not resolve the difficult question of when life begins. When those trained in the respective disciplines of medicine, philosophy, and theology are unable to arrive at any consensus, the judiciary, at this point in the development of man’s knowledge, is not in a position to speculate as to the answer.

Nearly everyone agrees that life does not exist prior to conception. Nearly everyone agrees that life does exist upon birth. So where, in between those two events, is the switch flipped? We don’t need medicine, philosophy, or theology to decide; just simple math.

Life may not exist the entire time, but what does exist is an ever-increasing probability of life — more precisely, a probability of being born alive. The appearance of a fetal heartbeat at about eight weeks after conception improves the odds. “Viability” (a minimal ability to survive outside the womb) at about 22 weeks improves it some more. The chances of being born alive continue slowly to climb as the fetus develops, until finally it reaches 100% at the moment the baby takes its first breath.

Can we scientifically choose a probability threshold before which we say abortion is OK and after which we say it isn’t? Sort of. A threshold very close to 100% would be unacceptable to most people, even pro-choice advocates, for emotional reasons (although this has not been true at all times or in all cultures, some of which routinely disposed of unwanted infants simply by exposing them to the elements). It makes no sense to talk about a threshold of 0% as some extreme anti-abortionists might prefer it, because the probability is higher than zero even before conception — especially if Barry White is playing and the lights are turned low. Any other choice between 0% and 100% would be arbitrary, so the best we can do is to choose the least arbitrary number in that interval: 50%. As it happens, in modern America a 50% chance of a live birth appears to be reached, on average, between the 22nd and 28th week of pregnancy.

So that’s my position: abortion should be legal (and safe and rare) before about 22 weeks, and illegal (with the usual pragmatic exceptions — rape, incest, health of the mother) otherwise. Your emotions aside, I think I’ve shown that no other position on this subject is more rational than that one.