Challenge
Tarefa
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:
- Import
binom
object. - Calculate the probability that more than
200
people answeredyes
to your question among1000
that were interviewed. The probability of receiving a positive answer is0.3
or30%
.
Solução
99
1
2
3
4
5
6
7
8
9
10
# 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)
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 4. Capítulo 5
single
99
1
2
3
4
5
6
7
8
9
10
# Import binom object
___
import numpy as np
np.random.seed(2000)
# Calculate the probability
prob = ___(___)
# Print the probability
print("The probability is", prob)
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo