条件概率

Illustrated · 1 min

What is Conditional Probability?

Conditional probability is the chance that one thing happens (AA), assuming that another thing (BB) also happens. That's usually written as P(A∣B)P(A|B), and pronounced as "the probability of AA given BB."

Calculating conditional probabilities is pretty much the same as regular probabilities; you just need to redefine "all possible events" as "events where BB has occurred." In that space, you're looking for events where AA has also happened:

P(A∣B)=P(A∩B)P(B)P(A|B) = \dfrac{P(A \cap B)}{P(B)}

It helps me to think of this spatially:

Two circles, one labelled A and one labelled B.  They are overlapping, and the overlapped area is shaded with blue

Say you throw a dart at that picture (and you have a 100100% chance of hitting the picture somewhere!). The chance that you'll hit circle BB is P(B)P(B), the chance that you'll hit circle AA is P(A)P(A), and the chance that you'll hit the purple area is P(A∩B)P(A \cap B).

For conditional probability, we're looking for the probability that you hit the purple area, given that you also hit circle BB. This seems redundant, but that "given" provides a lot more information and a lot more accuracy in your calculation:

If P(B)P(B) is 4040% and P(A∩B)P(A \cap B) is 55%, then P(A∣B)P(A|B) is 5%40%\dfrac {5\%}{40\%} or 12.512.5%. The probability of hitting that purple area more than doubled once you could take hitting circle BB as given!

Interactive · 5 questions

What is conditional probability?

When we talk about conditional probability, we are talking about the probability of event B occurring given that event A has already occurred.

The fancy math way to write this is:

The way to read the expression above is "the probability of B given A."

Before trying to calculate the conditional probability of 2 events, you first need to determine if the events are independent or dependent.

If 2 events (A and B) are independent, they have NO effect on each other. This means that the outcome of event A has absolutely NOTHING to do with event B. Here's an example of 2 independent events:

In this example, one event (rolling a 4) has nothing to do with the other (flipping a coin and getting tails).

In other words, the events are independent. This means that the event of rolling a 4 will remain completely unchanged regardless of whether or not we land on tails.

In this case, where our two events are independent, what is the P(rolling a 4 |getting tails)?

Choose one answer

Read · 6 min

The concept of conditional probability is based on the interpretation of a concept of knowledge-based probability. As was mentioned before, in the absence of any information about the outcomes of the experiment (no knowledge, no statistics from past results of the same experiment), we cannot give any preference to one outcome over the other and, if faced with the necessity to assign a probability measure to different elementary events that are the results of this experiment, have no other choice but to assign equal probability to each elementary event. For a random experiment with NN distinct outcomes this amounts to a probability of 1N\frac{1}{N} for each elementary event.

Using the more formal definition of probability introduced in one of the prior lectures (see UNIZOR.COM - Probability), we deal with a finite set of NN elements that represent our sample space with a measure of 1N\frac{1}{N} allocated to each element reflecting the probability of each elementary event and, since our measure is additive, a measure of MN\frac{M}{N} is assigned to any subset of our set that contains MM elements and represents any random event. Logical operations on subsets - union, intersection and complement - represent logical OR, AND and NOT performed on description of different events

As our information about the random experiment grows (because of accumulated statistics or science-based research), we can redistribute the measures of probability differently among elementary events. From the set theory model of probability, we can redistribute a measure assigned to each element of our set that represents the sample space, consequently changing the measure of subsets that contain elements with newly assigned measure. What remains constant is the sum of all measures of all the elements, it always should be equal to 11.

The set theory model can be effectively demonstrated graphically with, say, a large area (like a rectangle) of the measure of 11 (in some units), representing a sample space, divided into NN small areas, representing elementary events, each having a measure of 1N\frac{1}{N}. Any group of small areas represents an event with the probability equal to its combined measure - a sum of measures of all small areas inside it. If we deal with an unequal distribution of probabilities, all we have to do in this model is to change the measure associated with each small area to reflect the difference, but to maintain the sum of all measures to be equal to 11.

Let's assume now that we have devised a random experiment, came up with NN elementary events as its outcomes and assigned an initial probability of 1N\frac{1}{N} to each. Assume further that later on we obtained a precise knowledge that certain elementary events that we included into our sample space never actually occur. Or, equivalently, we know that some elementary events (a proper subset of all elementary events) always occur. This knowledge could've been obtained as a result of some scientific research or based on our experience. Would it be fair to retain the distribution of the total measure of probability evenly among all elementary events, including those that never occur? The answer is NO. We have to re-distribute the probability among remaining elementary events and assign a probability of 00 to those elementary events that cannot occur.

Consider an example of rolling a dice that, because of some physical phenomenon, always ends up with an even number on top, and you know this property of the dice. Under this condition it would be wise to assign the probability of 13\frac{1}{3} to 22, 44 and 66, while numbers 11, 33 and 55 should be assigned the probability of 00.

Another example. You and a few others play Blackjack on a single deck of cards, and a dealer deals cards to players one-by-one. What is the probability of having a King as your first card? If you completely disregard what's going on at the table, you might assign a probability of 452=113\frac{4}{52}=\frac{1}{13} of this event because there are 44 Kings in a deck of 5252 cards. But what if you've noticed that a person that receives the card before you got a King? Under this condition you have to reduce your probability to 351\frac{3}{51} because there are only 33 Kings left out of 5151 cards. As you see, the knowledge of some special condition changes the distribution of probabilities.

