A total of N students took a standardized test and their test scores were forwarded to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A total of N students took a standardized test and their test scores were forwarded to us in the form of (s₁, m₁), (s2, m2),,(sn, mn) where s, is a score and m; is the num- ber of students with score si. For example, if the data is (10,3), (7.5, 5), (21, 6), then 14 students took the test and their scores are (10, 10, 10, 7.5, 7.5, 7.5, 7.5, 7.5, 21, 21, 21, 21, 21, 21). a. (2 pts.) Given (s₁, m₁), (s2, m₂),,(Sn, mn) and a positive integer k, design an algorithm based on sorting that outputs the kth lowest score. For instance, when the input is (10,3), (7.5, 5), (21, 6) and k = 3, the output should be 7.5; when k = 7, the output should be 10. What is the running time of your algorithm? b. (3 pts.) Solve the same problem this time in O(n) average time. Explain why your algorithm is correct and why its average running time is O(n). A total of N students took a standardized test and their test scores were forwarded to us in the form of (s₁, m₁), (s2, m2),,(sn, mn) where s, is a score and m; is the num- ber of students with score si. For example, if the data is (10,3), (7.5, 5), (21, 6), then 14 students took the test and their scores are (10, 10, 10, 7.5, 7.5, 7.5, 7.5, 7.5, 21, 21, 21, 21, 21, 21). a. (2 pts.) Given (s₁, m₁), (s2, m₂),,(Sn, mn) and a positive integer k, design an algorithm based on sorting that outputs the kth lowest score. For instance, when the input is (10,3), (7.5, 5), (21, 6) and k = 3, the output should be 7.5; when k = 7, the output should be 10. What is the running time of your algorithm? b. (3 pts.) Solve the same problem this time in O(n) average time. Explain why your algorithm is correct and why its average running time is O(n).
Expert Answer:
Related Book For
Introduction To Statistical Investigations
ISBN: 9781119683452
2nd Edition
Authors: Beth L.Chance, George W.Cobb, Allan J.Rossman Nathan Tintle, Todd Swanson Soma Roy
Posted Date:
Students also viewed these programming questions
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Write a literature review for your study. See below for an example of a literature review. Your literature review should provide both analysis and synthesis of previous studies as related to the...
-
1. Identify the function of the underlined noun/s in each item. 1. On rainy mornings, is your bus usually late? 2. On the desk were the red pencils. 3. Volcanoes and earthquakes are destructive...
-
Use the graphs of the two equations shown below. (a) Describe the graphs of the two equations. (b) Can you conclude that the system of equations whose graphs are shown is inconsistent? Explain. 12 10...
-
Evaluate the definite integral. Jo /3 sin+sin 0 tan0 sec 0 de
-
Use the conservation laws to show that, when the spring in Figure 7.25 expands, the change in the kinetic energy of Earth is negligible and we are therefore justified in using Eq. 7.11. Equation 7.11...
-
Lotoya Davis Corporation has ten million shares of common stock issued and outstanding. On June 1 the board of directors voted an 80 cents per share cash dividend to stockholders of record as of June...
-
1. In figure, two identical particles each of mass m are tied together with an inextensible string. This is pulled at its centre with a constant force F. If the whole system lies on a smooth...
-
How will scientists ensure better oversight of germline editing in the future?
-
For Questions 26 and 27, assume that two different coastal cities are competing to have their location selected by the Federal Government to build a Major Deepwater Shipping Port for large container...
-
Create an executive summary that analyzes the impact that adoption of International Financial Reporting Standards would have on Swift's financial statements and its investors. For your analysis,...
-
Discuss Zynga's revenue recognition policies, i.e., how Zynga recognizes its revenue, and whether its revenue recognition policy provides decision useful information in terms of relevance and...
-
In December, Mellie's Parfum's planned to sell 800 bottles of perfume but actually sold 900 bottles. Mellie Grant, the owner of the company, is reviewing the Flexible Budget Performance Report. The...
-
Retail is the most familiar channel to most of us. Reminder, Marketing is the process, institutions, and activities that create, communicate, capture VALUE (what you give up for what you get). Pick a...
-
1. A compound has molecular formula of C8H8O and every mole of this compound is able to react with 4 moles of H2 in a complete catalytic hydrogenation. How many ring(s) is/are there in this compound?...
-
SCHEDULE OF COST OF GOODS MANUFACTURED The following information is supplied for Sanchez Welding and Manufacturing Company. Prepare a schedule of cost of goods manufactured for the year ended...
-
Is this study an experiment or an observational study? How are you deciding? In 1970 Linus Pauling, a well-known chemist and Nobel Prize winning scientist, published Vitamin C and the Common Cold...
-
Reconsider the scenario in Exercise 1.4.4 about coffee consumption. Which of AE is the appropriate sample statistic and proper symbol? A. p = 0.40 B. = 0.40 C. p = 0.45 D. = 0.45 E. n = 140 Data...
-
Reconsider Exercise 7.2.16 about rebounding free throws. a. Use the 2SD method to create an approximate 95% confidence interval for the mean difference in number of shots made (rebounded ...
-
The end of a spring is pulled to the right by 4 cm; the restoring force is 8 N to the left. Given the relationships shown in Figure 8.14c, if the spring is returned to equilibrium and then pushed to...
-
A 10 kg mass is hung from a 1-m-long cable, causing the cable to stretch by 2 mm. Suppose a 10 kg mass is hung from a 2 m length of the same cable. By how much does the cable stretch? A. 0.5 mm B. l...
-
Sketch a force acting at point \(\mathrm{P}\) in Figure Q8.2 that would make the rod be in static equilibrium. Is there only one such force? P - FIGURE Q8.2
Study smarter with the SolutionInn App