Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- Calculate variance using the formula: n×p×(1−p), where
- n = no. of events
- p = probability of the event occurring
- (1-p) = probability that it does not happen
- '''
- # Find variance for a certain basketball player that has an 85% chance of making a given free throw, for 20 shots.
- variance_baskets = 20 * 0.85 * 0.15
- print(variance_baskets)
- # Find variance for student that has a 98% chance of arriving on time to class, in throughout the 180 school days in a school year.
- variance_late = 180 * 0.02 * 0.98
- print(variance_late)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement