Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Probability Mass Function (PMF) 2/2 | Probability Functions
Probability Theory Update

Scorri per mostrare il menu

book
Probability Mass Function (PMF) 2/2

Probability mass function over a range:

In some cases, we want to know the probability that discrete random variables are equal to numbers over a range.

Example:

Calculate the probability that we will have success with the fair coin at 4 or less times (0, 1, 2, 3 or 4) (the chance of getting head or tail is 50%) if we have 15 attempts. We assume that success means getting a head.

Python realization:

12345678910111213141516171819202122232425262728293031
# Import required library import scipy.stats as stats # The probability of getting 0 successes prob_0 = stats.binom.pmf(0, n = 15, p = 0.5) # The probability of getting 1 success prob_1 = stats.binom.pmf(1, n = 15, p = 0.5) # The probability of getting 2 successes prob_2 = stats.binom.pmf(2, n = 15, p = 0.5) # The probability of getting 3 successes prob_3 = stats.binom.pmf(3, n = 15, p = 0.5) # The probability of getting 4 successes prob_4 = stats.binom.pmf(4, n = 15, p = 0.5) # The resulting probability probability = prob_0 + prob_1 + prob_2 + prob_3 + prob_4 print("The probability is", probability * 100, "%")
copy

Explanation

We've found the probability that a discrete random variable will equal exactly 0, 1, 2, 3, or 4 using the probability mass function. Then, we summed up all probabilities using the addition rule because each of the found outcomes was permissible for us.

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 4. Capitolo 3
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

close

Awesome!

Completion rate improved to 3.7

book
Probability Mass Function (PMF) 2/2

Probability mass function over a range:

In some cases, we want to know the probability that discrete random variables are equal to numbers over a range.

Example:

Calculate the probability that we will have success with the fair coin at 4 or less times (0, 1, 2, 3 or 4) (the chance of getting head or tail is 50%) if we have 15 attempts. We assume that success means getting a head.

Python realization:

12345678910111213141516171819202122232425262728293031
# Import required library import scipy.stats as stats # The probability of getting 0 successes prob_0 = stats.binom.pmf(0, n = 15, p = 0.5) # The probability of getting 1 success prob_1 = stats.binom.pmf(1, n = 15, p = 0.5) # The probability of getting 2 successes prob_2 = stats.binom.pmf(2, n = 15, p = 0.5) # The probability of getting 3 successes prob_3 = stats.binom.pmf(3, n = 15, p = 0.5) # The probability of getting 4 successes prob_4 = stats.binom.pmf(4, n = 15, p = 0.5) # The resulting probability probability = prob_0 + prob_1 + prob_2 + prob_3 + prob_4 print("The probability is", probability * 100, "%")
copy

Explanation

We've found the probability that a discrete random variable will equal exactly 0, 1, 2, 3, or 4 using the probability mass function. Then, we summed up all probabilities using the addition rule because each of the found outcomes was permissible for us.

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

close

Awesome!

Completion rate improved to 3.7

Scorri per mostrare il menu

some-alt