Tag Archives: probability

From Coins to Magic

Here’s a great problem or trick for a class exploration … or magic for parties.

DO THIS YOURSELF.

Grab a small handful of coins (it doesn’t matter how many), randomly flip them onto a flat surface, and count the number of tails.

Randomly pull off from the group into a separate pile the number of coins equal to the number of tails you just counted.  Turn over every coin in this new pile.

Count the number of tails in each pile.

You got the same number both times!

Why?

 

Marilyn Vos Savant posed a similar problem:

Say that a hundred pennies are on a table. Ninety of them are heads. With your eyes closed, can you separate all the coins into two groups so that each group has the same number of tails?

Savant’s solution is to pull any random 10 coins from the 100 and make a second pile.  Turn all the coins in the new pile over, et voila!  Both piles have an equal number of tails.

While Savant’s approach is much more prescriptive than mine, both solutions work.  Every time.  WHY?

THIS IS STRANGE:

You have no idea the state (heads or tails) of any of the coins you pull into the second pile.  It’s counterintuitive that the two piles could ever contain the same number of tails.

Also, flipping the coins in the new pile seems completely arbitrary, and yet after any random pull & flip, the two resulting piles always hold the same number of tails.

Enter the power (and for young people, the mystery) of algebra to generalize a problem, supporting an argument that holds for all possibilities simultaneously.

HOW IT WORKS:

The first clue to this is the misdirection in Savant’s question.  Told that there are 90 heads, you are asked to make the number of tails equivalent.  In both versions, the number of TAILS in the original pile is the number of coins pulled into the second pile.  This isn’t a coincidence; it’s the key to the solution.

In any pile of randomly flipped coins (they needn’t be all or even part pennies), let N be the number tails.  Create your second pile by pulling a random coins from the initial pile.  Because the coins are randomly selected, you don’t know how many tails are in the new pile, so let that unknown number of coins be X .  That means 0 \le X \le N, leaving N-X tails in the first pile, and N-X heads in the new pile.  (Make sure you understand that last bit!)  That means if you flip all the coins in the second pile, those heads will become tails, and you are guaranteed exactly N-X tails in both piles.

Cool facts:

  • You can’t say with certainty how many tails will be in both piles, but you know they will be the same.
  • The total number of coins you start with is completely irrelevant.
  • While the given two versions of the problem make piles with equal numbers of heads, this “trick” can balance heads or tails.  To balance heads instead, pull from the initial coins into a second pile the number of heads.  When you flip all the coins in the second pile, both piles will now contain the same number of heads.

A PARTY WONDER or SOLID PROBLEM FOR AN ALGEBRA CLASS:

If you work on your showmanship, you can baffle others with this.  For my middle school daughter, I counted off the “leave alone” pile and then flipped the second pile.  I also let her flip the initial set of coins and tell me each time whether she wanted me to get equal numbers of heads or tails.  I looked away as she shuffled the coins and pulled off the requisite number of coins without looking.

She’s figured out HOW I do it, but as she is just starting algebra, she doesn’t have the abstractness yet to fully generalize the big solution.  She’ll get there.

I could see this becoming a fun data-gathering project for an algebra class.  It would be cool to see how someone approaches this with a group of students.

 

Advertisements

PowerBall Redux

Donate to a charity instead.  Let me explain.
The majority of responses to my PowerBall description/warnings yesterday have been, “If you don’t play, you can’t win.”  Unfortunately, I know many, many people are buying many lottery tickets, way more than they should.
 
