## Posts tagged ‘probability’

### Go to Vegas, Saul

Saul is a statistician. He leads a comfortable life — he has tenure at a respected university, an impressive list of publications to his credit, and the admiration of his colleagues. Less than a year from retirement, he hears a voice from above. “Saul, quit your job,” the voice says.

He ignores it.

The next day, the voice returns. “Saul, quit your job.” And the next day. And the day after that. And it becomes more frequent, occupying most of his waking hours as well as his dreams. “Saul, quit your job.”

It continues relentlessly for months. “Enough already!” Saul shouts when he can take no more. He delivers a letter of resignation to his dean that morning.

“Saul, take your life savings out of the bank.”

*I’m not taking out my money*, Saul thinks. But the voice continues relentlessly. “Saul, take your life savings out of the bank.”

After several sleepless nights, he finally gives in. “Now what?” he asks.

“Saul, go to Vegas.”

He buys a ticket to Vegas. When he arrives, the voice tells him, “Saul, go to the blackjack table.”

He obeys.

“Saul, bet all of your money on one hand.”

“That’s insane!” he shouts.

“Saul, bet all of your money on one hand.”

He knows that the voice will continue if he doesn’t listen, so he does it.

He’s dealt an 8 and a king. 18. The dealer is showing a 6.

“Saul, take a card.”

“But the dealer has…”

“Saul, take a card.”

“But the laws of probability…”

“Saul, take a card!”

He takes a card reluctantly. It’s an ace. 19. He sighs relief.

“Saul, take another card.”

“C’mon!”

“Saul, take another card!”

He takes another card. Another ace. 20.

“Saul, take another card.”

“But I have 20!” he shouts.

“Saul, take another card!”

He shakes his head. “Hit me,” he says sheepishly. A third ace. 21.

And the voice booms, “Un-fucking-believable!”

### The Twelve Days of Crisp Math – Day 8

For the **Eighth Day of Crisp Math**, here’s a problem for you. Best of luck solving it before Day 9…

If you choose an answer to this question at random, what is the probability that you will be correct?

A. 25%

B. 50%

C. 60%

D. 25%

### Kindergarten Math

Alex and Eli started kindergarten on Tuesday.

At a “Meet the Teacher” event last week, we were told that this is the most kindergarten classes they’ve had at the school. “We had to add another class this year, so we now have eight,” one of the teachers said.

“How many students are in each class?” I asked.

“Twenty-one,” she said, “so it’s really good that we added that eighth class — or else there’d be, like, 26 students in each class!”

I was too polite to tell her that 8 × 21 ≠ 7 × 26.

Today, we had a parent-teacher conference. On the bulletin board in her class was the following chart with student names:

There are 19 students in the class, and all of them have a first name that that begins with a letter in the first half of the alphabet. There are 3 A’s, 1 B, 3 C’s, 1 D, 2 E’s, 1 I, 3 K’s, 3 L’s, and 1 M.

I mentioned this to the teacher. “I know!” she said. “Isn’t that an amazing distribution!”

*Well, yeah*, I thought. *It’s quite amazing, in fact.*

If you assume that names are evenly distributed across the alphabet, the probability that all 19 students would have a first name in the first half of the alphabet is an astounding (1/2)^{19} = 0.00000002%.

But of course, names are not evenly distributed across the alphabet. I don’t know how they’re distributed, but the first letters of English words are distributed as follows:

That means that 52.005% of all English words start with a letter in the first half of the alphabet. If you assume that names follow the same distribution, then the probability doubles to 0.00000004%.

Yup. Still pretty low.

### P(Winning Lottery) > 0… but Just a Little

I know a fair bit about the probability of winning the lottery.

State-run lotteries are a tax on the mathematically challenged.

Given the odds of winning, then you might wonder why I occasionally buy scratch-off lottery tickets. Lord knows, my wife often wonders aloud about it. Believe it or not, there are three reasons that I buy these tickets:

- First, I’m from a rural town in the-middle-of-nowhere Pennsylvania. The rural poor are infamous consumers of lottery tickets. Consequently, I believe that buying lottery tickets is part of my genetic code.

- Second, it’s a guilty pleasure that is easier to indulge than buying PowerBall or Daily Number tickets. When you buy one of those, there is a human interaction, and I imagine that the clerk selling me the ticket is thinking, “Loser! Don’t you know how low your odds of winning are?” For the scratch-off tickets, you insert your money in a vending machine, and the tickets are dispensed. Sure, you may get a disapproving eye from a passer-by, but at least there’s no formal exchange with another human.

- Third, and most importantly, I know a bit about probability, but I also know a little about the intersection of math and psychology. As it relates to the lottery, the idea is fairly simple — make every third or fourth ticket a winner, and people who buy scratch-off tickets will win often enough that they’ll keep coming back for more. Truth is, the winning tickets usually have a prize equal to the price of the ticket or twice the price of the ticket. For instance, if the tickets cost $5, then the winning tickets usually have a pay-out of $5 or $10. When four tickets are sold for $5 each, the state collects $20 and only pays out $5 or $10. Good work if you can get it, eh?
This last point is actually the one that hooks me in. If I buy four tickets at a time, I can almost guarantee that one of them will be a winner. Consequently, I’ll only be giving $10 or $15 to the state instead of $20. (What a bargain, right? I walked into the store with $20, and I get to leave with $5 or $10. Who could pass that up?) But on the off chance that there are two winners in this group of four, or if one of the tickets is a big winner with a prize of more than double the price, well, then, this could work out all right for me.

Yes, I am fully aware that my argument is irrational and that I am slightly delusional. Recognizing my irrationality and delusion, I don’t buy scratch-off tickets very often; but, I do buy them occasionally.

So, why am I telling you all this? Because this morning, I bought four scratch-off tickets at the local supermarket.

**First Ticket:** It had a “5 Times” logo next to $10. That means I won $50.

“Wow!” I thought. “I’m already ahead $30.” And then, of course, I realized how unlikely it was that the other three would be winners.

**Second Ticket:** I matched not one, not two, but *three* of my numbers to the winning numbers for $5 each. That means $15 in winnings on the second ticket.

“Holy schnikeys!” I said out loud, though probably too soft for anyone else to hear. (I hope.)

**Third Ticket:** I matched two numbers for $5 each. That means another $10.

**Fourth Ticket:** Nada.

But, whatever. I was up $55, so who cares about that stupid fourth ticket?

I collected my winnings, and I walked across the street to Panera and ordered a chai tea latte and a bagel. I handed my MyPanera card to the clerk — indicentally, I hate the recent trend of naming something as MySomething, because then it’s really awkward when I want to refer to the MySomething that belongs to me by calling it my MySomething; but, I digress — and he told me that I had earned a free bagel. “You can have this one for free, if you want,” he said. Well, hell yeah!

A few hours later, I went to lunch with a new professional acquaintance. Even though *I had asked her* if she wanted to meet for lunch, *she* picked up the tab!

Can you believe it? Fifty-five dollars in lottery winnings, a free bagel, and a free lunch. Financially speaking, this could have been the luckiest day of my life. (Well, except for the day when I learned that an essay I’d written had won a honeymoon in Oaxaca for my wife and me. But that’s a story for another day.)

Yep, the chances of one good thing happening in a day are low. But the chances of three good things happening in a day? Infinitessimal! Guess I’m just blessed.

My former boss, Jim Rubillo, knows a thing or two about probability and statistics, too. Somehow, his favorite line seems appropriate for this post.

If you don’t believe in the power of random sampling, then the next time your doctor requests a blood sample, tell her to take it all!

### Kicking Off Could Become Flipping Off in NFL

One of the most exciting plays in the history of professional (American) football was the opening play of the second half of Super Bowl XLIV, when the New Orleans Saints recovered an onside kick. They then scored to take a 13–10 lead, and eventually won the game 31–17.

