Bernoulli Variable
In this lesson, we will learn about finding the probability of a Bernoulli variable.
We'll cover the following...
In the example below, we will flip a coin five times in a row and record how many times we obtain tails (varying from 0-5). We will be performing the experiment 1000 times.
We will then compute the cumulative probability, print the values to the screen and make a plot of the cumulative probability function using a bar graph.
Execute the code several times and see that the graph changes a bit every time.
Probability of a Bernoulli variable
In the example above, we computed the probability of a certain number of heads in five flips experimentally. But we can, of course, compute the value exactly by using a few simple formulas.
Consider the random variable , which is the outcome of an experiment with two possible values and . Let be the probability of success,
...