OK.  For almost everyone, there’s little harm in spending $2 on a ticket for the entertainment, but don’t expect to win, and don’t buy multiple tickets unless you can afford to do without every dollar you spend. I worry about those who are “investing” tens or hundreds of dollars on any lottery.
Two of my school colleagues captured the idea of a lottery yesterday with their analogies,
Steve:  Suppose you go to the beach and grab a handful of sand and bring it back to your house.  And you do that every single day. Then your odds of winning the powerball are still slightly worse than picking out one particular grain of sand from all the sand you accumulated over an entire year.
Or more simply put from the perspective of a lottery official, 
Patrick:  Here’s our idea.  You guys all throw your money in a big pile.  Then, after we take some of it, we’ll give the pile to just one of you.
WHY YOU SHOULDN’T BUY MULTIPLE TICKETS:
For perspective, a football field is 120 yards long, or 703.6 US dollars long using the logic of my last post. Rounding up, that would buy you 352 PowerBall tickets. That means investing $704 dollars would buy you a single football field length of chances in 10.5 coast-to-coast traverses of the entire United States.  There’s going to be an incredibly large number of disappointed people tomorrow.
MORAL:  Even an incredibly large multiple of a less-than-microscopic chance is still a less-than-microscopic chance.
BETTER IDEA: Assume you have the resources and are willing to part with tens or hundreds of dollars for no likelihood of tangible personal gain.  Using the $704 football example, buy 2 tickets and donate the other $700 to charity. You’ll do much more good.

PowerBall Math

Given the record size and mania surrounding the current PowerBall Lottery, I thought some of you might be interested in bringing that game into perspective.  This could be an interesting application with some teachers and students.

It certainly is entertaining for many to dream about what you would do if you happened to be lucky enough to win an astronomical lottery.  And lottery vendors are quick to note that your dreams can’t come true if you don’t play.  Nice advertising.  I’ll let the numbers speak to the veracity of the Lottery’s encouragement.

PowerBall is played by picking any 5 different numbers between 1 & 69, and then one PowerBall number between 1 & 26.  So there are nCr(69,5)*26=292,201,338 outcomes for this game.  Unfortunately, humans have a particularly difficult time understanding extremely large numbers, so I offer an analogy to bring it a little into perspective.

  • The horizontal width of the United States is generally reported to be 2680 miles, and a U.S. dollar bill is 6.14 inches wide.  That means the U.S. is approximately 27,655,505 dollar bills wide.
  • If I have 292,201,338 dollar bills (one for every possible PowerBall outcome), I could make a line of dollar bills placed end-to-end from the U.S. East Coast all the way to the West Coast, back to the East, back to the West, and so forth, passing back and forth between the two coasts just over 10.5 times.
  • Now imagine that exactly one of those dollar bills was replaced with a replica dollar bill made from gold colored paper.

 

Your chances of winning the PowerBall lottery are the same as randomly selecting that single gold note from all of those dollar bills laid end-to-end and crossing the entire breadth of the United States 10.5 times. 

Dreaming is fun, but how likely is this particular dream to become real?

Play the lottery if doing so is entertaining to you, but like going to the movie theater, don’t expect to get any money back in return.

Mistakes are Good

Confession #1:  My answers on my last post were WRONG.

I briefly thought about taking that post down, but discarded that idea when I thought about the reality that almost all published mathematics is polished, cleaned, and optimized.  Many students struggle with mathematics under the misconception that their first attempts at any topic should be as polished as what they read in published sources.

While not precisely from the same perspective, Dan Teague recently wrote an excellent, short piece of advice to new teachers on NCTM’s ‘blog entitled Demonstrating Competence by Making Mistakes.  I argue Dan’s advice actually applies to all teachers, so in the spirit of showing how to stick with a problem and not just walking away saying “I was wrong”, I’m going to keep my original post up, add an advisory note at the start about the error, and show below how I corrected my error.

Confession #2:  My approach was a much longer and far less elegant solution than the identical approaches offered by a comment by “P” on my last post and the solution offered on FiveThirtyEight.  Rather than just accepting the alternative solution, as too many students are wont to do, I acknowledged the more efficient approach of others before proceeding to find a way to get the answer through my initial idea.

I’ll also admit that I didn’t immediately see the simple approach to the answer and rushed my post in the time I had available to get it up before the answer went live on FiveThirtyEight.

GENERAL STRATEGY and GOALS:

