Your task consists of creating a Python function called HW
p
Task
UCusername that works
as follows
To call your function, the user will type in the Python Shell, the name of the function
HW
p
Task
UCusername
and the arguments variables a
b
and n
sample size
UCusername is what you use to login to CANVAS.
Your function will then
o Set the initial value of X to
and the initial value of Y to
o Compute and store the successive values of X in a list using Equations
and
This
should be done using a repetition structure
for or while loop
and Python
s append
built
in function for adding on to lists.
o Compute the number of bins based on the sample size and using the Equation
o Compute the width of each bin using Equation
o Store the frequency distribution in Python as a list, ie the number of elements of X in
each bin. Complete this step using repetition structures for or while loop and Pythons
append builtin function. The goal is to generate a repetition structure that will adjust
based on the number of bins, see the third hint below for more guidance.
o Print the list with the frequency distribution to Python Shell.