But onside kicks could be a thing of the past. Yesterday, New York Giants’ co-owner John Mara suggested that kickoffs might someday be eliminated from the NFL. This caused a lot of sports pundits to react, saying that it would inherently change the game. On the *Mike and Mike Show*, analyst Mark Schlereth responded with these rhetorical questions:

What’re you gonna do, flip a coin three times in a row? You gotta get heads three times in a row to get an onside kick?

Once again, probability was placed front-and-center in recent football discussions. While I like Schlereth’s new, less violent, and more mathematical approach to onside kicks, I just wish he had gotten the math right.

If you flip three coins, the probability of getting three heads is 12.5%. That’s not enough. Data shows that onside kicks in the NFL are successful 26% of the time. So the following would be a reasonable modification to Schlereth’s proposal:

Flip two coins. Two heads results in a successful onside kick.

Then the probability would be 25%, closer to the current reality.

Unfortunately, that’s not exactly right, either — it’s based on a misleading statistic. The success rate of onside kicks is highly dependent on whether the team receiving the kickoff is expecting it or not. When teams are expecting it, the success rate hovers around 20%; when teams aren’t expecting it, however, the success rate jumps to 60%. Considering that data, the process might be modified as follows:

- Kicking team indicates to referee that they will try an onside kick.
- Of course, this must be done secretly, so as not to arouse the suspision of the receiving team. I propose that one referee be assigned to each team; the team would encode the message using RSA encryption, and the assigned referee would be given the corresponding RSA numbers. A message can then be passed without fear of interception by the receiving team. To ensure that this procedure does not signficantly delay the game, messages stating “we WILL try an onside kick” and “we WILL NOT try an onside kick” could be prepared in advance, and unemployed math PhD’s could be hired as NFL referees to decode the messages.

- The receiving team must similarly indicate whether or not they suspect an onside kick.
- Again, use RSA encryption.

- If the kicking team chooses an onside kick, and the receiving team suspects an onside kick, then:
- Flip 9 coins. If 9, 8, 3, or 1 of them land heads, the onside kick is successful.
- P(9, 8, 3, or 1 head with 9 coins) = 20.1%

- If the kicking team chooses an onside kick, but the receiving team does not suspect it, then:
- Flip 9 coins. If 9, 8, 5, 4, or 2 of them land heads, the onside kick is successful.
- P(9, 8, 5, 4, or 2 heads with 9 coins) = 60.0%

- If the kicking team does not choose an onside kick, then:
- Flip 9 coins, just so the receiving team is unaware of what the kicking team decided to do, which will allow for the element of surprise with future kicks.

If the NFL decides to accept Mark Schlereth’s suggestion for using coins to determine onside kicks, I am hopeful that they will give my proposal serious consideration. If necessary, I have an Excel spreadsheet that I would be willing to share with them.

### Random Number Generation

While playing Nurikabe, my sons completed the following puzzle:

The puzzle itself isn’t very interesting, but did you notice the Puzzle ID? Exactly 1,000,000. The boys thought this was pretty cool, and I did, too. Yeah, yeah, I know, the occurrence of 1,000,000 shouldn’t impress me more than the appearance of, say, 8,398,176 or 3,763,985. But there are just under 10,000,000 unique 5 × 5 puzzles on the site, and only nine of them contain six 0′s. How lucky were we to get that random number?

Generating random numbers can be a difficult proposition, especially for a computer. This article from WIRED magazine — which describes a pattern that inadvertently appeared on lottery tickets, making it possible to predict winning tickets before they were scratched — shows how difficult it can be to generate numbers that appear to be random. (The article really is worth a read, especially for math geeks. Truth be known, WIRED is the only magazine that I read cover-to-cover every month.)

Robert Coveyou, a mathematician who worked on the Manhattan project, was an expert in pseudo-random number generators. He is most famously remembered for the following quote:

The generation of random numbers is too important to be left to chance.

Of course, Randall Munroe at xkcd has a foolproof method for generating a random number:

I would hate for you to need a random number and then have difficulty generating one. I’m here to help, so I present the…