1-Use a PDF:  The original FiveThirtyEight post asked for the expected time before the siblings simultaneously finished their tasks.  I interpreted this as expected value, and I knew how to compute the expected value of a pdf of a random variable.  All I needed was the potential wait times, t, and their corresponding probabilities.  My approach was solid, but a few of my computations were off.

2-Use Self-Similarity:  I don’t see many people employing the self-similarity tactic I used in my initial solution.  Resolving my initial solution would allow me to continue using what I consider a pretty elegant strategy for handling cumbersome infinite sums.

A CORRECTED SOLUTION:

Stage 1:  My table for the distribution of initial choices was correct, as were my conclusions about the probability and expected time if they chose the same initial app.

App1

My first mistake was in my calculation of the expected time if they did not choose the same initial app.  The 20 numbers in blue above represent that sample space.  Notice that there are 8 times where one sibling chose a 5-minute app, leaving 6 other times where one sibling chose a 4-minute app while the other chose something shorter.  Similarly, there are 4 choices of an at most 3-minute app, and 2 choices of an at most 2-minute app.  So the expected length of time spent by the longer app if the same was not chosen for both is

E(Round1) = \frac{1}{20}*(8*5+6*4+4*3+2*2)=4 minutes,

a notably longer time than I initially reported.

For the initial app choice, there is a \frac{1}{5} chance they choose the same app for an average time of 3 minutes, and a \frac{4}{5} chance they choose different apps for an average time of 4 minutes.

Stage 2:  My biggest error was a rushed assumption that all of the entries I gave in the Round 2 table were equally likely.  That is clearly false as you can see from Table 1 above.  There are only two instances of a time difference of 4, while there are eight instances of a time difference of 1.  A correct solution using my approach needs to account for these varied probabilities.  Here is a revised version of Table 2 with these probabilities included.

App4

Conveniently–as I had noted without full realization in my last post–the revised Table 2 still shows the distribution for the 2nd and all future potential rounds until the siblings finally align, including the probabilities.  This proved to be a critical feature of the problem.

Another oversight was not fully recognizing which events would contribute to increasing the time before parity.  The yellow highlighted cells in Table 2 are those for which the next app choice was longer than the current time difference, and any of these would increase the length of a trial.

I was initially correct in concluding there was a \frac{1}{5} probability of the second app choice achieving a simultaneous finish and that this would not result in any additional total time.  I missed the fact that the six non-highlighted values also did not result in additional time and that there was a \frac{1}{5} chance of this happening.

That leaves a \frac{3}{5} chance of the trial time extending by selecting one of the highlighted events.  If that happens, the expected time the trial would continue is

\displaystyle \frac{4*4+(4+3)*3+(4+3+2)*2+(4+3+2+1)*1}{4+(4+3)+(4+3+2)+(4+3+2+1)}=\frac{13}{6} minutes.

Iterating:  So now I recognized there were 3 potential outcomes at Stage 2–a \frac{1}{5} chance of matching and ending, a \frac{1}{5} chance of not matching but not adding time, and a \frac{3}{5} chance of not matching and adding an average \frac{13}{6} minutes.  Conveniently, the last two possibilities still combined to recreate perfectly the outcomes and probabilities of the original Stage 2, creating a self-similar, pseudo-fractal situation.  Here’s the revised flowchart for time.

App5

Invoking the similarity, if there were T minutes remaining after arriving at Stage 2, then there was a \frac{1}{5} chance of adding 0 minutes, a \frac{1}{5} chance of remaining at T minutes, and a \frac{3}{5} chance of adding \frac{13}{6} minutes–that is being at T+\frac{13}{6} minutes.  Equating all of this allows me to solve for T.

T=\frac{1}{5}*0+\frac{1}{5}*T+\frac{3}{5}*\left( T+\frac{13}{6} \right) \longrightarrow T=6.5 minutes

Time Solution:  As noted above, at the start, there was a \frac{1}{5} chance of immediately matching with an average 3 minutes, and there was a \frac{4}{5} chance of not matching while using an average 4 minutes.  I just showed that from this latter stage, one would expect to need to use an additional mean 6.5 minutes for the siblings to end simultaneously, for a mean total of 10.5 minutes.  That means the overall expected time spent is

