Created
March 25, 2022 01:12
-
-
Save AngleWyrm10/2d4a7d602cf1f94bcddbdc30a400b14e to your computer and use it in GitHub Desktop.
Given tries & confidence (1-risk), calculate success (1-failure)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Given tries & confidence (1-risk), calculate success (1-failure) | |
* failure = risk^(1/tries) | |
* success = 1 - (1-confidence)^(1/tries) | |
* @param tries before it's confidence% certain the loot has dropped | |
*/ | |
double calcDropChance(int tries){ | |
return 1.0 - Math.pow(1.0 - confidence, 1.0 / tries); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment