1. Probability Basics
In the previous chapter, we learned about probability distributions & random variables. Now we will dig a little deeper into some fundamental concepts in probability. We'll then talk about the data generating process. Finally, we'll build simulations for more complex systems like an ecommerce website's checkout flow.
2. Sample Space
Let's define some basic con0cepts in probability. A sample space is a set of all possible outcomes. One example you've already encountered is the six-sided die where the sample space is basically the set of all possible outcomes from 1 to 6.
3. Probability
Given a sample space, probability is a number that helps us understand the likelihood of occurrence of an event within that sample space. It is a number between 0 and 1 - 0 telling us that the event will certainly not occur and 1 telling us that the event will most definitely occur. The probability of the sample space, or the probability of all events taken together is 1.
4. Probability
Take the example of a coin, you might not know the probability of heads if it is a biased coin, but you can say with certainty that the outcome will be either heads or tails. Thus, we can confidently say that the probability of heads plus the probability of tails equals 1.
5. Mutually Exclusive Events
Two events, A & B, are mutually exclusive if they cannot occur at the same time. This means that the probability of them occurring jointly is zero. Similarly, the probability of seeing either A or B is simply sum of the probability of A and the probability of B. For a six-sided die, the probability of rolling both a 6 and 3 on the same roll is zero. However, the probability of rolling either six or three is the probability of rolling 6 plus the probability of rolling 3 giving us a total probability of 1/3.
6. Probability
In general, the probability of two events A & B is the probability of A plus the probability of B minus the probability of A & B occurring together.
7. Using Simulation for Probability Estimation
Simulations are very helpful in arriving at estimates of probability. Estimating probability typically involves a simple five step process. 1) Construct the sample space for events which has all possible outcomes 2) Determine how to simulate one random outcome. 3) Determine rule for success - this could involve a combination of events. 4) Sample repeatedly and count successes. 5) Calculate frequency of success as an estimate of probability. That's it, you're done! In the next few exercises, you'll see an implementation of these steps.
8. Let's practice!
Now let's work on some examples.