Total Expected Time =\frac{1}{5}*3 + \frac{4}{5}*10.5 = 9 minutes.

Number of Rounds Solution:  My initial computation of the number of rounds was actually correct–despite the comment from “P” in my last post–but I think the explanation could have been clearer.  I’ll try again.

App6

One round is obviously required for the first choice, and in the \frac{4}{5} chance the siblings don’t match, let N be the average number of rounds remaining.  In Stage 2, there’s a \frac{1}{5} chance the trial will end with the next choice, and a \frac{4}{5} chance there will still be N rounds remaining.  This second situation is correct because both the no time added and time added possibilities combine to reset Table 2 with a combined probability of \frac{4}{5}.  As before, I invoke self-similarity to find N.

N = \frac{1}{5}*1 + \frac{4}{5}*N \longrightarrow N=5

Therefore, the expected number of rounds is \frac{1}{5}*1 + \frac{4}{5}*5 = 4.2 rounds.

It would be cool if someone could confirm this prediction by simulation.

CONCLUSION:

I corrected my work and found the exact solution proposed by others and simulated by Steve!   Even better, I have shown my approach works and, while notably less elegant, one could solve this expected value problem by invoking the definition of expected value.

Best of all, I learned from a mistake and didn’t give up on a problem.  Now that’s the real lesson I hope all of my students get.

Happy New Year, everyone!

Great Probability Problems

UPDATE:  Unfortunately, there are a couple errors in my computations below that I found after this post went live.  In my next post, Mistakes are Good, I fix those errors and reflect on the process of learning from them.

ORIGINAL POST:

A post last week to the AP Statistics Teacher Community by David Bock alerted me to the new weekly Puzzler by Nate Silver’s new Web site, http://fivethirtyeight.com/.  As David noted, with their focus on probability, this new feature offers some great possibilities for AP Statistics probability and simulation.

I describe below FiveThirtyEight’s first three Puzzlers along with a potential solution to the last one.  If you’re searching for some great problems for your classes or challenges for some, try these out!

THE FIRST THREE PUZZLERS:

The first Puzzler asked a variation on a great engineering question:

You work for a tech firm developing the newest smartphone that supposedly can survive falls from great heights. Your firm wants to advertise the maximum height from which the phone can be dropped without breaking.

You are given two of the smartphones and access to a 100-story tower from which you can drop either phone from whatever story you want. If it doesn’t break when it falls, you can retrieve it and use it for future drops. But if it breaks, you don’t get a replacement phone.

Using the two phones, what is the minimum number of drops you need to ensure that you can determine exactly the highest story from which a dropped phone does not break? (Assume you know that it breaks when dropped from the very top.) What if, instead, the tower were 1,000 stories high?

The second Puzzler investigated random geyser eruptions:

You arrive at the beautiful Three Geysers National Park. You read a placard explaining that the three eponymous geysers — creatively named A, B and C — erupt at intervals of precisely two hours, four hours and six hours, respectively. However, you just got there, so you have no idea how the three eruptions are staggered. Assuming they each started erupting at some independently random point in history, what are the probabilities that A, B and C, respectively, will be the first to erupt after your arrival?

Both very cool problems with solutions on the FiveThirtyEight site.  The current Puzzler talked about siblings playing with new phone apps.

You’ve just finished unwrapping your holiday presents. You and your sister got brand-new smartphones, opening them at the same moment. You immediately both start doing important tasks on the Internet, and each task you do takes one to five minutes. (All tasks take exactly one, two, three, four or five minutes, with an equal probability of each). After each task, you have a brief moment of clarity. During these, you remember that you and your sister are supposed to join the rest of the family for dinner and that you promised each other you’d arrive together. You ask if your sister is ready to eat, but if she is still in the middle of a task, she asks for time to finish it. In that case, you now have time to kill, so you start a new task (again, it will take one, two, three, four or five minutes, exactly, with an equal probability of each). If she asks you if it’s time for dinner while you’re still busy, you ask for time to finish up and she starts a new task and so on. From the moment you first open your gifts, how long on average does it take for both of you to be between tasks at the same time so you can finally eat? (You can assume the “moments of clarity” are so brief as to take no measurable time at all.)

SOLVING THE CURRENT PUZZLER:

Before I started, I saw Nick Brown‘s interesting Tweet of his simulation.

cw4fvbgwsaai00c

If Nick’s correct, it looks like a mode of 5 minutes and an understandable right skew.  I approached the solution by first considering the distribution of initial random app choices.

App1

There is a \displaystyle \frac{5}{25} chance the siblings choose the same app and head to dinner after the first round.  The expected length of that round is \frac{1}{5} \cdot \left( 1+2=3=4+5 \right) = 3 minutes.

That means there is a \displaystyle \frac{4}{5} chance different length apps are chosen with time differences between 1 and 4 minutes.  In the case of unequal apps, the average time spent before the shorter app finishes is \frac{1}{25} \cdot \left( 8*1+6*2+4*3+2*4 \right) = 1.6 minutes.

It doesn’t matter which sibling chose the shorter app.  That sibling chooses next with distribution as follows.

App2

While the distributions are different, conveniently, there is still a time difference between 1 and 4 minutes when the total times aren’t equal.  That means the second table shows the distribution for the 2nd and all future potential rounds until the siblings finally align.  While this problem has the potential to extend for quite some time, this adds a nice pseudo-fractal self-similarity to the scenario.

As noted, there is a \displaystyle \frac{4}{20}=\frac{1}{5} chance they complete their apps on any round after the first, and this would not add any additional time to the total as the sibling making the choice at this time would have initially chosen the shorter total app time(s).  Each round after the first will take an expected time of \frac{1}{20} \cdot \left( 7*1+5*2+3*3+1*4 \right) = 1.5 minutes.

The only remaining question is the expected number of rounds of app choices the siblings will take if they don’t align on their first choice.  This is where I invoked self-similarity.

In the initial choice there was a \frac{4}{5} chance one sibling would take an average 1.6 minutes using a shorter app than the other.  From there, some unknown average N choices remain.  There is a \frac{1}{5} chance the choosing sibling ends the experiment with no additional time, and a \frac{4}{5} chance s/he takes an average 1.5 minutes to end up back at the Table 2 distribution, still needing an average N choices to finish the experiment (the pseudo-fractal self-similarity connection).  All of this is simulated in the flowchart below.

App3

Recognizing the self-similarity allows me to solve for N.

\displaystyle N = \frac{1}{5} \cdot 1 + \frac{4}{5} \cdot N \longrightarrow N=5

FINAL ANSWER:

Number of Rounds – Starting from the beginning, there is a \frac{1}{5} chance of ending in 1 round and a \frac{4}{5} chance of ending in an average 5 rounds, so the expected number of rounds of app choices before the siblings simultaneously end is

\frac{1}{5} *1 + \frac{4}{5}*5=4.2 rounds

Time until Eating – In the first choice, there is a \frac{1}{5} chance of ending in 3 minutes.  If that doesn’t happen, there is a subsequent \frac{1}{5} chance of ending with the second choice with no additional time.  If neither of those events happen, there will be 1.6 minutes on the first choice plus an average 5 more rounds, each taking an average 1.5 minutes, for a total average 1.6+5*1.5=9.1 minutes.  So the total average time until both siblings finish simultaneously will be

\frac{1}{5}*3+\frac{4}{5}*9.1 = 7.88 minutes

CONCLUSION:

My 7.88 minute mean is reasonably to the right of Nick’s 5 minute mode shown above.  We’ll see tomorrow if I match the FiveThirtyEight solution.

Anyone else want to give it a go?  I’d love to hear other approaches.

Marilyn vos Savant Conditional Probability Follow Up

