Obtain the total amount that needs to be sell at a higher price to recover the initial investment

104 Views Asked by At

I'm having problems to solve a petry basic math problem that I need to code ( I feel very stupid cause of this). The problem is that I'm buying an amount of a product at a certain price and selling it at another higher price. The sell can be all at once ir be divided in batches.

for example:

I buyed 1000 apples at a price of 15, but I will sell them at a price of 18. Bu I will sell them in batches of 200, 400, 300 and 100.

At first, I was obtaining the percentage increment from 15 to 18, that was $20\%$, and multiplying it to every batch, like this:

$200 * 0.2 = 40$ so I need to sell $160$

for $400$ I need to sell $320$

for $300$ I need to sell $160$

for $100$ I need to sell $160$

Finally I sold $800$ apples at a price of $18$, but as you can see this is wrong due that $800*18$ is $14400$ and not $15000$.

I know if that I divide the initial investment by the new price $\frac{15000}{18}$ I will get the amount of apples that I need to sell to cover the initial investment. But don't know how I can apply this to determinate what percentage of every batch I need to sell.

1

There are 1 best solutions below

0
On

As you say, $$\frac{15000}{18} = 833.3333$$ is the number of apples you have to sell, and this is $83.33\%$ of the total number of apples, so this is the percentage of each batch you need to sell to break even.