Small challenge
|
09-20-2017, 07:33 PM
(This post was last modified: 09-20-2017 07:56 PM by Dieter.)
Post: #2
|
|||
|
|||
RE: Small challenge
(09-20-2017 06:43 PM)Pekis Wrote: But back home, he was wondering, "How much shall I have to pay him each month ? ... Sure it won't be 6000 / 24 = 480 each month and it will be more the first month ..." First of all: 6000/24 is not 480 but 250. ;-) And now let me see if I correctly understood the idea. Every month a certain amount is payed. This amount decreases from month do month by the same delta d. So in the last month the payment is p. In the month before the payment is p + d. In the month before that the payment is p + d + d. etc. This can be written as follows: p + p+d + p+2d + p+3d ... + p+23d = 6000 In other words: 24*p + d*(1+2+3+...+23) = 6000 The sum from 1 to 23 is 23*24/2 = 276. Or, generally spoken with n months: n*p + d*(n*(n–1))/2 = 6000 Now you can write d = (6000 – n*p) / (n*(n–1)) * 2 Or the other way round: p = (6000 – d*n*(n–1)/2) / n Since the monthly payments are supposed to decrease, d must be > 0. Looking at the formula for d this means that p must be less than 6000/n = 250. Otherwise you are free to choose what basic amount (p) you want to pay and by how much (d) the payments differ from month to month. You may start with a high payment which is substantially decreased each month, or you may start with a lower initial payment which descreass only gradually. In any case your last payment will be p and you start with p+(n–1)*d. Example: As shown above, p must be less than 250. Let's say p=200. This means that according to the formula above d is 4,3478, or roughly 4,35. The payment in month i (i=1...n) is p + (n–i)*d Here is a table (based on the exact d-value of 4,347826...) Code: month initial monthly remaining So you start with a 300,- payment and end up with 200,-. So the procedure is as follows: Define your last payment p and calculate d from this. Here d = (6000 – n*p) / (n*(n–1)) * 2. - or - Define the payment delta d and calculate p from this. Here p = (6000 – d*n*(n–1)/2) / n. Then your payment in month i is p + (n–i)*d. Special case: In the above formulas you may increase n by 1 and set p=0. Then the last payment is close to zero (actually the n+1st would be zero). For the example this leads to d = 6000/(24*25/2) = 20 and the payments are 24*20=480, 23*20=460, ... , 2*20=40, 1*20=20. Code: month initial monthly remaining Is this what you were looking for? Dieter |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Small challenge - Pekis - 09-20-2017, 06:43 PM
RE: Small challenge - Dieter - 09-20-2017 07:33 PM
RE: Small challenge - Didier Lachieze - 09-20-2017, 07:49 PM
RE: Small challenge - Pekis - 09-20-2017, 07:54 PM
RE: Small challenge - Dieter - 09-20-2017, 08:00 PM
RE: Small challenge - Joe Horn - 09-20-2017, 08:05 PM
RE: Small challenge - AlexFekken - 09-20-2017, 10:57 PM
RE: Small challenge - SlideRule - 09-20-2017, 11:52 PM
RE: Small challenge - AlexFekken - 09-20-2017, 10:51 PM
|
User(s) browsing this thread: 2 Guest(s)