Question: 1. (a) (20 points) A challenge that arises in databases is how to summarize data in easy-to-display formats, such as a histogram. A problem in

1. (a) (20 points) A challenge that arises in databases is how to summarize data in easy-to-display formats, such as a histogram. A problem in this context is the minimal imbalance problem. Suppose we have an array A containing n numbers, all positive, and another input k. Consider k indices 11, 12,...ja that partition the array into k +1 subarrays A[1,01], A[i+1,32],...,A[jx+1, n]. The weight w(i) of the ith subarray is the sum of its entries. The imbalance of the partition is mox pulo) - (Ala)/(- +1% That is, the imbalance is the maximum deviation any partition has from the average size. Give an algorithm for determining the partition with the minimal imbalance given A, n, and k. (This corresponds to finding a histogram with k breaking points, giving k + 1 bars, as close to equal as possible, in some sense.) (b) (5 points) Explain how your algorithm would change if the imbalance was redefined to be - () ). 1. (a) (20 points) A challenge that arises in databases is how to summarize data in easy-to-display formats, such as a histogram. A problem in this context is the minimal imbalance problem. Suppose we have an array A containing n numbers, all positive, and another input k. Consider k indices 11, 12,...ja that partition the array into k +1 subarrays A[1,01], A[i+1,32],...,A[jx+1, n]. The weight w(i) of the ith subarray is the sum of its entries. The imbalance of the partition is mox pulo) - (Ala)/(- +1% That is, the imbalance is the maximum deviation any partition has from the average size. Give an algorithm for determining the partition with the minimal imbalance given A, n, and k. (This corresponds to finding a histogram with k breaking points, giving k + 1 bars, as close to equal as possible, in some sense.) (b) (5 points) Explain how your algorithm would change if the imbalance was redefined to be - () )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
