We will see a little bit about:
- Probability
- Programming
- Simulations
08/09/2021
We will see a little bit about:
How much money does one have to spend on potato chips so as to complete the entire collection?
If it’s not possible find an exact solution for the previous question, how close can we get to an answer? Do we have some kind of threshold?
Those questions are not deterministic, but rather probabilistic.
What is a probability?
Event
Random Variable
Distribution of a random variable
Expectancy
Let X be the event “Result of rolling a non-biased dice”.
What is the probability of \(X=1\)?
\[ P(X=1) = P(Side = 1) = \frac{1}{6} \]
Let X be the event “Result of rolling a non-biased dice”.
What is the probability of \(X<3\)?
\[ P(X<3) = P(X=1) + P(X=2) = \frac{2}{6} = \frac{1}{3} \]
X: “Result of rolling a dice”
| x | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| p(x) | 1/6 | 1/6 | 1/6 | 1/6 | 1/6 | 1/6 |
weighted average(or mean), where the weights are the possible outcomes of the random variable.
For a dice roll the weights are 1, 2, … 6.
So, \(E[X] = 1\times\frac{1}{6} + 2\times\frac{1}{6} + ... + 6 \times\frac{1}{6}\)
“number of bags of chips we need to buy to complete the pogs collection, given that there are 20 unique pogs”.
It’s not easy at all to find a distribution for this random variable.
So what can we do now?
Repeat the experiment multiple times with a computer program.
For each iteration, write the outcome(number of bags purchased) to a list.
Calculate the mean of the written outcomes.
Obs: Statistical inference guarantees that the mean we calculated is close enough to the real mean(expected value).
With the random variable expected value, we can find an upper bound for the occurrence of an event.
We will use a result from probability theory known as Markov’s inequality.
\[P(X \geq k) \leq \frac{E[X]}{k}, k > 0\]
Given that X: “number of bags of chips we need to buy to complete the pogs collection, given that there are 20 unique pogs”
And given that E[X] = 72
In the worst case scenario, what is the probability that we buy 100 or more bags of chips to collect all pogs?
\[P(X \geq 100) \leq \frac{72}{100} = 0.72\]