Write a program to calculate the probabilities of collisions

Assignment Help JAVA Programming
Reference no: EM131329821

Assignment

You have to doONE of the following:

1. Modify your Registration project(s) to use a Hash Table to maintain the student information instead of the sorted array or BST. Your hash function should be based on the last three (3) digits of the student ID.
In your comments, include the average runtime for your Search, Insert and Delete methods, and how your program will handle collisions.

2. Adapt your Registration projects to include a menu (like in the warm-up project) that will determine, based on the "stability" of the registration data, the implementation of the student data (sorted array or bst). The project should include a way to change from the BST to the sorted array.

3. Write a program to calculate the probabilities of collisions for the following:

You are asked to write a program to store information for customers for a small local business. The owner wants to use "date of birth" (not the year!) as a way to look up customer information because he/she believes that the probability of collisions is very small.

Your program should calculate the probability of two customers having the same birthday, and finding

a. How many customers give a 50% chance of collision
b. How many customers give a 95% chance of collision

The program is not difficult, but be careful about the actual calculations (n! overflows for relatively small n)

Describe how you would handle collisions for the data, and also explain how you would write the "hash function" to assign a customer to the hash table by birthday.

4. Write a program that could be used to schedule jobs based on the "shortest job" algorithm, and compare the running of the programs to using a queue.

Use the data from the given table to calculate the "turnaround" time for each job (time a job is completed - time a job enters the system), and the average waiting time for the jobs ((total turnaround time - total "running" time)/number of jobs)

a) using a queue
b) using a heap based on "expected run time" (CPU burst)

Which method gives the lower average waiting time?

Reference no: EM131329821

Questions Cloud

What rate is velocity growing : Calculate the level of velocity for each year.  At what rate is velocity growing? Why does Bank Capital Exist? Why did brokered deposits during the S&L crisis cause interest rates to rise?
Game theory of money and banking : These questions concentrate on the game theory of money and banking. Consider the Principle-Agent problem in relation to banking.
Write a java progrmato calculate total annual compensation : Write a Java application using NetBeans Integrated Development Environment (IDE) that calculates the total annual compensation of a salesperson. Consider the following factors:A salesperson will earn a fixed salary of .
Accordance with moral hazard concerns : Economists have long argued that, due to moral hazard problems, that "bailing out" firms such as banks (the S&L crisis), brokerage firms (Bear Stearns, Drexal Burnham...) and nations (Perhaps Greece in the future and the earlier Mexican Currency C..
Write a program to calculate the probabilities of collisions : Write a program to calculate the probabilities of collisions for the following: You are asked to write a program to store information for customers for a small local business.
What is the probability that the sample mean will be within : A population has a mean of 400 and a standard deviation of 80. Suppose a sample of size 125 is selected and x ¯ is used to estimate μ. What is the probability that the sample mean will be within +/- 5 of the population mean (to 4 decimals)? What is t..
Effect on the size of the money supply : When the reserve requirement is increased, what is the effect on the size of the money supply? What is the practical justification of the reserve requirement, besides as a monetary policy tool?
How many moles of oxygen per minute are absorbed : An athlete at high performance inhales of air at 1.0 atm and 298 K at a respiration rate of 32 breaths per minute. If the exhaled and inhaled air contain 15.3 and 20.9% by volume of oxygen respectively,
Mundell-fleming model : Mundell-Fleming Model. Explain the use of the Mundell-Fleming Rule to solve a combination of Unemployment and BOP deficit. Be sure to explain how your policies would fix the imbalances.

Reviews

Write a Review

JAVA Programming Questions & Answers

  What is the purpose of the enableevents method

What is the difference between the JDK 1.02 event model and the event-delegation model introduced with JDK 1.1? What is the purpose of the enableEvents() method?

  Modify the java application using java netbeans and ide

Modify the Java application using Java NetBeans IDE to meet these additional and changed business requirements: The company has recently changed its total annual compensation policy to improve sales.

  Program that allows users to enter a dollar amount

Write a program that allows users to enter a dollar amount for their bank account balance at the beginning of the month. Then ask the user to enter a dollar amount for any number of checks written in a month, up to 50.

  Create a java class named headphones

1. Create a Java class named HeadPhones to represent a headphone set. The class contains:

  Modify mortgagedisplaygui.java to implement actionlistener

Interrogate the ActionEvent object and determine the source of the action.

  How do you manage cookies in applet-servlet communication

When you communicate with a servlet from an Applet or an application, how can you ensure that the session information is preserved? That is, how do you manage cookies in applet-servlet communication?

  Solving programming problems

Write a computer program that will figure out the total of an order when given the amount of the order ($1000) and a sales tax rate of eight percent.

  Converting pseudocode to javascript

I would need help in converting converting pseudocode to JavaScript. I already have the pseudocode in a html file but need it to be converted to JavaScript and run like it should.

  Write a program that displays a countdown first

Write a program that displays a countdown first, and then displays the position and velocity of an object for every second it drops, as long as it is above 500 feet

  Your taskbullthe auction system should allow the user to

your taskbullthe auction system should allow the user to participate in a number of items and for the user to be able

  Program that prompts the user to enter the year and display

Write a program that prompts the user to enter the the year and first day of the year and displays the calendar table for the year on the console. For example , if the user entered the year 2013, and 2 for tuesday, January 1, 2013, your program shoul..

  Data about a virtual memory system

You are given the following data about a virtual memory system: (a) The TLB can hold 1024 entries and can be accessed in 1 clock cycle (1 nsec).

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