Question: Please create java program for this assignment not the solution of algorithms. For an array of ranking: {3,2,4,1}, you would hire the first candidates (rank

Please create java program for this assignment not the solution of algorithms.

For an array of ranking: {3,2,4,1}, you would hire the first candidates (rank 3), the second candidate (rank 2, better than rank 3) and the last candidate (rank 1). You understand this?

For the hiring problem with n candidates, you can always use an array of ranks to denote the candidates, e.g., if n=4, array {3,2,4,1} means you would hire the first candidates (rank 3), the second candidate (rank 2, better than rank 3) and the last candidate (rank 1).

Use three methods to estimate the expected number of hires in hiring problem that contains n candidates.

Output Ln n;

Generate 10,000 random arrays of ranks, check the number

of hires for each random array, and output the average;

Enumerate all the n! permutations of the arrays of ranks, check the number of hires for each array in the set of n! permutations, and output the average.

Compare the results you get from method 1, 2 and 3 forn=8,10,12 in terms of number of hires and the running time.

If n=50, can your program give the result using method 1 and method 2? What about using method 3?

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!