Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Tutorial

Probability

Abstract

Here are a few interesting problems that highlight non-trivial aspects of probability.

Keywords:Probability.

Definitions

Probability aims to put a numerical value on how likely it is for different events to occur; it is a number between 0 and 1, where 0 means it will never occur and 1 means it will occur with certainty.

The probability of outcome AA occurring can therefore be denoted as

P(A)∈[0,1].P(A) \in [0,1].

If the event either happens or does not with certainty, then the probability that the event does not occur is given by

1−P(A).1 - P(A).

Marginal Probability

Consider now two events, AA and BB. The probability that event AA occurs independently of event BB, denoted P(A)P(A), is called the marginal probability of AA. The marginal probability of event BB is then P(B)P(B).

Joint Probability

The probability of both event AA and event BB occurring is called the joint probability, which is denoted

P(A∩B)∈[0,1].P(A \cap B) \in [0,1].

Conditional Probability

The probability of event AA occurring, given that event BB has already occurred, is called the conditional probability, and is denoted

P(A∣B)∈[0,1].P(A \vert B) \in [0,1].

Independent Events

Events AA and BB are independent if the occurrence of BB does not effect the probability of AA occurring.

In this case, the following relationship between the marginal, joint and conditional probabilites apply:

P(A∣B)=P(A)P(B∣A)=P(B)P(A∩B)=P(A)×P(B)\begin{align*} P(A \vert B) &= P(A) \\ P(B \vert A) &= P(B) \\ P(A \cap B) &= P(A) \times P(B) \end{align*}

Mutual Exclusivity

Events AA and BB are mutually exclusive if they cannot both occur at the same time.

In this case, the joint probability of the two events, that is the probability that they both occur, must be zero:

P(A∩B)=0.P(A \cap B)=0.

Probability Equations

Here are some relationships between the marginal, joint and conditional probabilities.

Chain Rule of Probability

The chain rule of probability relates the marginal, joint and conditional probabilites of events AA and BB as

P(A∩B)=P(A∣B)×P(B),P(A \cap B) = P(A \vert B) \times P(B),

meaning that the probability of both event AA and BB occurring is equal to the probability of event AA occurring given event BB has occurred, multiplied by the probability that event BB occurs.

The rule extends to more events too. Consider now a third event, CC. It then holds that

P(A∩B∩C)=P(A∣B,C)×P(B∩C),P(A \cap B \cap C) = P(A \vert B, C) \times P(B \cap C),

where P(A∩B∩C)P(A \cap B \cap C) is the joint probability of events A,BA,B and CC occurring; P(B∩C)P(B \cap C) is the joint probability of events BB and CC occurring, and P(A∣B,C)P(A \vert B,C) is the probability of event AA occurring given that event BB and CC have occurred.

Bayes’ theorem

Bayes’ theorem relates the marginal distribution P(A∣B)P(A \vert B) to P(B∣A)P(B \vert A) as

P(A∣B)=P(B∣A)P(A)P(B).P(A \vert B) = \frac{P(B \vert A)P(A)}{P(B)}.

It is commonly used to update the probability that an event AA will occur when some additional piece of evidence in the form of event BB has occurred.

Note, Bayes’ theorem arises from that fact the chain rule applies equally for both AA and BB, such that

P(A∩B)=P(A∣B)×P(B)P(A∩B)=P(B∣A)×P(A).\begin{align*} P(A \cap B) &= P(A \vert B) \times P(B) \\ P(A \cap B) &= P(B \vert A) \times P(A). \end{align*}

Equating these two gives Bayes’ rule.

Alternative Form of Bayes’ theorem

From the chain rule it holds that

P(A∣B)=P(A∩B)P(B).P(A \vert B) = \frac{P(A \cap B)}{P(B)}.

As noted above, it also follows that

P(A∩B)=P(B∣A)P(A).P(A \cap B) = P(B \vert A) P(A).

Now, denoting event AA not occurring by A‾\overline{A}, it holds that

P(B)=P(A∩B)+P(A‾∩B)=P(B∣A)P(A)+P(B∣A‾)P(A‾).\begin{align*} P(B) &= P(A \cap B) + P(\overline{A} \cap B) \\ &= P(B \vert A)P(A) + P(B \vert \overline{A})P(\overline{A}). \end{align*}

Putting this together, one gets that

P(A∣B)=P(B∣A)P(A)P(B∣A)P(A)+P(B∣A‾)P(A‾).P(A \vert B) = \frac{P(B \vert A) P(A)}{P(B \vert A)P(A) + P(B \vert \overline{A})P(\overline{A})}.

Probability Examples

The problems presented here were discussed during a Bristol Quantum Information Theory group meeting, they taught me something about probability so I thought I would share them here.

Problem 1

A couple has two children. One of the children is a Boy\mathrm{Boy}. What is the probability that their other child is a Girl\mathrm{Girl}?

Assume that the probability of a Boy\mathrm{Boy} or Girl\mathrm{Girl} being born is equal.

Solution

This problem can be solved by first considering the number of different possible combinations of two children. Assuming each child can only be a Boy\mathrm{Boy} or a Girl\mathrm{Girl} (such that we have only two possible outcomes), there are four possible ways to have two children:

(Boy,Boy), (Boy,Girl), (Girl,Boy), (Girl,Girl).(\mathrm{Boy}, \mathrm{Boy}), ~ (\mathrm{Boy}, \mathrm{Girl}), ~ (\mathrm{Girl}, \mathrm{Boy}), ~(\mathrm{Girl}, \mathrm{Girl}).

