Question: Data Structures Make it original Java plz. Javadoc as well. P-1.29 is the exercise. An example of what I want is /** * Purpose: A

Data Structures

 Data Structures Make it original Java plz. Javadoc as well. P-1.29

Make it original Java plz. Javadoc as well. P-1.29 is the exercise. An example of what I want is

/** * Purpose: A simple program that showcases the Birthday Paradox. * * * Goal: To 'prove' that the probability of similar birthdays is greater after n = 23 * Algorithm: * Track trial numbers ( = 20), adding 5 people(n) to each trial (at trial 5, n = 25) * Process all randomly simulated birthdays into a growing ArrayList each trial. * Document how many occurences are in every random trial, with a value greater than 1 indicating higher probability. * Process: * All pieces are written within the main method, wrapped in a large do-while loop. * - Multiple nested loops that work independent pieces of the process. * Effective as each part have been sectioned off according to their need and appearance in the algorithm. * - ie; trial number counts first, then randomising birthdays to put into the arrayList, followed by counting # of occurences. */

import java.util.Random; import java.util.ArrayList;

public class BirthdayParadox { public static void main(String[] args) { //calculates the trial number (in this case, 20 in total) int trialNumber = 1; //holds the number of people in a given 'room'/trial int n = 0; //counter for the number of similar occurrences int occurences = 0; //checkDate is a static number to assure every trial is controlled int checkDate = 45; do { //beginning trial's starting total; adds 5 people to each new trial n += 5; //array to store rand/omly generated birthdays, from 1-365 (in terms of days, excluding leap years ArrayList Birthdays = new ArrayList (); System.out.println(" Trial: " + trialNumber); //prints out the total number of people in the room by n += 5 System.out.println("Number of People in the Current Room(Trial): " + n); //updates the trial number trialNumber++; while(Birthdays.size() Do exercise P-1.29-you must document how you would solve/implement the birthday paradox and justify if it is an effective/good way to do so

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!