Post Reply 
Somehow related to HP Calculators
01-04-2022, 03:08 PM
Post: #5
RE: Somehow related to HP Calculators
(01-04-2022 01:49 PM)albertofenini Wrote:  Let's make an example, starting salary is 10.000

1st year increase is 500 salary goes to 10.500
2nd year increase is 500 the salary goes to 11.000
3rd year increase is 1000 salary reaches 12.000
4th year increase is 1000 salary reaches 13.000
5th year increase is 1500 salary reaches 14.500
6th year increase is 1500 salary reaches 16.000

the earning for the guy is 10500+11000+12000+13000+14500+16000 = 77000
versus 10000*6 + 6000 (the sum of the bonus) = 66000

To get 6 paid raises, employee had to work 7 years: total earnings = 10000+77000 = 87000

Also, odd and even years have different paid raise formulas
Let s0 = starting salary, with 2n paid raises

Cumulative company paid to employee (worked 2n+1 years)
= s0 * (2n+1) + sum(500*k*k, k=1..n) + sum(500*k*(k+1), k=1..n)
= s0 * (2n+1) + 500 * sum(2k^2 + k, k=1..n)
= s0 * (2n+1) + 500 * (2*n*(n+1)*(2n+1)/6 + n*(n+1)/2)
= s0 * (2n+1) + 250 * n * (n+1) * (4n+5) / 3

For example, for working 7 years (n=3):

CAS> (s0*(2n+1) + 250*n*(n+1)*(4n+5)/3) (s0=10000, n=3)       → 87000

For completeness, if employee worked even years:

Cumulative company paid to employee (worked 2n years)
= s0 * (2n+1) + 250 * n * (n+1) * (4n+5) / 3 - (s0 + 500*n*(n+1))
= s0 * 2n + 250 * n * (n+1) * (4n-1) / 3
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Somehow related to HP Calculators - Albert Chan - 01-04-2022 03:08 PM



User(s) browsing this thread: 1 Guest(s)