Closed VladFurman closed 10 months ago
Avoid a loop by using logarithms to calculate exact day training happens.
getProbUpgradeAfterDay = dailyFail^days
dailyFail = 1 - dailyUpgradeChance : math, static based on age, attribue, power does not change over days
dailyFail^days = standard probability (static probability each day)
chance = dailyFail^days log chance = days * log dailyFail log chance / log dailyFail = days
Very cool simplification.
Avoid a loop by using logarithms to calculate exact day training happens.
getProbUpgradeAfterDay = dailyFail^days
dailyFail = 1 - dailyUpgradeChance : math, static based on age, attribue, power does not change over days
dailyFail^days = standard probability (static probability each day)
chance = dailyFail^days log chance = days * log dailyFail log chance / log dailyFail = days