Free throws example
Suppose you know that a basketball player has a 0.3 probability of scoring a free throw. What is the probability of them missing with the first throw and scoring with the second?
Latihan ini adalah bagian dari kursus
Foundations of Probability in Python
Petunjuk latihan
- Import
geomfromscipy.stats. - Use the probability mass function (
pmf()) withp=0.3and specify the appropriatekvalue.
Latihan interaktif praktis
Cobalah latihan ini dengan menyelesaikan kode contoh berikut.
# Import geom from scipy.stats
from ____
# Probability of missing first and scoring on second throw
probability = ____.____(k=____, p=____)
# Print the result
print(probability)