## Ask Professor Puzzler

Do you have a question you would like to ask Professor Puzzler? Click here to ask your question!

Sarah asks, "On your site you asked the following question and i believe your answer is incorrect. "I have a drawer with 10 socks. 6 are blue and 4 are red. I draw a blue sock randomly and then I draw a red sock randomly. Are these independent or dependent events". You answered even though it is without replacement these are independent. I believe the answer should be dependent, since there is one less sock in the draw when you pick the red one. Am I correct?"

Hi Sarah, thanks for asking this question. I went back and looked at the page your question refers to (Independent and Dependent Events) and realized that the question you were asking about may be a bit ambiguous in how it's worded. Does it mean:

- I drew a sock specifically from the set of blue socks (in other words, I looked in the drawer to find the blue socks, and then randomly selected from that subset) or...
- I reached into the drawer without looking, and randomly pulled out a sock from the entire set, and that randomly selected sock happened to be blue.

I write competition math problems for various math leagues, and I always hate writing probability problems, because they can be so easily written in an ambiguous way (my proofreader hates proofreading them for the same reason). In this case, let's take a look at these two possible interpretations of the problem.

In the first case, the two events are clearly independent; it doesn't matter *which *of the blue socks was chosen; there are still 4 red socks, and the probability of choosing any particular red sock is 1/4. Thus, the second event is not affected by the first event.

In the second case, I randomly pulled a sock from the drawer, but now we're given the additional information that this sock happened to be blue. So this means that when I reach back into the drawer, there are now nine socks to choose from (not four, as in the previous case, because we assume I'm picking from the entire contents of the drawer.) Since we know that the sock I first chose is blue, there are still 4 red socks, so the probability of choosing a red is 4/9. We get a different answer if we read it this way, but we still have two events that don't affect each other. Since we know the first sock was blue, it doesn't matter *which *blue sock it was. The specifics of the draw don't affect the outcome of the second draw.

Here's how to make these two events *dependent*: don't specify that the first draw was blue. Now the result of the second draw is very much dependent on whether or not the first draw was blue. That's probably the situation you were thinking of.

Thank you for asking the question - as a result of your question, I'm going to do some tweaking in the wording of that problem. I don't want it to be ambiguous - especially since the second reading of the problem delves into conditional probabilities, which I don't address on that page!

"I just had an odd revelation in math today. I'm a seventh grader, and my teacher suggested I email a professor. We were doing some pretty basic math, comparing x to 3 and writing out how x could be greater, less than or equal to 3. But then it occurred to me; would that make a higher probability of x being less than 3? I mean, if we were comparing x to 0, there would be a 50% chance of getting a negative, and a 50% chance of being positive, correct? So, even though 3 in comparison to an infinite amount of negative and positive numbers is minuscule, it would tip the scales just a little, right?" ~ Ella from California

Good morning Ella,

This is a very interesting question! For the sake of exploring this idea, can we agree that we’re talking about just integers (In other words, our random pick of a number could be -7, or 8, but it can’t be 2.5 or 1/3)? You didn’t specify one way or the other, and limiting our choices to integers will make it simpler to reason it out.

I’d like to start by pointing out that doing a random selection from all integers is a physical impossibility in the real world. There are essentially three ways we could attempt it: mental, physical, and digital. All three methods are impossible to do.

Mental: Your brain is incapable of randomly selecting from an infinite (unbounded) set of integers. You’ll be far more likely to pick the number one thousand than (for example) any number with seven trillion digits.

Physical: Write integers on slips of paper and put them in a hat. Then draw one. You’ll be writing forever if you must have an infinite number of slips. You’ll never get around to drawing one!

Digital: As a computer programmer who develops games for this site, I often tell the computer to generate random numbers for me. It looks like this: number = rand(-10000, 10000), and it gives me a random integer between -10000 and +10000. But I can’t put infinity in there. Even if I could, it would require an infinite amount of storage to create infinitely large random numbers. (The same issue holds true for doing it mentally, by the way – your brain only has so much storage capacity!)

Okay, so having clarified that this is not a practical exercise, we have to treat it as purely theoretical. So let’s talk about theory. Mathematically, we define probability as follows:

Probability of event happening = (desired outcomes)/(possible outcomes).

For example, If I pull a card from a deck of cards, what’s the probability that it’s an Ace?

Probability of an Ace = 4/52, because there are 4 desired outcomes (four aces) out of 52 possible outcomes.

But here’s where we run into a problem. The definition of probability requires you to put actual numbers in. And infinity is not a number. I have hilarious conversations with my five-year-old son about this – someone told him about infinity, and he just can’t let go of the idea. "Daddy, infinity is the biggest number, but if you add one to it, you get something even bigger." Infinity can’t be a number, because you can always add one to any number, giving you an even bigger number, which would mean that infinity is actually not infinity, since there’s something even bigger.