Now, we know that one of the children is a Boy\mathrm{Boy}, hence the option (Girl\mathrm{Girl}, Girl\mathrm{Girl}) cannot occur.

This leaves the following possible combinations that have at least one Boy\mathrm{Boy}:

(Boy,Boy), (Boy,Girl), (Girl,Boy).(\mathrm{Boy}, \mathrm{Boy}), ~ (\mathrm{Boy}, \mathrm{Girl}), ~ (\mathrm{Girl}, \mathrm{Boy}).

Of these three possible combinations, two contain a Girl\mathrm{Girl}.

The probability that the second child is a Girl\mathrm{Girl} given the first is a Boy\mathrm{Boy} is then

Number of possible outcomes compatible with the futureTotal of possible outcomes compatible with the prior=23,\begin{align*} \frac{\mathrm{Number~of~ possible~ outcomes ~compatible~ with ~the ~future}}{\mathrm{Total~ of~ possible ~outcomes~ compatible~ with ~the~ prior}} = \frac{2}{3}, \end{align*}

As of the three possible outcomes above that all contained at least one Boy\mathrm{Boy}, only two of the three also contained a Girl\mathrm{Girl}.

An easy way to understand and expand this problem is by rephrasing it as bit-strings. Firstly, let

Boy→0,  Girl→1,\mathrm{Boy} \rightarrow 0, ~ ~ \mathrm{Girl} \rightarrow 1,

such that the four possibilities become the set of two-bit-string,

B2={00,01,10,11}.\mathbb{B}_2 = \big\{ 00, 01, 10, 11 \big\}.

The condition that one child is a Boy\mathrm{Boy} states that we want to only consider the bit-strings with at least one 0,

B2P={00,01,10}⊆B2,\mathbb{B}_2^{P} = \big\{00, 01, 10 \big\} \subseteq \mathbb{B}_2,

where the superscript PP stands for prior.

The condition that the other child is a Girl\mathrm{Girl} then ask, of this reduced set of bit-strings B2P\mathbb{B}_2^{P}, how many of the bit-string have a 1:

B2F={01,10}⊆B2P,\mathbb{B}_2^{F} = \big\{ 01, 10 \big\} \subseteq \mathbb{B}_2^{P},

where the superscript PP stands for future.

The probability of this situation occurring is then given by

Prob=∣B2F∣∣B2P∣.\mathrm{Prob} = \frac{\vert \mathbb{B}_2^{F} \vert}{\vert \mathbb{B}_2^{P} \vert}.

Using this notation it is easy to see that a question of this form is really just a problem of counting bit-strings.

The problem can now be expanded: if one has ten children, nine of which are a Boys\mathrm{Boys}, what is the probability that the tenth is a Girl\mathrm{Girl}?

This question can then be rephrased as: of the ten-bit-strings with nine 0s, how many have one 1?

There are eleven ten-bit-strings with nine 0s. Of these eleven, ten have one 1. Hence, the probability of this occurring is given by

1011.\frac{10}{11}.

One can use the counting bit-string notion to now answer this problem for an arbitrary amount of Boy\mathrm{Boy}s or Girl\mathrm{Girl}s occurring. Moreover, any binary variable with equal probability of outcome could be treated this way.

Problem 2

A couple has two children. Their first child is a Boy\mathrm{Boy}. What is the probability that their second child is a Girl\mathrm{Girl}?

Assume that the probability of a Boy\mathrm{Boy} or Girl\mathrm{Girl} being born is equal.

Solution

One can again use the bit-string notion developed above to answer this problem.

Assuming that the first bit represents the first born child and the second bit represents the second, this question asks: of the two-bit-strings with a 0 as the first bit, how many have a 1 in the second bit?.

We now have

B2P={00,01},\mathbb{B}_2^{P} = \big\{00, 01 \big\},

and

B2F={01}⊆B2P,\mathbb{B}_2^{F} = \big\{ 01 \big\} \subseteq \mathbb{B}_2^{P},

From this, the probability can easily be found as

∣B2F∣∣B2P∣=∣{01}∣∣{00,00}∣=12.\frac{\vert \mathbb{B}_2^{F} \vert}{\vert \mathbb{B}_2^{P} \vert} = \frac{\vert \big\{ 01 \big\} \vert}{\vert \big\{ 00, 00 \big\} \vert} = \frac{1}{2}.

Interestingly, this probability remains the same for an number of children when the order of children is specified. If one lists the prior children in order i.e.,

First:Boy, Second:Girl, Third:Girl... nth:Boy,\mathbf{First}: \mathrm{Boy}, ~\mathbf{Second}: \mathrm{Girl}, ~\mathbf{Third}: \mathrm{Girl} ... ~\mathbf{n}th: \mathrm{Boy},

the some nn-bit-string ip∈{0,1}×ni_p \in \{0,1\}^{\times n} has been specified. When now considering the (n+1)(n+1)-bit-strings to model another child, there will always be only two (n+1)(n+1)-bit-strings that have ipi_p as its first nn bits: ip0i_p0 and ip1i_p1. Hence,

B(n+1)P={ip0,ip1},  B(n+1)F={ip1},\mathbb{B}^{P}_{(n+1)} = \big\{ i_p0, i_p1 \big\}, ~ ~ \mathbb{B}^{F}_{(n+1)} = \big\{ i_p1 \big\},

such that probability given this prior will always be 1/21/2.