Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(20 pt) Create a file called generator.py. In this file, create a class called LCG whose instance can generate random numbers by Linear Conguen- tial

image text in transcribed

(20 pt) Create a file called generator.py. In this file, create a class called LCG whose instance can generate random numbers by Linear Conguen- tial Generator algorithm. It should have these data attributes: self.seed, self.multiplier, self.increment, self.moduus which are assigned in initial- izer (init-0). The parameters should be passed by argument from out side of the class. This class's instance should also at least have function attributes allow me: 1) get the seed; 2) set the seed; 3) initialize the gener ator (start from the seed); 4) give me the next random number 5) give me a sequence (list) of random number, the length should be passed by argu- ment. (20 pt) Create a file called generator.py. In this file, create a class called LCG whose instance can generate random numbers by Linear Conguen- tial Generator algorithm. It should have these data attributes: self.seed, self.multiplier, self.increment, self.moduus which are assigned in initial- izer (init-0). The parameters should be passed by argument from out side of the class. This class's instance should also at least have function attributes allow me: 1) get the seed; 2) set the seed; 3) initialize the gener ator (start from the seed); 4) give me the next random number 5) give me a sequence (list) of random number, the length should be passed by argu- ment

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

Step: 3

blur-text-image

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

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

What do you mean by Dividend ?

Answered: 1 week ago

Question

What is database?

Answered: 1 week ago

Question

What are Mergers ?

Answered: 1 week ago