Question: python, stuck on b a) equally-weighted integers a1. Write a function named dze that takes no arguments and returns an integer between 1 and 20

python, stuck on b a) equally-weighted integers a1. Write a function namedpython, stuck on b

a) equally-weighted integers a1. Write a function named dze that takes no arguments and returns an integer between 1 and 20 inclusive, randomly chosen with uniform probabilities. 198]: import random def d200): reture random.randint(1,20) 199]: Test code: Execute this immediotely after executing your solution cell above it. import statistics as stats from collections import Counter _trials [d20() for _x in range(int(1e4))] assert min(_trials) = 1 assert max(_trials) = 20 assert len(set(trials)) == 20 frequencies - Counter(_trials).most_common() assert frequencies[@][1] 10 frequencies[-1][1], "Unexpectedly small range of result frequencies encountered" del trials b) mean and variance b1. Using a loop, create and fill an array named many_d2e containing the results of 109 separate calls to your de function (ie, simulating one thousand rolls of a twenty-sided die). Then, calculate and show the mean and standard deviation of the values in this array, such that the result of executing your cell is a two-element tuple containing the numerical values of the mean and standard deviation in the form (mean, stdev) (as the value of the final line, not as the output of a print statement). 202]: many_d2e = [] File czythonaut-297-04831425275", line 1 many d20 =

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!