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

  Draw a two-dimensional house seen from the front

Draw a two-dimensional house seen from the front, the way a child would: with a door, two windows, and a roof with a chimney. Feel free to add details; mabe have "smoke" come out of the chimney.

  Prepare a bus reservation system

You will be asked to demonstrate your program to your tutor - You should be prepared to answer questions concerning your design, code and test plan.

  Connectivity in undirected graphs

Connectivity in undirected graphs - array of linked list and another class will hold edges

  Write c program that find average of two or more salaries

Write a C program that calculates and prints the average of two or more salaries entered by the user. The program should first prompt the user to enter the number of salaries to process.

  Write a value-returning function

Write a program that uses the function isNumPalindrome given(Palindrome Number). Test your program on the following numbers: 10, 34, 22, 333, 678, 67876, 44444, and 123454321.

  C++ programming uml diagrams

The goal of this lab is to better familiarize you with polymorphism and the factory design pattern, two key components in Assignment

  Implement a stack class for stacks of ints

Implement a Stack class for stacks of ints. Include a default constructor, a destructor, and the usual stack operations: push(), pop(), isEmpty(), and isFull(). Use an array implementation.

  Write a program to convert between rectangular

Write a program to convert between rectangular and cylindrical coordinates, based upon user input. For example, if the user wants to convert cylindrical to rectangular coordinates, the user would input r, ?, z values and the program would output x, y..

  Determine which number is smaller and which is larger

The program should use the conditional operator to determine which number is the smaller and which is the larger.

  Software and system standards

Describe system and software standards that could be used for the description of control constructs in C, C#, or Java.

  Write a program in which set up a douhly-subscripted array

Write a program in which you set up a douhly-subscripted array to store each character in the wit. Ube ;old loops, and the most efficient  statements to do it. Include documentation (comment stmts.) in your program.

  Create a detailed ipo chart

Create a detailed IPO chart that also includes the algorithm from the attached c++ source code.

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