In the Marilyn vos Savant problem I posted yesterday, I focused on the subtle shift from simple to conditional probability the writer of the question appeared to miss.  Two of my students took a different approach.

The majority of my students, typical of AP Statistics students’ tendencies very early in the course, tried to use a “wall of words” to explain away the discrepancy rather than providing quantitative evidence.  But two fully embraced the probabilities and developed the following probability tree to incorporate all of the given probabilities.  Each branch shows the probability of a short or long straw given the present state of the system.  Notice that it includes both of the apparently confounding 1/3 and 1/2 probabilities.

Marilyn_conditional2

The uncontested probability of the first person is 1/4.

The probability of the second person is then (3/4)(1/3) = 1/4, exactly as expected.  The probabilities of the 3rd and 4th people can be similarly computed to arrive at the same 1/4 final result.

My students argued essentially that the writer was correct in saying the probability of the second person having the short straw was 1/3 in the instant after it was revealed that the first person didn’t have the straw, but that they had forgotten to incorporate the probability of arriving in that state.  When you use all of the information, the probability of each person receiving the short straw remains at 1/4, just as expected.

Marilyn vos Savant and Conditional Probability

The following question appeared in the “Ask Marilyn” column in the August 16, 2015 issue of Parade magazine.  The writer seems stuck between two probabilities.

Marilyn_conditional

(Click here for a cleaned-up online version if you don’t like the newspaper look.)

I just pitched this question to my statistics class (we start the year with a probability unit).  I thought some of you might like it for your classes, too.

I asked them to do two things.  1) Answer the writer’s question, AND 2) Use precise probability terminology to identify the source of the writer’s conundrum.  Can you answer both before reading further?

SOLUTION ALERT:

Very briefly, the writer is correct in both situations.  If each of the four people draws a random straw, there is absolutely a 1 in 4 chance of each drawing the straw.  Think about shuffling the straws and “dealing” one to each person much like shuffling a deck of cards and dealing out all of the cards.  Any given straw or card is equally likely to land in any player’s hand.

Now let the first person look at his or her straw.  It is either short or not.  The author is then correct at claiming the probability of others holding the straw is now 0 (if the first person found the short straw) or 1/3 (if the first person did not).  And this is precisely the source of the writer’s conundrum.  She’s actually asking two different questions but thinks she’s asking only one.

The 1/4 result is from a pure, simple probability scenario.  There are four possible equally-likely locations for the short straw.

The 0 and 1/3 results happen only after the first (or any other) person looks at his or her straw.  At that point, the problem shifts from simple probability to conditional probability.  After observing a straw, the question shifts to determining the probability that one of the remaining people has the short straw GIVEN that you know the result of one person’s draw.

So, the writer was correct in all of her claims; she just didn’t realize she was asking two fundamentally different questions.  That’s a pretty excusable lapse, in my opinion.  Slips into conditional probability are often missed.

Perhaps the most famous of these misses is the solution to the Monty Hall scenario that vos Savant famously posited years ago.  What I particularly love about this is the number of very-well-educated mathematicians who missed the conditional and wrote flaming retorts to vos Savant brandishing their PhDs and ultimately found themselves publicly supporting errant conclusions.  You can read the original question, errant responses, and vos Savant’s very clear explanation here.

CONCLUSION:

Probability is subtle and catches all of us at some point.  Even so, the careful thinking required to dissect and answer subtle probability questions is arguably one of the best exercises of logical reasoning around.

RANDOM(?) CONNECTION:

As a completely different connection, I think this is very much like Heisenberg’s Uncertainty Principle.  Until the first straw is observed, the short straw really could (does?) exist in all hands simultaneously.  Observing the system (looking at one person’s straw) permanently changes the state of the system, bifurcating forever the system into one of two potential future states:  the short straw is found in the first hand or is it not.

CORRECTION (3 hours after posting):

I knew I was likely to overstate or misname something in my final connection.  Thanks to Mike Lawler (@mikeandallie) for a quick correction via Twitter.  I should have called this quantum superposition and not the uncertainty principle.  Thanks so much, Mike.