So here’s where we’re at: we can’t do this practically, and we also can’t do it theoretically, using our definition of probability. So instead, we use a concept called a “limit” to produce our theoretical result. This may get a bit complicated for a seventh grader, so I'll forgive you if your eyes glaze over for the next couple paragraphs!

Let’s forget for a moment the idea of an infinite number of integers, and focus on integers in the range negative ten to positive ten. If we wanted the probability of picking a number less than 3, we’d have: Probability = 13/21, because there are 13 integers less than 3, and a total of 21 in all (ten negatives, ten positives, plus zero). What if the range was -100 to +100? Then Probability = 103/201. If the range was -1000 to +1000, we’d have 1003/2001.

Now let’s take this a step further and say that the integers range from -x to +x, where x is some integer we pick. The probability is (x + 3)/(2x + 1). Now we ask, “As x gets bigger and bigger, what does this fraction approach?” Mathematically, we write it as shown in the image below:

We'd read this as: "the limit as x approaches infinity of (x + 3) over (2x + 1)."

Evaluating limits like this is something my Pre-Calculus and Calculus students work on. Don’t worry, I’m not going to try to make you evaluate it – I’ll just send you here: Wolfram Limit Calculator. In the first textbox, type “inf” and in the second textbox, type (x + 3)/(2x + 1). Then click submit. The calculator will tell you that the limit is 1/2.

That’s probably not what you wanted to hear, right? You wanted me to tell you that the probability is just a tiny bit more than 1/2. And I sympathize with that – I’d like it to be more than 1/2 too! But remember that since infinity isn’t a number, we can’t plug it into our probability formula, so the probability doesn’t exist; only the limit of the probability exists. And that limit is 1/2.

Just for fun, if we could do arithmetic operations on infinity, I could solve it this way: “How many integers are there less than 3? An infinite number. How many integers are there three or greater? An infinite number. How many is that in all? Twice infinity. Therefore the probability is ∞/(2∞) = 1/2.” We can’t do arithmetic operations on infinity like that, because if we try, we eventually end up with some weird contradictions. But even so, it’s interesting that we end up with the same answer by reasoning it out that way!

PS - For clarification, "Professor Puzzler" is a pseudonym, and I'm not *actually* a professor. I'm a high school math teacher, tutor, and writer of competition math problems. So if your teacher needs you to contact an "actual professor," you should get a second opinion.

This morning's question is, in essence, if you know the probability of an event happening, what is the probability of it NOT happening?

To answer this question, it's good to remember that a probability is a ratio. It is: [number of desired outcomes] : [total number of outcomes] (assuming that all outcomes are equally likely).

Let's consider the flipping of a coin. Suppose you want the probability of getting heads. The number of desired outcomes is 1. The total number of outcomes is 2.*

'So the probability is 1/2. So what is the probability of NOT getting heads? Well, that's the same as the probability of getting tails. Desired outcomes: 1, possible outcomes 2. Thus, the probability is also 1/2.

* I've had students argue that a coin could land on its rim, so there are actually 3 possible outcomes. I point out to them that there are a couple problems with that. First, if it lands on the rim, we re-roll the coin, so that really doesn't count. Second, if we decided to *keep* that roll, we can't use our ratio definition above, because all outcomes are not equally likely.

So now let's switch gears and talk about a six-sided die. What is the probability of getting a perfect square when you roll the die? Well, there are 2 perfect squares that are possible results: 1, and 4. So desired outcomes = 2, total outcomes = 6. Thus the probability is 2/6 (we can simplify that to 1/3, but for now I'd like to keep in the form 2/6).

What is the probability of NOT getting a perfect square? Well, there are 4 numbers that aren't perfect squares: 2, 3, 5, and 6. Desired outcomes = 4, total outcomes = 6. Probability is 4/6.

Let's try one more example. What is the probability of rolling a total of 12 if you roll two six-sided dice?

There is only one way to get a sum of 12: you need a six on each die. There is a total of 6 x 6 = 36 possible outcomes. Desired = 1, Total = 36, probability = 1/36. What about the probability of NOT rolling a 12? Well, you could list off all the possible outcomes, but let's reason this out instead. If there are 36 possible outcomes, and only one of them leads to a sum of 12, how many *don't* lead to a sum of 12? The answer should be fairly obvious: 36 - 1 = 35. Desired = 35, total = 36, probablity = 35/36.

Now let's put those results together:

Coin: 1/2; 1/2

Die: 2/6; 4/6

2 Dice: 1/36; 35/36

Hopefully you can see a pattern here: in each case, the probabilities add to 1. And, if you think about how we reasoned out the example with two dice, that should make sense to you; every outcome is either a *desired* or a *not desired* outcome. There are no other options. So when you add together those options, you get the *total* number of outcomes. And [total outcomes]/[total outcomes] = 1.

We can write this rule as an equation like this: P(x) + P(~x) = 1.

In words: The probability of x, plus the probability of NOT x equals 1.

I hope that helps!

Yesterday, I answered a question about the Monty Hall Three-Door Game, which you can read about in the previous blog post. After posting the article, I shared it on social media, and commented that talking about this problem feels like wading into a murky swamp, because everyone brings their own assumptions into the problem, and it's tough to guess what those assumptions are.

But I realized, too, that it's not just this problem; it's probability in general. I love probability, and I hate probability. Whenever a district/county/state asks me to write competition math problems for their league or math meet, I know that I need to give some probability problems - everyone expects it! But there's no kind of math problem that I'm more afraid that I'll mess up. I'm grateful for a proofreader to give my problems a second pair of eyes (although my proofreader shares my feelings about probability). More often than not, I'll figure out a way to write a program to function as an electronic simulation of my problem, to verify empirically that I have arrived at the right solution.

Anyway, one of the reasons that probability feels so murky to me is that gut reactions can lead you astray. The Three-Door game is a prime example of how those gut reactions can mess you up. Monty asks you to pick a door, knowing that one of those doors has a prize behind it, and the other two have nothing. After you pick, Monty opens one of the *other* doors to show you that it's empty, and asks you if you'd like to keep your original guess, or switch to the other unopened door.

Most people's gut reaction is that it doesn't matter whether you keep your original guess or switch to a different guess. This gut reaction is wrong, as you can verify by playing the simulation I built here: The Monty Hall Simulation. For those who are still struggling with this, I'd like to offer a couple different ways of looking at the problem.

## The "Not" Probability

We tend to focus on the probability of guessing correctly the first time. Instead, let's focus on the probability of NOT guessing correctly. If you picked door A, then the probability that you were correct is 1/3. This means that the probability you did *not* guess correctly is 2/3. But really, what is that? It's the probability that either door B or door C is correct.

So if P_{B} is the probability that door B holds the prize, and P_{C} is the probability for door C, we can write the following equation:

P_{B} + P_{C} = 2/3.

Now Monty opens one of those two doors (we'll say C), that he knows is empty. This action tells you absolutely *nothing *about the door you opened, but it does tell you something about door C - it tells you that P_{C} = 0.

Since P_{B} + P_{C} = 2/3, and P_{C} = 0, we can conclude that P_{B} = 2/3. This is exactly the result which the simulation linked above gives.

## Two Doors vs. One Door Choice

Related to the above way of looking at it, try looking at it with a set of slightly modified rules:

- You pick a door
- Monty says to you: "I'll let you keep your guess, or I'll let you switch your guess to
*both*of the other two doors."

Under these circumstances, of *course* you're going to switch. Why? Because if you keep your guess, you only have one door, but the choice Monty is offering you is to have *two *doors, so your probability of winning is twice as great. In a sense, that's actually what you're doing in the real game, even though it doesn't appear that way. You're choosing two doors over one, and the fact that Monty knows which one of those two doors is empty (and can even show you that one is empty) doesn't change the fact that you're better off having two doors than one.

Before getting to the question for this morning, I'd like to direct your attention to our simulation of a game show with three doors. It's called the "Monty Hall Game." Understanding this game will be important to thinking about Tracie's question below.

The short summary of the game: There are three doors, and only one of them has a prize behind it. You pick a door. Then Monty opens another door to show you that it's empty, and asks you if you want to switch your guess. What do you do?

Tracie from South Dakota asks, "So if the game show host opened 2 doors for me, would I still have 1/3 probability of winning?"

Hi Tracie, your question highlights a couple of the things about the Monty Hall game that often causes confusion.

- Monty Hall knows in advance where the pot of gold (or new car, or whatever) is. The rules of the game are that he opens an empty door. But if he
*always*opens an empty door, that means he*knows*where the empty doors are. That's an important concept to understand. He's not being entirely random in his choice of doors to open. There are two empty doors, so if you pick one of them, he picks the other. The only time he's being random is when you pick correctly; in that circumstance he randomly picks one of the empty doors to open. - This is not a static problem - the circumstances change, and because the circumstances change, the probabilities could change as well. Let me give you an example. Suppose that during Christmas vacation, we decide we want to take our kids sledding. Since I'm not teaching that week, I can pick any day of the week to go. So we would say that my probability of picking Tuesday is 1/7 (there are seven days in a week, and Tuesday is one of them). Now suppose that my wife looks at a weather forecast, and says, "Oh! Thursday, Friday and Saturday are supposed to be cold, with a wind chill of -20 F!" If I use that information in making my choice, what is my probability of picking Tuesday now? It's 1/4, because we've eliminated 3 of the 7 days. That doesn't mean the original 1/7 is
*wrong*- it means that the conditions of the problem have been changed, and so we have to calculate a new probability. This is not, by the way, a perfect analogy to the Monty Hall problem, so please don't try to make it match. The differences are:- We're talking about the probability that I'll pick a certain day, not the probability that the day I pick is a good one.
- We don't know that there's only one good sledding day.
- My wife is not deviously hiding known information from me.
- Weather forecasts are not 100% accurate anyway.
- There is no #5, but at the end of this post, I'll - just for fun - turn this example into a better analogy for the Monty Hall Game.

Okay, so how does this relate to your question? Number two should be fairly obvious; we have a change in conditions, so there's no reason to assume that the probability will stay the same. The probability of you winning WAS 1/3, but the changing conditions mean we have to recalculate the probability.

But here's the more important issue. Monty Hall *can't* play the game the way you suggest. Why not? Because if the rules of the game are "Monty will open two empty doors," Monty is going to run into trouble every time you *don't* pick the right door. Because if you pick the wrong door, how many empty doors are there left for Monty to open? Only one! If you pick one of the empty doors, then there's only one other empty door for him to open.

If he opens two doors, that means you've picked the correct door. So even though your original choice was 1/3 probability of winning, under the new circumstances, you have a probability of 1 (100% chance) of winning.

If you're wondering how that number 1/3 fits into the solution it fits like this: The probability that Monty can open two doors is 1/3 (the same as the probability that you selected correctly). So the number 1/3 is still in there - just in a different place!

If you're wondering why the probability changes in this case, but doesn't when he opens one door, the answer is this: When he opens just one door, he has not given you any information about the door you opened. When he opens two doors, he *has* (indirectly) given you information about your door.

To add to this, the only way Monty could do the two-door rule would be to have to have a pair of rules:

- If you pick the right door, he will open two doors. (this happens 1/3 of the time)
- If you pick the wrong door, he will open one door. (this happens 2/3 of the time)

The problem with this is: if you know the rules, you can do an always-winning strategy. If he opens two doors, you've automatically won, and if he only opens one door, that means you picked the wrong door, so you must swap. Monty would DEFINITELY not want to play by those rules!

Addendum: If you would like to look at a couple different ways of understanding the Monty Hall problem, you can find more write-up here: The Murky Swamp of Probability.

**Sledding in December**. Let's say my wife looked at the weather forecast and told me, "Every day but one this week is going to have a wind chill of -20 F, and there will be one day that's going to be sunny and warm. So, randomly pick a day for sledding." (My wife hates the cold, so she would definitely not do something as ridiculous as that!) We'll make the wild assumption for this example that the National Weather Service has 100% predictive accuracy.

So I pick Tuesday. I have a one-in-seven chance of "winning," based on the information I have. Of course, my wife has a different perspective, because she has more information than I do. She knows with 100% certainty whether I've picked correctly or not!

Now my wife says, "Okay, I'll tell you that the following days are going to be -20 F: Sunday, Monday, Thursday, Friday, Saturday."

She's narrowed my choices down to *two* possibilities. But it's important to remember that this was not a completely random choice. She didn't pick 5 out of 7 days to eliminate; she picked 5 out of *6*! She couldn't eliminate Tuesday, because that was the day I had picked, and if she eliminated it, I would be *forced *to change.

My reasoning now goes as follows: Based on my original information I was given, Tuesday had a 1/7 probability of being the best day for sledding. That means there was a 6/7 probability that one of the other days was the good sledding day. So there's a 6/7 probability that the good sledding day is: Sunday, Monday, Wednesday, Thursday, Friday or Saturday. As a probability equation, I could write:

P_{su }+ P_{m }+ P_{w }+ P_{th }+ P_{f }+ P_{sa }= 6/7

But now my wife has changed the problem. She's changed it by giving me more information: She's told me the values of all but one of those probabilities is zero!

That means: 0 + 0 + P_{w} + 0 + 0 + 0 = 6/7, which means that P_{w} = 6/7!

So do I switch my decision to Wednesday? You bet I do! The key to understanding this is that my wife's choice of information to give me is *not random*, and it therefore significantly alters the shape of the problem.

I hope that this is a helpful answer. The Monty Hall problem is one that repeatedly trips people up. I wonder if my blog post will increase the probability of people *not *getting tripped up by it!

PS - if you go to the Monty Hall game and change the game settings to 7 doors, 5 hints, that will be the same as my sledding example. Turn on the automation, and watch the percent. If you let it run long enough, you'll see that it eventually settles down to about 85.7%, which is the 6/7 probability we calculated.