Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge | Discrete Distributions
Probability Theory

book
Challenge

Tehtävä

Swipe to start coding

Let's assume that we want to conduct an experiment to determine the probability that a person has more than 3 cats, let's consider that we have asked 1000 people (they can answer yes or no). Follow the algorithm:

  1. Import binom object.
  2. Calculate the probability that more than 200 people answered yes to your question among 1000 that were interviewed. The probability of receiving a positive answer is 0.3 or 30%.

Ratkaisu

# Import binom object
from scipy.stats import binom
import numpy as np
np.random.seed(2000)

# Calculate the probability
prob = binom.sf(k = 200, n = 1000, p = 0.3)

# Print the probability
print("The probability is", prob)

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 4. Luku 5
# Import binom object
___
import numpy as np
np.random.seed(2000)

# Calculate the probability
prob = ___(___)

# Print the probability
print("The probability is", prob)
toggle bottom row
some-alt