Suppose you are a teacher at a university. You have to assign a letter grade to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Suppose you are a teacher at a university. You have to assign a letter grade to each student based on his or her unique total score. Scores can only be compared to each other. You are grading on a curve, and there are a total of k different grades possible. You want to rearrange the students into k equally sized groups such that everybody in the top group has a higher score than everybody in the second group, and so forth. However, you do not care how students are ordered within each group (because they will all receive the same grade). 1. Describe and analyze an algorithm that takes an unsorted n-element array A of unique scores and an integer k, and divides A into k equally sized groups as described above. Your algorithm should run in time O(nk). You may assume that n is divisible by k, but note that k is an input into the algorithm, not a fixed constant. 2. In the case that k =n, prove that any algorithm to solve this problem must run in time (n log k) in the worst case. Recall that we are only considering comparison-based algorithms, i.e., algorithms that only compare scores to each other as a way of finding information about the input. Hint: this should be a very short proof. 3. Now describe and analyze an algorithm for this problem that runs in time O(n log k). You may assume that k is also a perfect power of 2, in addition to your assumption that n is a multiple of k. Suppose you are a teacher at a university. You have to assign a letter grade to each student based on his or her unique total score. Scores can only be compared to each other. You are grading on a curve, and there are a total of k different grades possible. You want to rearrange the students into k equally sized groups such that everybody in the top group has a higher score than everybody in the second group, and so forth. However, you do not care how students are ordered within each group (because they will all receive the same grade). 1. Describe and analyze an algorithm that takes an unsorted n-element array A of unique scores and an integer k, and divides A into k equally sized groups as described above. Your algorithm should run in time O(nk). You may assume that n is divisible by k, but note that k is an input into the algorithm, not a fixed constant. 2. In the case that k =n, prove that any algorithm to solve this problem must run in time (n log k) in the worst case. Recall that we are only considering comparison-based algorithms, i.e., algorithms that only compare scores to each other as a way of finding information about the input. Hint: this should be a very short proof. 3. Now describe and analyze an algorithm for this problem that runs in time O(n log k). You may assume that k is also a perfect power of 2, in addition to your assumption that n is a multiple of k.
Expert Answer:
Answer rating: 100% (QA)
1 Algorithm for Onk time complexity First sort the array A in nondecreasing order Next initialize an ... View the full answer
Related Book For
Business Analytics Communicating With Numbers
ISBN: 9781260785005
1st Edition
Authors: Sanjiv Jaggia, Alison Kelly, Kevin Lertwachara, Leida Chen
Posted Date:
Students also viewed these programming questions
-
What is thread affinity, and how does it influence performance in multi-core systems? What tools or techniques are available for tuning thread affinity ?
-
The Crazy Eddie fraud may appear smaller and gentler than the massive billion-dollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Assume that the Central bank decides to sell government bonds to the commercial banks. a.) Use the demand and supply curves for loanable funds to show the effect of this measure on the interest rate....
-
Give an example of how e-HRM improves the efficiency of human resource management for Plan International.
-
Progressive Painting Company (PPC) is a successful company in commercial and residential painting. PPC has a variety of jobs: new construction, repair and repainting existing structures, and...
-
Eco-efficiency provides necessary but not sufficient indicators of environmental performance. What is environmental performance? Provide an example of another type of information that is important...
-
Carl, a salesman for Smith, comes to Bensons home and sells him a complete set of gourmet cooking utensils that are worth approximately $300. Benson, an eighty-year-old man living alone in a one-room...
-
Problem 5. SAVE and PREVIEW ONLY SAVE and PREVIEW ONLY -- ANSWERS NOT SUBM (1 point) Get help entering answers A car whose position, s, is given by the following table: t(sec) 0 0.2 0.4 0.4 0.6 0.6...
-
Elizabeth is moving from a one bedroom apartment in one city to a similar apartment in another city. She has been quoted a flat fee for the truck rental and has two estimates for wages of the movers...
-
In 2006 the Australian Government established an inquiry into corporate social responsibilities with the aim of deciding whether the Corporations Act should be amended so as to specifically include...
-
You need to borrow $360,000 for to purchase a property, and$2400 per month is the most you can afford. Approximately how longa loan term must you get in your mortgage, if the interest rate is7%?
-
SuperDry manufactures and sells T-shirts for all kinds of events. The company has two manufacturing operations shirt-making and printing. When the company receives an order, the shirt-making...
-
The first production department of Stone Incorporated reports the following for April. Direct Materials Units Beginning work in process inventory 73,000 Percent Complete 75% Conversion Percent...
-
You own a portfolio that is 25 percent invested in Stock X, 40 percent in Stock Y, and 35 percent in Stock Z. The expected returns on these three stocks are 10 percent, 13 percent, and 15 percent,...
-
Answer why Leadership and Management are different. The functions of both and the overlap. (Northouse 2019) Use Fayol & Minztberg management theories. Explain the leader, the manager and the boss...
-
A long, straight wire carries a current i. A particle having a positive charge q and mass m, kept at a distance xo from the wire is projected towards it with a speed v. Find the minimum separation...
-
How will relating product contribution margin s to the amount of the constrained resource they consume help a company maximize its profits?
-
Consider the following LP problem where x 1 and x 2 represent the decision variables. Solve the LP problem to answer the following questions. a. What are the values of x 1 and x 2 at the optimal...
-
Use the bank account data set from the previous exercise to perform association rule analysis. Make sure to read the data file into R using the readtransactions function first. a. Explore the data...
-
As part of the 2010 financial overhaul, bank regulators are renewing efforts to require Wall Street executives to cut back on bonuses (The Wall Street Journal, March 5, 2019). It is known that 10 out...
-
On June 30, 2020, Perfect Party Planners (PPP) had a \$40,000 balance in Accounts Receivable and a \(\$ 3,000\) credit balance in Allowance for Uncollectible Accounts. During July, PPP made credit...
-
How much interest revenue should Maritimes Ltd. accrue (N December 31, 2019? a. \(\$ 225\) b. \(\$ 450\) c. \(\$ 375\) d. Some other amount
-
This exercise continues the situation of exercise S4-7, in which Environmental Products ended the year 2019 with accounts receivable of \(\$ 80,000\) and an allowance for uncollectible accounts of...
Study smarter with the SolutionInn App