Remaining units towards a goal - M-Farag/micro-algorithms GitHub Wiki
Inputs:
- Algorithm expects three floats as params:[aimed_amount, accomplished_amount, progress_rate_per_unit]
- The aimed_amount param is the end goal you aim to accomplish one day.
- The accomplished_amount param is the float representation of the raw amount you have already accomplished towards your end goal.
- The progress_rate_per_unit param is the float representation of the repetitive throughput towards your end goal.
Outputs:
- Afloat number representing the remaining units towards your end goal.
Idea:
- This tiny algorithm is built on top of the algebraic fact of simple inequalities. ** Mathematical formula:**
aimed_amount: G
accomplished_amount: A
progress_rate_per_unit: P
Remaining units for the end goal: X
A + (P.X) >= G
X >= (G-A) / P
Example:
- You want to save 1000$
- You already saved 200$
- Your calculation/throughput/iteration is daily.
- You save 8$ per day.
So your aimed_amount = 1000, and the accomplished_amount = 200 and your progress_rate_per_unit = 8. You feed the algorithm with the previous data to find out that you still need about 100 days to accomplish your aimed goal.