14.10 compute a salary threshold

#1

I am not getting how book authors came up with the following equation for the answer.

Suppose the cap for a total payroll of T is known to lie between the kth
and (k + l)th salaries. We want Summation A[i] + (n-k)c to equal = T
And I also don’t get the following lines
A = (20,30,40,90,100), and T = 210. The payrolls for
caps equal to the salaries in A are (100,140,170, 270, 280).

0 Likes

#2

Hi,

A = (20,30,40,90,100), and T = 210. The payrolls for
caps equal to the salaries in A are (100,140,170, 270, 280).

Here at each i, it is assumed that cap is equal to the salary at i which is A[i].

Summation (i->(0,k-1)) A[i] + (n-k)c

100 = (20,20,20,20,20) -> n=5, k=0, c=20
140 = (20,30,30,30,30) -> n=5, k=1, c=30
170 = (20,30,40,40,40) -> n=5, k=2, c=40
270 = (20,30,40,90,90) -> n=5, k=3, c=90
280 = (20,30,40,90,100) -> n=5, k=4, c=100

0 Likes