Skip to content

Instantly share code, notes, and snippets.

@AngleWyrm10
Created March 25, 2022 01:12
Show Gist options
  • Save AngleWyrm10/2d4a7d602cf1f94bcddbdc30a400b14e to your computer and use it in GitHub Desktop.
Save AngleWyrm10/2d4a7d602cf1f94bcddbdc30a400b14e to your computer and use it in GitHub Desktop.
Given tries & confidence (1-risk), calculate success (1-failure)
/**
* 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