**MJ4MF Random Number Generator (PDF)**

Creating the MJ4MF RNG is quite simple. Just follow these steps:

- Download and print the PDF from the link above.
- Cut out all six squares, one for each number 1-6.
- For each square, make two folds: first, fold the paper to the center vertically; then, fold the paper to the center horizontally. The result of these two folds is shown, below left.
- When all six pieces are folded, interlace them to form a cube. This is shown, below middle. The assembled cube is shown, below right.

Finally, a joke about random numbers.

A student is asked for the probability that a random number chosen between 0 and 1 will be greater than 2/3. The student answers 1/3. The teacher says, “Great! Can you explain to the class how you arrived at your answer?” The student says, “There are three possibilities: the number is either less than, equal to, or greater than 2/3, so the probability is 1/3!”

### Three Outta Four

A cartoon for you on National Egg Day (June 3):

This cartoon was inspired by an article that appeared in the *Salt Lake Tribune*, October 11, 2002:

Bureaucrat’s Math Makes Dizzy Dozenby Paul Rolly and JoAnn Jacobsen-Wells

The menu at the Coffee Garden at 900 East and 900 South in Salt Lake City has included a scrumptious selection of quiche for about 10 years.

The recipe calls for four fresh eggs for each quiche.

A Salt Lake County Health Department inspector paid a visit recently and pointed out that research by the Food and Drug Administration indicates that one in four eggs carries Salmonella bacterium, so restaurants should never use more than three eggs when preparing quiche.

The manager on duty wondered aloud if simply throwing out three eggs from each dozen and using the remaining nine in four‑egg quiches would serve the same purpose.

The inspector wasn’t sure, but she said she would research it.

I promise you, I am not making that up.

### Prime Curio Redux

As I mentioned in yesterday’s review of *Prime Curios*, the book contains a lot of interesting facts about prime numbers. In fact, it contains so many intereting tidbits that I was still reading three hours after posting my review. On page 202, I discovered a rather interesting curio:

968,666,869

The smallest palindromic prime with embedded beast number whose digits contain circles, i.e., using only the digits 0, 6, 8, 9.

What struck me about this curio was the embarassingly small size of the set under consideration. If you consider the four subcategories contained within the description — prime, palindrome, embedded beast number, and using only the digits 0, 6, 8, and 9 — the intersection of those groups is miniscule.

Consider each piece in turn. To limit the discussion, let’s only worry about integers less than one billion, since the prime number described above falls below that threshold.

**Prime**

Rumor has it that there are 50,847,478 prime numbers less than 1,000,000,000. (That value seems reasonable, given that the Prime Number Theorem suggests that there should be about 10^{9}/ln(10^{9}) ≈ 48,254,952.) In other words, about 5.084% of the positive integers up to 1,000,000,000 are prime.

**Palindrome**

In general, there are 9 × 10^{[(n + 1)/2]} palidromes with *n* digits. That means that are there 9 + 9 + 90 + 90 + 900 + 900 + 9,000 + 9,000 + 90,000 + 90,000 = 199,998 palindromes less than 1,000,000,000. In other words, less than 0.020% of those numbers are palindromes.

**Embedded Beast Number**

Analyzing this part was pretty cool. How many numbers less than 1,000,000,000 have an embedded beast number, that is, how many numbers have a string of three consecutive 6′s? It took about an hour of playing to find a general formula. For positive integers with *n* digits, the number of positive integers with an embedded beast number is:

10^{n – 3} + 8 × 10^{n – 4} + (*n* – 4)(9^{2} × 10^{n – 5})

That formula revealed that there are 6,400,000 positive integers with an embedded beast number less than 1,000,000,000, or only about 0.640%.

[**update - 3/16/2011**]

As noted by Joshua Zucker in the comments, this formula is incorrect. It fails to remove numbers that have more than one string of three consecutive 6′s. As Josh noted, there are only 42,291 seven‑digit beast numbers (the formula gives 42,300), and there are only 503,748 eight‑digit beast numbers (the formula gives 504,000). I will try to correct this within the next several days.

