So to start this question you find the prices of the two types of cups and create a basic formula for them. For the mug it would have a base price of $2.95 and a refill price of $0.50. For the disposable cup it would cost $0.85 a piece.
So for the mug you would take the base price of 2.95 and add it by x amount of refills to find the break even point of the two. So the formula would look like 2.95+0.50x. The other would be 0.85x. Now its just a matter of guess and check to see how many refills it would take for the mug to be cheaper. i hope this helped!