Chapter 4
Probability Theory
Chances are that you will face at least a couple of probability problems in most quantitative interviews. Probability theory is the foundation of every aspect of quantitative finance. As a result, it has become a popular topic in quantitative interviews.
Although good intuition and logic can help you solve many of the probability problems, having a thorough understanding of basic probability theory will provide you with clear and concise solutions to most of the problems you are likely to encounter. Furthermore, probability theory is extremely valuable in explaining some of the seemingly-counterintuitive results. Armed with a little knowledge, you will find that many of the interview problems are no more than disguised textbook problems.
So we dedicate this chapter to reviewing basic probability theory that is not only broadly tested in interviews but also likely to be helpful for your future career.1 The knowledge is applied to real interview problems to demonstrate the power of probability theory. Nevertheless, the necessity of knowledge in no way downplays the role of intuition and logic. Quite the contrary, common sense and sound judgment are always crucial for analyzing and solving either interview or real-life problems. As you will see in the following sections, all the techniques we discussed in Chapter 2 still play a vital role in solving many of the probability problems.
Let’s have some fun playing the odds.
4.1 Basic Probability Definitions and Set Operations
First let’s begin with some basic definitions and notations used in probability. These definitions and notations may seem dry without examples—which we will present momentarily—yet they are crucial to our understanding of probability theory. In addition, it will lay a solid ground for us to systematically approach probability problems.
Outcome (): the outcome of an experiment or trial.
Sample space/Probability space (): the set of all possible outcomes of an experiment.
60: Probability of an outcome ().
Event: A set of outcomes and a subset of the sample space.
: Probability of an event , .
: Union is the set of outcomes in event or in event (or both).
or : Intersection (or ) is the set of outcomes in both and .
: The complement of , which is the event “not ”.
Mutually Exclusive: where is an empty set.
For any mutually exclusive events , .
Random variable: A function that maps each outcome () in the sample space () into the set of real numbers.
Let’s use the rolling of a six-sided dice to explain these definitions and notations. A roll of a dice has 6 possible outcomes (mapped to a random variable): 1, 2, 3, 4, 5, or 6. So the sample space is and the probability of each outcome is (assuming a fair dice). We can define an event representing the event that the outcome is an odd number , then the complement of is . Clearly . Let be the event that the outcome is larger than 3: . Then the union is and the intersection is . One popular random variable called indicator variable (a binary dummy variable) for event is defined as the following:
. Basically when occurs and if occurs. The expected value of is .
Now, time for some examples.
61Coin toss game
Two gamblers are playing a coin toss game. Gambler has fair coins; has fair coins. What is the probability that will have more heads than if both flip all their coins?2
Solution: We have yet to cover all the powerful tools probability theory offers. What do we have now? Outcomes, events, event probabilities, and surely our reasoning capabilities! The one extra coin makes different from . If we remove a coin from , and will become symmetric. Not surprisingly, the symmetry will give us a lot of nice properties. So let’s remove the last coin of and compare the number of heads in ’s first coins with ’s coins. There are three possible outcomes:
: ’s coins have more heads than ’s coins;
: ’s coins have equal number of heads as ’s coins;
: ’s coins have fewer heads than ’s coins.
By symmetry, the probability that has more heads is equal to the probability that has more heads. So we have . Let’s denote and . Since , we have . For event , will always have more heads than no matter what ’s coin’s side is; for event , will have no more heads than no matter what ’s coin’s side is. For event , ’s coin does make a difference. If it’s a head, which happens with probability 0.5, it will make have more heads than . So the coin increases the probability that has more heads than by and the total probability that has more heads is when has coins.
Card game
A casino offers a simple card game. There are 52 cards in a deck with 4 cards for each value . Each time the cards are thoroughly shuffled (so each card has equal probability of being selected). You pick up a card from the deck and the dealer picks another one without replacement. If you have a larger number, you win; if the numbers are equal or yours is smaller, the house wins—as in all other casinos, the house always has better odds of winning. What is your probability of winning?
62Solution: One answer to this problem is to consider all 13 different outcomes of your card. The card can have a value and each has of probability. With a value of 2, the probability of winning is ; with a value of 3, the probability of winning is (when the dealer picks a 2); …; with a value of , the probability of winning is (when the dealer picks a 2, 3, …, or ). So your probability of winning is
Although this is a straightforward solution and it elegantly uses the sum of an integer sequence, it is not the most efficient way to solve the problem. If you have got the core spirits of the coin tossing problem, you may approach the problem by considering three different outcomes:
: Your card has a number larger than the dealer’s;
: Your card has a number equal to the dealer’s;
: Your card has a number lower than the dealer’s.
Again by symmetry, . So we only need to figure out , the probability that two cards have equal value. Let’s say you have randomly selected a card. Among the remaining 51 cards, only 3 cards will have the same value as your card. So the probability that the two cards have equal value is . As a result, the probability that you win is .
Drunk passenger
A line of 100 airline passengers are waiting to board a plane. They each hold a ticket to one of the 100 seats on that flight. For convenience, let’s say that the -th passenger in line has a ticket for the seat number . Being drunk, the first person in line picks a random seat (equally likely for each seat). All of the other passengers are sober, and will go to their proper seats unless it is already occupied; In that case, they will randomly choose a free seat. You’re person number 100. What is the probability that you end up in your seat (i.e., seat #100)?3
Solution: Let’s consider seats #1 and #100. There are two possible outcomes:
63: Seat #1 is taken before #100;
: Seat #100 is taken before #1.
If any passenger takes seat #100 before #1 is taken, surely you will not end up in you own seat. But if any passenger takes #1 before #100 is taken, you will definitely end up in you own seat. By symmetry, either outcome has a probability of 0.5. So the probability that you end up in your seat is 50%.
In case this over-simplified version of reasoning is not clear to you, consider the following detailed explanation: If the drunk passenger takes #1 by chance, then it’s clear all the rest of the passengers will have the correct seats. If he takes #100, then you will not get your seat. The probabilities that he takes #1 or #100 are equal. Otherwise assume that he takes the -th seat, where is a number between 2 and 99. Everyone between 2 and will get his own seat. That means the -th passenger essentially becomes the new “drunk” guy with designated seat #1. If he chooses #1, all the rest of the passengers will have the correct seats. If he takes #100, then you will not get your seat. (The probabilities that he takes #1 or #100 are again equal.) Otherwise he will just make another passenger down the line the new “drunk” guy with designated seat #1 and each new “drunk” guy has equal probability of taking #1 or #100. Since at all jump points there’s an equal probability for the “drunk” guy to choose seat #1 or 100, by symmetry, the probability that you, as the passenger, will seat in #100 is 0.5.
N points on a circle
Given points drawn randomly on the circumference of a circle, what is the probability that they are all within a semicircle?4
Solution: Let’s start at one point and clockwise label the points as . The probability that all the remaining points from 2 to are in the clockwise semicircle starting at point 1 (That is, if point 1 is at 12:00, points 2 to are all between 12:00 and 6:00) is . Similarly the probability that a clockwise semicircle starting at any point , where contains all the other points is also .
Claim: the events that all the other points are in the clockwise semicircle starting at point , are mutually exclusive. In other words, if we, starting at point and proceeding clockwise along the circle, sequentially encounters points in half a circle, then starting at any other point , we cannot encounter all 64other points within a clockwise semicircle. Figure 4.1 clearly demonstrates this conclusion. If starting at point and proceeding clockwise along the circle, we sequentially encounter points within half a circle, the clockwise arc between and must be no less than half a circle. If we start at any other point, in order to reach all other points clockwise, the clockwise arc between and are always included. So we cannot reach all points within a clockwise semicircle starting from any other points. Hence, all these events are mutually exclusive and we have
The same argument can be extended to any arcs that have a length less than half a circle. If the ratio of the arc length to the circumference of the circle is (), then the probability of all points fitting into the arc is .