Did I put this is the wrong place? or just no-one has any ideas?
Im pretty stuck trying to figure it out
1 Apple = (£3.00 + (n x £1.00) ) * P
1 Date = (£3.50 + (n x £1.20) ) * P
1 Chilli = (£3.25 + (n x £1.10) ) * P
1 Mango = (£2.50 + (n x £0.80) ) * P
Where n = the number you already have.
and P = your current amount / the maximum amount
If I have 5 Apples, and the maximum amount is 10
Cost of buying 1 apple =
= 3.00 + (5 * 1.00) * 5/10
= 8.00 * 0.5
= £4.00
Cost of buying 2 apples (6th and 7th)
=[ 3.00 + (5 * 1.00) * 5/10 ] + [ 3.00 + (6 * 1.00) * 6/10 ]
=(8.00 * 0.5) + (9.00 * 0.6)
=£9.40
Cost of buying all 5 apples (6th, 7th, 8th, 9th, 10th)
=(8 * 0.5) + (9 * 0.6) + (10 * 0.7) + (11 * 0.8) + (12 * 0.9)
=4.00 + 5.40 + 7.00 + 8.80 + 10.80
=£36.00
But how do I put that into a formula that will work for apples, dates, chillis and mangos When the values will be much larger.
Example
Cost of buying 999 apples when;
Current apples = 1500
Maximum apple = 2700
Cost of buying 899 mangos when;
Current mangos = 2601
Maximum mango = 3500
Edit:
If a minimum value is needed, P can't drop below 0.1
So.
If Current/Maximum < 0.1 : P = 0.1
hi1 Apple = £3.00 + (n x £1.00) * P
1 Date = £3.50 + (n x £1.20) * P
1 Chilli = £3.25 + (n x £1.10) * P
1 Mango = £2.50 + (n x £0.80) * P
Where n = the number you already have.
and P = your current amount / the maximum amount
If I have 5 Apples, and the maximum amount is 10
Cost of buying 1 apple =
= 3.00 + (5 * 1.00) * 5/10
= 8.00 * 0.5
= £4.00
Cost of buying 2 apples (6th and 7th)
=[ 3.00 + (5 * 1.00) * 5/10 ] + [ 3.00 + (6 * 1.00) * 6/10 ]
=(8.00 * 0.5) + (9.00 * 0.6)
=£9.40
Cost of buying all 5 apples (6th, 7th, 8th, 9th, 10th)
=(8 * 0.5) + (9 * 0.6) + (10 * 0.7) + (11 * 0.8) + (12 * 0.9)
=4.00 + 5.40 + 7.00 + 8.80 + 10.80
=£36.00
But how do I put that into a formula that will work for apples, dates, chillis and mangos When the values will be much larger.
Example
Cost of buying 999 apples when;
Current apples = 1500
Maximum apple = 2700
Cost of buying 899 mangos when;
Current mangos = 2601
Maximum mango = 3500
Edit:
If a minimum value is needed, P can't drop below 0.1
So.
If Current/Maximum < 0.1 : P = 0.1
first you have placed brackets wrongly, its very confusing
it should be1 Apple = £3.00 + (n x £1.00) * P
1 Apple = (£3.00 + (n x £1.00) )* P
you have to calculate by yourselfBut how do I put that into a formula that will work for apples, dates, chillis and mangos When the values will be much larger.
what this for?????what you need in this???If a minimum value is needed, P can't drop below 0.1
So.
If Current/Maximum < 0.1 : P = 0.1
sorry about the brackets, my mistake. Changed it in original post
I thought a minimum value might be needed because while I was trying to work it out, I tried to do a sum of all the values, but it didnt work, because the minimum P is 0.1
Is there no way to create a formula for this then?
i started working on this without the P multiplier, which was simple arithmetic progression, and I thought I was just so used to using that I couldn't find the way to introduce P into the equation.
Before P;
Sn = (n/2) * ( 2a + (n-1)d)
But when I had to introduce P
I tried (Sn) * (average of P)
but that way doesn't take into account the larger P multiplied by the growing d, so doesnt give an accurate figure.
then I tried;
[(n * a) * average P] + (an arithmetic progression with a variable d)
but I'm pretty sure you cant have d as a variable in an arithmetic series
if u need a formula then you can try this one, its a bit complicatedsorry about the brackets, my mistake. Changed it in original post
I thought a minimum value might be needed because while I was trying to work it out, I tried to do a sum of all the values, but it didnt work, because the minimum P is 0.1
Is there no way to create a formula for this then?
i started working on this without the P multiplier, which was simple arithmetic progression, and I thought I was just so used to using that I couldn't find the way to introduce P into the equation.
Before P;
Sn = (n/2) * ( 2a + (n-1)d)
But when I had to introduce P
I tried (Sn) * (average of P)
but that way doesn't take into account the larger P multiplied by the growing d, so doesnt give an accurate figure.
then I tried;
[(n * a) * average P] + (an arithmetic progression with a variable d)
but I'm pretty sure you cant have d as a variable in an arithmetic series
and only for
( ((d^2 + d -2)n) + (((2d + 1)(n)(n+1))/2) + (((n)(n+1)(n+2))/6) )/m1 Apple = (£3.00 + (n x £1.00) ) * P
d->no. of apples in our hand
n->no. of apple to be buy
m->maximum amount
Current = 5
Want = 5 more
top = 10
( ((5^2 + 5 -2)5) + (((2*5 + 1)(5)(5+1))/2) + (((5)(5+1)(5+2))/6) )/10
((28*5) + ((11 * 5 * 6)/2) + ((5*6*7)/6) /10
(140 + 165 + 35) /10
=34
Should be 36?
and I think what Ive been doing is wrong, seen as I seem to be going down a completely different line.
ohCurrent = 5
Want = 5 more
top = 10
( ((5^2 + 5 -2)5) + (((2*5 + 1)(5)(5+1))/2) + (((5)(5+1)(5+2))/6) )/10
((28*5) + ((11 * 5 * 6)/2) + ((5*6*7)/6) /10
(140 + 165 + 35) /10
=34
Should be 36?
and I think what Ive been doing is wrong, seen as I seem to be going down a completely different line.
i m sorry
i typed wrong formula
actually it is
( ((d^2 + d -2)n) + (((2d + 1)(n)(n+1))/2) + (((n)(n+1)(2n+1))/6) )/m
d->no. of apples in our hand
n->no. of apple to be buy
m->maximum amount
now try.
Current = 5
Want = 5 more
top = 10
( ((5^2 + 5 -2)5) + (((2*5 + 1)(5)(5+1))/2) + (((5)(5+1)(2*5+1))/6) )/10
((28*5) + (11*5*6/2) + (5*6*11/6) )/10
(140 + 165 + 55) /10
=36 cool =)
Thanks for the help
Just to test
When
Current = 1500
Want = 200 more
top = 2900
Should cost £177,002.2069
( ((1500^2 + 1500 -2)200) + (((2*1500 + 1)(200)(200+1))/2) + (((200)(200+1)(2*200+1))/6) )/2900
(450299600 + 60320100 + 2686700) / 2900
=£177002.20689
Sweet, thanks again
Apples, £3.00 £1.00
-----------
hmm, so why doesnt it work for the others?
Mango, £2.50 £0.80
Current = 5
Want = 5 more
top = 10
Cost of buying 6th =
= 2.50 + (5 * 0.80) * 5/10
= 6.50 * 0.5
= £3.25
Cost of buying 2 mangos (6th and 7th)
=[ 2.50 + (5 * 0.80) * 5/10 ] + [ 2.50 + (6 * 0.80) * 6/10 ]
=(6.50 * 0.5) + (7.30 * 0.6)
=£7.63
Cost of buying all 5 mangos (6th, 7th, 8th, 9th, 10th)
=(6.5 * 0.5) + (7.3 * 0.6) + (8.1 * 0.7) + (8.9 * 0.8) + (9.7 * 0.9)
=3.25+4.38+5.67+7.12+8.73
=£20.42
( ((d^2 + d -2)n) + (((2d + 1)(n)(n+1))/2) + (((n)(n+1)(2n+1))/6) )/m
d->no. of apples in our hand
n->no. of apple to be buy
m->maximum amount
*works on it*
c->Current no. of apples in our hand
n->No. of apple to be buy
t->Total allowed
a->original cost of food
d->changing cost
Ive got it to
When n=2 [ a( c + (c+1) ) + d( c^2 + (c+1)^2 ) ] /t
When n=3 [ a( c + (c+1) + (c+2) ) + d( c^2 + (c+1)^2 + (c+2)^2) ] /t
When n=4 [ a( c + (c+1) + (c+2) + (c+3) ) + d( c^2 + (c+1)^2 + (c+2)^2 + (c+3)^2) ] /t
So
Sn = [ a( nc + ( n(n-1)/2 ) ) + d( n(c^2) + (n^2 - n) + ???? ) ] /t
Im unsure how to finish the equation... so close..
should be;
+1 when n=2
+5 when n=3
+14 when n=4
+30 when n=5
+55 when n=6