Using Python:
A. Define the function get_data. The function shall read the given file (i.e. data.json) and return a dictionary object containing probabilities and coefficients for generating a number of shapes. B. Edit the previously defined function, random_select. The function must now take two arguments, representing the probabilities and coefficients. As before the function must select and return a list of coefficients on the given probabilities. C. Edit the previously defined function, draw. The function must now take 3 arguments representing, probabilities, coefficients and the number of iterations. The new arguments for probabilities and coefficients shall be passed to invoke the modified random_select function. The remaining implementation of the function remains as before. D. Edit the previously defined program under 'main'. In addition to taking user input for the number of iterations, the program shall take input to select 1 of 3 drawing options. Given option 1- the program shall draw with probabilities and coefficients- 'c0' and 'p0' from the data obtained by invoking the get_data function. Similarly, options 2 and 3 will use 'c1', 'p1' and 'c2', 'p2' respectively. A screen shot of an example program run for options 1, 2 and 3 with n = 1000000 in each case is given below :