Question: Your task consists of creating a Python function called HW 2 p 1 _ Task 1 _ UCusername that works as follows To call your

Your task consists of creating a Python function called HW
2
p
1
_
Task
1
_
UCusername that works
as follows
To call your function, the user will type in the Python Shell, the name of the function
HW
2
p
1
_
Task
1
_
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
0
.
1
and the initial value of Y to
0
.
2
.
o Compute and store the successive values of X in a list using Equations
(
3
)
and
(
4
)
.
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
(
1
)
o Compute the width of each bin using Equation
(
2
) o Store the frequency distribution in Python as a list, i.e., the number of elements of X in
each bin. Complete this step using repetition structures (for or while loop) and Pythons
append built-in 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.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To address the question in a detailed manner lets break down the problem and provide a precise approach to what needs to be done within the function H... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!