Question: Write a python script to do the following: 1. Generate 5 arrays (of length 1000) of random integers in [1, 5] with uniform distribution. 2.
Write a python script to do the following: 1. Generate 5 arrays (of length 1000) of random integers in [1, 5] with uniform distribution. 2. For each array X, compute the array S, where S[i], i = 0, 1, . . . , 999, is the average of the first i + 1 elements of X. 3. Plot all the 5 arrays S computed above in the same figure, and save the figure (see instructions below). 4. You may only use the following packages: numpy, matplotlib, os, sys, getopt 5. Note: Please make sure that your code does not crash. If it does, it will not be graded.

Write a python script to do the following: 1. Generate 5 arrays (of length 1000) of random integers in [1,5] with uniform distribution 2. For each array X, compute the array S, where S[i], i = 0.1, . . . ,999, is the average of the first i +1 elements of X 3. Plot all the 5 arrays S computed above in the same figure, and save the figure (see instructions below). You ay onl ue thp meth,t 5. Note: Please make sure that your code does not crash. If it does, it will not be graded
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
