Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Bernoulli Distribution | Discrete Distributions
Probability Theory
course content

Kursinnehåll

Probability Theory

Probability Theory

1. Learn Basic Rules
2. Probabilities of Several Events
3. Conducting Fascinating Experiments
4. Discrete Distributions
5. Normal Distribution

book
Bernoulli Distribution

Let's move to Bernoulli distribution!

To work with this distribution, we should import the bernoulli object from scipy.stats, and then we can apply numerous functions to this distribution like pmf, sf, and cdf that were already learned.

Key characteristics:

  1. Only 1 trial.

  2. Only 2 outcomes.

Example:

Tossing one coin because it has only two outcomes, head or tail.

Here is an example of an unfair coin that results in success with the probability of p = 0.7.

bernoulli

Explanation:

The probability for the first outcome is always p; therefore, the probability for the second outcome is always 1-p. If the chance of receiving a head is 70%, the chance of getting a tail can not be any number except 30%.

Mean and standard deviation:

It is vitally important to understand the necessity of knowing the mean and standard deviation. With the mean, we can describe distribution in general, but with the standard deviation, we can measure the spread of distribution (or how far the random variable is located from the mean). I put the numbers from our example to make everything clear.

Formulas:

Mean and standard deviation can also be calculated with Python, using this syntax bernoulli.mean(p), bernoulli.std(p), where p is the probability of success.

Do you remember .pmf() function? In general, this function helps us to find the probability that the event will happen (if we know the probability of success). Try to use it to define the probability of an event with Python; the syntax is bernoulli.pmf(k, p), where k is the event (0 or 1 in our case), and p is the probability of success.

Uppgift

Swipe to start coding

Here, you are going to work with the same distribution that you can see in the theory block to clarify everything. Your task here is to follow the algorithm:

  1. Import library to work with bernoulli object.
  2. Calculate the probability to receive the event 1 with the probability of success 0.7.
  3. Calculate the distribution mean with the probability of success 0.7.
  4. Calculate the distribution standard deviation, with the probability of success 0.7.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 4. Kapitel 3
toggle bottom row

book
Bernoulli Distribution

Let's move to Bernoulli distribution!

To work with this distribution, we should import the bernoulli object from scipy.stats, and then we can apply numerous functions to this distribution like pmf, sf, and cdf that were already learned.

Key characteristics:

  1. Only 1 trial.

  2. Only 2 outcomes.

Example:

Tossing one coin because it has only two outcomes, head or tail.

Here is an example of an unfair coin that results in success with the probability of p = 0.7.

bernoulli

Explanation:

The probability for the first outcome is always p; therefore, the probability for the second outcome is always 1-p. If the chance of receiving a head is 70%, the chance of getting a tail can not be any number except 30%.

Mean and standard deviation:

It is vitally important to understand the necessity of knowing the mean and standard deviation. With the mean, we can describe distribution in general, but with the standard deviation, we can measure the spread of distribution (or how far the random variable is located from the mean). I put the numbers from our example to make everything clear.

Formulas:

Mean and standard deviation can also be calculated with Python, using this syntax bernoulli.mean(p), bernoulli.std(p), where p is the probability of success.

Do you remember .pmf() function? In general, this function helps us to find the probability that the event will happen (if we know the probability of success). Try to use it to define the probability of an event with Python; the syntax is bernoulli.pmf(k, p), where k is the event (0 or 1 in our case), and p is the probability of success.

Uppgift

Swipe to start coding

Here, you are going to work with the same distribution that you can see in the theory block to clarify everything. Your task here is to follow the algorithm:

  1. Import library to work with bernoulli object.
  2. Calculate the probability to receive the event 1 with the probability of success 0.7.
  3. Calculate the distribution mean with the probability of success 0.7.
  4. Calculate the distribution standard deviation, with the probability of success 0.7.

Lösning

Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 4. Kapitel 3
Switch to desktopByt till skrivbordet för praktisk övningFortsätt där du är med ett av alternativen nedan
Vi beklagar att något gick fel. Vad hände?
some-alt