Question: For n distinct elements x1, x2, ..., xn with positive weights w1, w2, ..., wn such that Σni =1 wi = 1, the weighted (lower)

For n distinct elements x1, x2, ..., xn with positive weights w1, w2, ..., wn such that Σni =1 wi = 1, the weighted (lower) median is the element xk satisfying

". 4S and

a. Argue that the median of x1, x2, ..., xn is the weighted median of the xi with weights wi = 1/n for i = 1,2, ..., n.
b. Show how to compute the weighted median of n elements in O (n lg n) worst-case time using sorting.
c. Show how to compute the weighted median in Θ (n) worst-case time using a linear time median algorithm such as SELECT from Section 9.3.
The post-office location problem is defined as follows. We are given n points p1, p2, ..., pn with associated weights w1, w2, ..., wn. We wish to find a point p (not necessarily one of the input points) that minimizes the sum, where d(a, b) is the distance between points a and b.
d. Argue that the weighted median is a best solution for the 1-dimensional post-office location problem, in which points are simply real numbers and the distance between points a and b is d(a, b) = |a - b|.
e. Find the best solution for the 2-dimensional post-office location problem, in which the points are (x, y) coordinate pairs and the distance between points a = (x1, y1) and b = (x2, y2) is the Manhattan distance given by d (a, b) = |x1 - x2| + |y1 - y2|.

". 4S and

Step by Step Solution

3.29 Rating (181 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a The median x of the elements Xi X2 n is an element x xx satisfying x 1 i n andx x n2 and x 1 i n and x x n2 If each element x is assigned a weight w 1n then we get and Wi VI Wiis 72 x 1 i n andx x 7... View full answer

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

Document Format (1 attachment)

Word file Icon

C-S-A (92).docx

120 KBs Word File

Students Have Also Explored These Related Algorithms Questions!