Five pseudo random number generators

Assignment Help Basic Computer Science
Reference no: EM13935316

def __init__(self, seed=0): self.state = seed
def setSeed(self, seed): self.state = seed
def rand(self): return 1.0*self.next()/(1<<32)
def current(self): return self.state
def next(self):
self.state = (69069 * self.state + 12345) & 0xFFFFFFFF
return self.state

class rngB():
def __init__(self, seed=1): self.state = seed
def setSeed(self, seed): self.state = seed
def rand(self): return 1.0*self.next()/(1<<31)
def current(self): return self.state
def next(self):
self.state = (65539 * self.state + 4294967296) & 0x7FFFFFFF
return self.state

class rngC():
def __init__(self, seed=1): self.state = seed
def setSeed(self, seed): self.state = seed
def rand(self): return 1.0*self.next()/(1<<8)
def current(self): return self.state
def next(self):
self.state = ((((16339 * self.state>>4 + 1) & 0xFF) + 4294967296) & 0x7FFFFFFF)<<4
return self.state

class rngD():
def __init__(self, seed=1):
self.state = self.store = seed
def setSeed(self, seed): self.state = seed
def rand(self): return 1.0*self.next()/(1<<31)
def current(self): return self.state
def next(self):
self.store = self.state
self.state = (69069 * self.state + 12345) & 0xFFFFFFFF
self.state = int(.8*self.state+0.2*self.store)
return self.state

class rngE():
def __init__(self, seed=12345): self.state = seed
def setSeed(self, seed): self.state = seed
def rand(self): return 1.0*self.next()/(1<<31)
def current(self): return self.state
def next(self):
self.state = (397204094 * self.state ) & 0x7FFFFFFF
return self.state

- Evaluate the five pseudo random number generators (RNGs) supplied with respect to the quality of the generated random sequence. High quality random number generators are fundamental in ensuring reliable simulations.

Determine the criteria (set of tests) to be used in evaluating RNG.

Write a short report describing the given random number generators and the quality of their output.
1. Evaluate and rank in order of quality, the random number generators (RNGs) given A-E
2. To use the RNGs given you will need first to import the module
From rng import *
3. Create an instant of any of the generators using, rngA, rngB, rngC etc....using
rng = rngA (seed) where the argument (seed) is optional
4. To generate a random integer use rng.next ( )
But you will most probably want to generate floating point number in range [0 1) using
rng.rand ( )
: - import, create an instance, generate, => evaluate and rank => write a detailed report

Reference no: EM13935316

Construct and interpret separate roi charts

Construct and interpret separate ROI charts for the two models. (Extra credit: Find a way to construct a single ROI chart comparing the two models.) Which model is preferred

Show that ftp is an insecure file transfer protocol

The data connection is opened and then closed for each file transfer activity. We also show that FTP is an insecure file transfer protocol because the transaction is done in

Challenges in planning and designing a solution

In your opinion, what are the three biggest challenges in planning and designing a solution for a Java programming problem? What can you do to overcome these challenges? How

Discuss the confidence level the p-value and the decision

A 90% confidence interval estimated the mean sodium content for this kind of hot dog at 317.2 to 326.8 mg. Explain how these two results are consistent. Your explanation sho

Define the role of streaming media to support

Research the role of streaming media to support organizational objectives. What are three possible ways that streaming media can be used to accomplish the objectives of an org

What are some uses for wrapper classes

Wrapper classes are classes that surround primitive types with additional functionality. What are some uses for wrapper classes? Show some examples of how they could be used

How many more motors should be tested

To determine the efficiency of a batch of production of electric motors, 10 motors are tested. The average efficiency of the sample is calculated to be 91.0%, and the standa

What is the best way to prepare for a course

What is the best way to prepare for a course in computer science, which is specifically fundamentals in web development? I will begin to take  this course in the spring of 201

Reviews

Write a Review

 
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd