I'm looking for different ways to calculate payouts after I deposit some units.
Idea: There is a raffle for total of 1 000 000 000(TP). Everyone can deposit their Tickets(OT) (everyone has different amount of owned tickets) and at the end, I'll get the percentage of total tickets(TT) to deposited tickets(DT)
Example, someone deposited 1000 tickets, and I'm going to deposit 234:
$currentPricePerTicket = \frac{TP}{TT} = 1000000$ $TTafterMyDeposit = TT + DT = 1000 + 234 = 1234$ $pricePerTicketAfterDeposit = \frac{TP}{TTafterMyDeposit} = \frac{1000000000}{1234} = 810372.77$ $myPercentOfDeposited = DT \div \frac{TTafterMyDeposit}{100} = 234 \div \frac{1234}{100} = 18.96\%$ $iWillGet = TP \cdot myPercentOfDeposited = 1000000000 \cdot 18.96\% = 189 600 000$
This is what I'll get if nobody after me deposited their tickets.
This is pretty straight way to calculate. My main question, is there more "short" version to calculate the answer (189 600 000)?
Also, my second question: how do I invert this this? For example, if I want to get 249 365 000, how many tickets i should deposit?