erated (range 100000 to 200000) Student Name : randomly generated (pick up from common English names : https://www.ssa.gov/oact/babynames/decades/century.html) Student Cumulative GPA : decimal x.xx, randomly gener

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 9PE
icon
Related questions
Question

Write a Python program that satisfies the following requirements:

Use the following information for both Questions 1 and 2.  Let ?n be 500, 1000, 1500 and 2000.  There is a size-?n array containing student information including

  • Student ID : integer, randomly generated (range 100000 to 200000)
  • Student Name : randomly generated (pick up from common English names : https://www.ssa.gov/oact/babynames/decades/century.html)
  • Student Cumulative GPA : decimal x.xx, randomly generated with normal distribution (range 1.0 to 4.0)

Search students by student ID using the binary search algorithm in 3 different data distribution cases for student ID:

1)    Normal distribution: symmetrical

2)    Normal distribution: positive skew

3)    Normal distribution: negative skew

Additional information: Student ID is a discrete random variable. The question said the Student ID should be generated randomly. Even though random variables created by the normal distribution is continuous, you can just round it to integer values and make sure they are distinct. If one of the values happen to be duplicate, you can just regenerate again.  You can also use numpy.random.normal to generate normal random variable.

Hypothesis: the distribution of student ID has no effect to the performance (big-?O-notation) of the binary search algorithm.

Determine whether we can reject or fail to reject this hypothesis by showing through running experiments.  Try with different levels of skewness.

**Extra credits**: any extra information you can report about the relationship between skewness of normal distribution and search performance.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Structured English
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT