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

Questions Cloud

Divide one operand by the other and return the remainder : Write a script that defines two integers as constants.For instance, one of the constants could be the distance from New York City to Los Angeles.
Criteria are used to measure progress and goal achievement : Build an action plan on the situational analysis paper you wrote in Assessment 3; however, be sure to provide the full context needed to support your action plan within this paper. Assume that the reader is not familiar with your situational analysis..
Why important daughter cells to receive portion of cytoplasm : You are examining a slide showing cells undergoing mitosis. You see a cell in which a centriole is at each end of the cell and single stranded chromosomes are about halfway between the midregion of the cell and each centriole. What stage is this c..
Delete an existing product from the database : You should also consider how to validate the requests, i.e. don't delete a record that's not there and don't add a product with an existing code
Five pseudo random number generators : 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.
Negotiate access to an organisation and research : You are expected to negotiate access to an organisation and research the company history, organisational structure, and performance and compensation practices.
An objective strategy : 'There is no more an objective strategy than there is a Big Dipper.' Discuss the implication of this contention for strategy, with reference to Smircich and Stubbart's (1985) concept of enactment.
Design an html document for a restaurant using javascript : I expect your web page to look and function very realistically. For example, item prices should be lined up in the menu and shopping cart sections.
Width and distance text boxes for vertical : You are to write a software application using the Java programming language that enables a user to  design a flag. The user draws circles or ellipses, horizontal or vertical bars on the flag. The user chooses the colour, width, height and location..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Who swallowed a cat, imagine that to swallow a cat.

There was an old woman who swallowed a fly. I don't know why she swallowed that fly, Perhaps she'll die. There was an old woman who swallowed a spider, That wriggled and wiggled and jiggled inside he She swallowed the spider to catch the fly, I do..

  What is it security auditing and what does it involve

What is IT Security Auditing. What does it involve. Why are Governance and Compliance Important

  What ''are the differences between a policy, a standard

What 'are the differences between a policy, a standard, and a practice? What are the three types of security policies? Where would each be used? What type of policy would be needed to guide use of the Web? E-mail? Office equipment for personal use?

  Determine whether replication would be the right approach.

You are a database administrator for your company. With the acquisition of SNHU Appliances, your database is running very slowly. Your management has asked you to look into options to optimize the database. You think replication might be a good solut..

  Design a program that asks for the price of each item

Design a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of the sales tax and the total.

  Identify several potential challenges

Use the DOQ-IT resource "A Systems Approach to Operational Redesign Workbook," referenced in the unit 8 slides as a guide for completing the activity.

  Describe not be able to perform without microsoft office

Assume that you did not have access to Microsoft Office or other compatible application suites. Describe at least three (3) tasks that you would not be able to perform without Microsoft Office 2013.

  Compare and contrast the differences between unix

Compare and contrast the differences between Unix (or Linux) and Window Traceroute.  All the codes for each ICMP error message are not fully listed and explained.  Identify a few scenarios in which ICMP error messages are generated?What available too..

  Operating system supported

To learn more about e-mail client programs, perform the following actives: Open a browser and search the Web for free E-mail client programs. Visit several of the home pages associated with these programs and make note of the following informatio..

  What u think about the article database fight funding cuts

What u think about the article Database fight funding cuts

  Learn the combined use of timer and the tracking of user

Lab 10 - The Student Game - Learn the Combined use of Timer and the tracking of user interactions Deliverables app.java, myJFrame.java, myJPanel.java, and other necessary Java files

  Case study of microsoft dynamics

For this assignment, you are to view the video case study "Evolution Homecare Manages Patients with Microsoft Dynamics CRM" located below and answer the following questions.

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