Develop a program to test rand function for bias

Assignment Help C/C++ Programming
Reference no: EM131390661

System programming c++

C++ provides rand() function to generate random numbers. Sometimes random number generators can be biased. For this homework I would like you to develop a program to test rand() function for bias. Your program must generate 10 million numbers between 0 and 100, and then test the frequency of the numbers.

a.) If the random number generator doesn't have bias, then around 50% of the numbers should be less than 50 and 50% of them should be larger than 50. Show that by writing C++ program.

b.) A better test would be counting the numbers between 0-10, 10-20, 20-30, 30-40, 40 - 50, 50-60, 60-70, 70-80, 80-90, and 90-100 , then compare their count. The result should be approximately same. Show that by writing a C++ program c.) The best test would be checking the frequency of the numbers i by counting the amount of each generated number (0, 1, 2, 3, 4 .... 99), and then compare them. There should be approximately same amount for each numbers. See the following table. Number count 0 2003 1 2000 2 1999 3 1998 4 ......... . ....... . ..... Hint. You can write a main program and two functions for each part, and call the functions from main program. No need to develop two different programs.

Reference no: EM131390661

Questions Cloud

Advise giant as to the validity of its alternatives : Giant is presently seeking to obtain an exclusive dealing arrangement with Universal or to acquire Universal. Advise Giant as to the validity of its alternatives.
Discuss the validity of the given : Discuss the validity of the given:- An agreement between manufacturer and distributor not to sell a dealer a particular product or parts necessary for the product's repair.
Discuss the validity and effect of each of the situations : Discuss the validity and effect of each of the situations:- A, a distiller of liquor, and B, A's retail distributor, agree that B should charge a price of $5 per bottle.
Find the molecular formula of diazomethane : The molar mass of diazometane is 42.04 g/mol. Find the molecular formula of diazomethane and draw its lewis structure
Develop a program to test rand function for bias : C++ provides rand() function to generate random numbers. Sometimes random number generators can be biased. For this homework I would like you to develop a program to test rand() function for bias.
Explain whether hunger will prevail under a cause of action : On October 4, Hunger was terminated because of the incident. Explain whether Hunger will prevail under a cause of action for wrongful termination.
Explain whether or not the eeoc will prevail : After conducting an investigation and instituting administrative proceedings, the Equal Employment Opportunity Commission (EEOC) brought suit, alleging that the Union had discriminated against African Americans and Hispanics by means of the MSP. E..
Write a business case for the new hwe accessories website : Write a 1- to 2-page business case for the new HWE Accessories website using Microsoft Word. HWE Accessories produces accessories for cell phones, such as cases and screen covers.
Explain does the conduct constitute sexual harassment : Taylor and the bank categorically denied Vinson's allegations. Does the conduct constitute sexual harassment? Explain.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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