Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Сhallenge 2 | Normal Distribution
Probability Theory

book
Сhallenge 2

Here we are going to work with the distribution from the previous chapter!

Oppgave

Swipe to start coding

Please calculate the probability that your cat's weight will be unusual!

  1. Import norm object.

  2. Calculate the first one prob_1 that your cat's weight will be less than 2 kg with such parameters:

    • Mean equals 4.2
    • Standard deviation equals 1.
  3. Calculate the second one prob_2 that the weight of your cat will be more than 11 kg with the parameters:

    • Mean equals 4.2
    • Standard deviation equals 1.
  4. Calculate the probability that the weight of your cat will be more than 11 or less than 2 kg.

Compare it to the graph and the values of confidence intervals.

Løsning

# Import norm object
from scipy.stats import norm

# Calculate the first probability
prob_1 = norm.cdf(x = 2, loc = 4.2, scale = 1)
# Calculate the second probability
prob_2 = norm.sf(x = 11, loc = 4.2, scale = 1)
# Calculate the whole probability
prob = prob_1 + prob_2

print("The probability is", prob)

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 5. Kapittel 3
single

single

# Import norm object
from ___

# Calculate the first probability
prob_1 = ___(x = 2, loc = ___, scale = ___)
# Calculate the second probability
prob_2 = norm.___(x = ___, loc = ___, scale = ___)
# Calculate the whole probability
prob = ___

print("The probability is", prob)

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

some-alt