Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Computer Science pyhton Exercise 6B (1) Write a function laggedfib(j,k,m, initlist,n) to compute a sequence of n pseudo- random numbers using the lagged Fibonacci method,

Computer Science

pyhton

image text in transcribed
Exercise 6B (1) Write a function laggedfib(j,k,m, initlist,n) to compute a sequence of n pseudo- random numbers using the lagged Fibonacci method, where initlist is a list of k initial values, and j , k,m are as in the notes. (2) Using your function with (j,k, m) = (7, 10,232) and initlist = [1,1,1,. ..,1], generate 2000 pseudorandom numbers z, in the range [0, 232). Plot r, against r , as a scatter plot. (The plot should appear when the programme is run.) (3) Generate 2000 pseudorandom numbers z, in the same range using the randint function from the random module. Plot z, against s; , as a scatter plot. (Again the plot should appear automatically, in a separate window to the previous plot.) (4) Consider a list sequence of n numbers , E [a, b]. Write a function arithmeticmean (sequence, hi, lo) to compute the arithmetic mean of such a list. Your function should take three arguments:sequence, hi (= b) and lo (= a). (The function could of course find the maximum and minimum values in sequence, by using the func- tions max () and min() - why is this not as accurate as providing a and b?). The function should return three things; the arithmetic mean of the elements of sequence, the quantity (a + 6)/2, and the ratio of the first of these to the second (which ideally should be close to 1). (5) Use your function from (4) to compare the arithmetic means of a, and s, above, writing your answer as a comment

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

Sketch the graph of the inequality. 1. y Answered: 1 week ago

Answered: 1 week ago

Question

what are the provisions in the absence of Partnership Deed?

Answered: 1 week ago

Question

1. What is called precipitation?

Answered: 1 week ago

Question

1.what is dew ?

Answered: 1 week ago

Question

1.The difference between climate and weather?

Answered: 1 week ago

Question

1. What is Fog ?

Answered: 1 week ago