**Circle Digits**

If the digits in a number are limited to just 0, 6, 8, and 9, then there are 262,143 positive integers with only circle digits less than 1,000,000,000, or a mere 0.026%.

So, what does all this nonsense get us? It says that the probability of a positive integer less than one billion being a palindromic prime with embedded beast number whose digits contain circles is approximately

*P* = 0.05084 × 0.00020 × 0.00640 × 0.00026 = 0.000 000 000 019 523,

or, in layman’s terms, really frickin’ small.

With the odds at about 1 in 50,000,000,000, it’s no suprise that the first occurrence of this type of number is just shy of a billion at 968,666,869.

### Fair and Square

I recently discovered a great problem:

Three points are randomly chosen along the perimeter of a square. What is the probability that the center of the square will be contained within the triangle formed by these three points?

My colleagues and I spent more time talking about this problem than I care to mention. But when all was said and done, I arrived at a wonderfully elegant solution. As usual, I won’t post the solution now to allow you some time to think about it, but I’ll post it in a few days.

The best part about this problem was the “Aha!” moment it afforded me. The solution eluded me when I forced myself to work on it. But yesterday morning, I was thinking about the problem while walking my dog. No pencil, no paper, no agenda… just time to think. And I kid you not — the solution came to me as I was picking up feces. (I have no idea what that says about me.)

This is my favorite part of mathematics. I can literally spend hours reworking equations, drawing figures, and thinking about a problem, and I’ll make no progress. Then later, when I least expect, when I’m freed from the confines of pencil and paper, the solution gently alights in my mind like a butterfly coming to rest on a marigold.

Oh, how I love that feeling!

Here are some math jokes that involve squares:

What keeps a tree in place?

Square roots.Where is the best location for a multiplication table?

Times Square.

And this one is more of a physics joke than a math joke, but I just love it…

Newton, Leibniz, and Pascal were playing hide-and-seek, and Leibniz was it. Pascal ran into the bushes, but Newton simply drew a box on the ground and stood in the middle of it. When Leibniz finished counting, he turned around and saw Newton just standing there.

“Newton, I’ve found you,” Leibniz said.

“No you haven’t,” argued Newton, “you’ve found Pascal.” Gesturing at the ground, he continued, “One Newton per square meter.”

### The Perfect Pack

I have a quirk.

Okay, truth be known, I have many. But this post is only going to elaborate on a particular mathematical quirk that I have, which involves eating M&M’s. (Most of my other quirks aren’t interesting enough to warrant a blog post. And those that are probably shouldn’t be publicized.)

I have to eat M&M’s in pairs of the same color. I place two in my mouth at a time, and I chew one on each side. I can’t eat them one at a time, and I can’t eat two M&M’s of different colors at the same time. It’s a balance thing. I’ve done this since I was a kid, and whether it’s just a bad habit or a deeply engrained compulsion, I don’t worry about it too much. Sure, it’s a little weird, but on the OCD continuum, it’s not a big deal. I mean, it’s not like I use a ruler to ensure that stamps are placed exactly the same distance from both sides of the envelope. (Though I have considered it.)

So, the math of this. I have been searching for the “perfect pack of M&M’s,” one in which there is an even number of every color. That way, I won’t have one leftover after I eat the others in pairs. I don’t know how many packs of M&M’s I’ve eaten in my life, but I’ve yet to find a perfect pack. Consequently, it would seem that the experimental probability of such an occurrence is 0. But what is the theoretical probability?

Stated formally, here’s the problem:

A standard pack of M&M’s contains pieces of six different colors. What is the probability that there will be an even number of M&M’s of each of the six colors?

I’ll post my solution in a couple days. In the meantime, here are two math jokes about M&M’s:

How many mathematicians does is take to make a batch of chocolate chip cookies?

Two. One to mix the batter, and one to peel the M&M’s.

How do you keep a math graduate student occupied for hours?

Ask him to alphabetize a bag of M&M’s.