Question: help me explain things i might've learned from this lab one thing i learned was If we don't specify it before the codes we can
help me explain things i might've learned from this lab one thing i learned was If we don't specify it before the codes we can specify it before the functions like we did st.norm.sf() for the normal distribution lab.
# Load the necessary module from scipy . stats import binom # Get user-defined number of successes k = int(input()) n= 100 p= 0.5 # Set the number of trials and the probability of success in each trial P = binom. pmf(k, n, p) # Calculate the probability of k successes given the defined n and p print (f' {p: . 6E}' ) mean = binom. mean(n, p) # Return the mean of the distribution print(f' {mean: . 2f}' ) var = binom. var(n, p) # Return the variance of the distribution print (f' {var: . 2f}' )Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