Here is another example of changes in the distribution of probabilities under some conditions. We will use a graphical representation of the sample space as an area with a measure of 11 divided into smaller areas and an illustrative example of rolling two dice. In this case we start with a sample space as a 66x66 square divided into 3636 smaller squares. The row represents the number on the first dice, the column - the number on the second dice. The measure of each small square equals to 136\frac{1}{36}. Our task is to evaluate the probability of the second dice to show an even number on the top. There are three different values for the second dice, 22, 44 and 66, and six different values for the first dice. Graphically, all small squares in the column #2, column #4 and column #6 represent the event we are interested in. That makes the total number of pairs with the second dice showing an even number equal to 6⋅3=186\cdot 3=18. So, the probability of this event equals to 1836=12\frac{18}{36}=\frac{1}{2}. We just calculated a fraction of the number of elementary events that satisfy our requirement relative to the number of all possible elementary events.

Assume now that we have a special pair of dice that always falls in such a way that a sum of two numbers they show equals to 66. That means that the measure of probability is not allocated evenly among all our 36 small squares, but is concentrated only among squares that represent pairs {1,5}\{1,5\}, {2,4}\{2,4\}, {3,3}\{3,3\}, {4,2}\{4,2\} and {5,1}\{5,1\} - only five elementary events with a probability of each equaled to 15\frac{1}{5}, while all other squares have a measure of 00. Now we have only two elementary events out of five that have a second number divisible by 22.

To properly calculate the probability of having an even second number, we make sure to account only theoretically possible outcomes. The total number of elementary events is reduced to only those five pairs making a sum of 66, as specified above. The elementary events that satisfy our requirement and are possible are those on intersection of all five possible and all 1818 required elementary events, there are only 22 of them - {2,4}\{2,4\} and {4,2}\{4,2\}. That makes a probability to have the even second number, under condition that a sum of both numbers is 66, to be equal to 25\frac{2}{5}.

The fact that our pair of dice fall only in a way that their sum equals to 66 is a condition of our experiment. This condition changes the distribution of probabilities among elementary events, which, in turn, changes all probabilities of random events. These new probabilities of all events (including elementary) are called conditional probabilities.

Obviously, when talking about conditional probabilities, we must specify exactly the condition and understand how this condition affects the probabilities of elementary events. Combined with the knowledge of how any random event is constructed from elementary events, it allows us to calculate the conditional probability of this event.

Read · 2 min

The conditional probability, usually denoted P(A∣B)P(A|B) (where AA and BB are distinct events) is probability's way of dealing with situations where we have knowledge about a situation prior to guessing what will happen.

Everybody uses conditional probability to figure out things. For example, if you are wondering whether you remembered to charge your cell phone last night, you might not really know the probability that you charged it (P(I Charged My Cellphone)P(\text{I Charged My Cellphone}).) But when you see that the charger is not plugged into the wall, you're pretty sure you know that you didn't - P(I Charged My Cellphone∣Charger is Unplugged)=0P(\text{I Charged My Cellphone}|\text{Charger is Unplugged}) =0 .

That's the essence of conditional probability, the idea that knowing the result of another event (BB) will change your guess about the probability of (AA).

If knowing B doesn't change your guess (P(A∣B)=P(A)P(A|B) = P(A)), then the two events are independent - they're unrelated to one another. If you're wondering whether your phone is charged, you don't care that a small pebble is sitting out on the road near your house - these things are unrelated, and thus, independent of one another.*

Things like the rolls of two separate dice or whether a part on an assembly line is defective while another isn't are examples of pairs of independent events, while the value of two cards drawn from the same deck, the colors of two marbles drawn from the same bag, and the weather on two consecutive days are examples of pairs of dependent (the opposite of independent) events.

There are some cosmic level philosophical arguments about causality that would say that these things are related, that in fact all events affect one another and because of this, if one knows the entire state of the universe, one can know everything that has or will ever happen. For the moment, we're going to assume that we don't know enough to make grand claims about existence based on small pieces of rock.

Video

(Video) How to Calculate Conditional Probability

by Statistics Fun

Statistics Fun has a good video explaining how to calculate conditional probability.

Interactive · 2 questions

In a standard deck of cards there are 52 cards, 26 red cards and 26 black cards. Let's say we choose the four of diamonds. What are the chances of that happening? Well since there is one four of diamonds in a deck of 52 cards, the probability of choosing one is 152 or 0.02%.\frac{1}{52}\text{ or }0.02\%. Choosing this card is one independent event, when taking conditional probability into consideration we begin working with two dependent events. Now, what does it mean to be independent or dependent?

Two events are independent of each other if neither of the events impact the other. For example, if I chose a King of spades from a deck of cards and returned it to the deck then chose a different card, these events would be independent. By replacing the first card, the probability of choosing any card remains at 0.02% because I am still choosing 1 card out of 52. \\ Two events are dependent if one event directly impacts the other event. If I had not returned the King of spades to the deck then if I chose a four of diamonds the chances of choosing that card would now be 151\frac{1}{51}.

When we have two dependent events we can find something called conditional probability. Conditional probability is the probability of an event B occurring given event A did occur. Conditional probability is denoted: P(B|A) which is read as "the probability of B given A." When finding the conditional probability we use the following formula: P(A∩B)P(A)\frac{P(A\cap B)}{P(A)} \\ Below is a two way table of the results of a survey on the favorite color of 100 people.

If I were to randomly ask one of the 100 people surveyed what they said their favorite color is, what is the probability that that person is a female?

Choose one answer

Type a concept, like “slope” or “photosynthesis”.

↑ ↓ to choose · Enter to openSearch explanations and problems