Estimating the value of a variable based on the existing variable?

29 Views Asked by At

Need your help with a math problem I having trouble to solve.

Let's say when we buy an item we need to pay 100 and the tax would 10 percent. So my buying cost becomes 110. And when I go to sell it even then I will have to pay 10 percent tax on the selling price. Now I need to find the miniumum amount above the buying price of 110 in which I need to sell it, so that my profit is > 0 even after paying the tax on the selling price.

So as an example, if I sell it at 120 I will incur a loss of 2 (i.e. 120 - 12 = 108). And if I sell it at 130, then I will make a profit of 7 (i.e. 130 - 13 = 117). Though in the second case I am making some profit, it is not optimum as I am looking for the least selling price above my cost price which will give me atleast 0.01 profit.

Till now, I have done the first part of the calculation and have stored the cost price in a variable. Not sure how to use the cost price from hereon and get the remaining part solved.

I know it is high school maths and probably pretty simple, but I need to get this coded and not just able to get it on my own. I looked everywhere in the internet but no luck. Please help.

1

There are 1 best solutions below

3
On BEST ANSWER

Let $p\geq 0$ be the purchasing price (\$100 in your example), $s\geq 0$ the selling price and $0 \leq t \leq 1$ the tax rate. You make a profit if and only if $(1+t)p < (1-t)s$.

Edit: I slightly changed the inequality since apparently you have to pay tax both on purchasing and selling?