What's the chance that you get a 1% drop in 100 tries?

That Richard

Official Terrarian
So, first of all, hello to this funny little post! And if you read only the first line of text. No I am not asking, I'm giving the exact answer to the question!

One time as I was farming a Nazar in the dungeon, I thought: "What's the chance that I get a X% chance item to drop in 100 / X tries? (Like you have 0.5% chance to get an item, you would think that in 200 tries you would get it 100% - but we all know that is not the answer haha).

Then I made a little C++ program to test it.
Well here's the program: https://pastebin.com/C9iUp1Nb (it is "truly" random so it doesn't just spit the same output every time) - had to post a new link, old one had a few quirks
You can paste it into an Online C++ Compiler (http://cpp.sh/ for example) and then just hit run. (It takes time to calculate because it does 1000000 runs of the "drop" code that would happen in game)
You then enter the % chance to get an item. (Different percentages give different answers, ofc!) Have fun with this.

To find the answer, just run the program so you actually have to do something :)
Do it like 2 to 4 times so you can see it outputs the almost same number every time.

If you found an error in my thinking, go ahead and tell me I wont resist, haha :D

If you want the math, it's right below this post!
 
Last edited:
I mean... if you want the exact math, it's:

1-(1-[probability that the item drops])^[number of enemies killed]

The math is basically like finding the probability that you will fail to get the 1% drop 100 times in a row (e.g. 99% to the power of 100) and subtracting it from 1, and the result is the probability that you'll get it within 100 tries. So in this case it works out to 63.4%.
 
I mean... if you want the exact math, it's:

1-(1-[probability that the item drops])^[number of enemies killed]

The math is basically like finding the probability that you will fail to get the 1% drop 100 times in a row (e.g. 99% to the power of 100) and subtracting it from 1, and the result is the probability that you'll get it within 100 tries. So in this case it works out to 63.4%.
Nice, didn't know that! :D
As I was writing the program, I was actually still farming the item. So wanted to do something haha :)

Thanks tho!
 
To elaborate on that, the chance of getting a drop of 1/x at least once within x kills starts at 0.75 (assuming x > 1; 1 - ((1 - 1/2) ^ 2) = 0.75) and then gradually approaches one minus the reciprocal of e (1/e = 0.368, so 1 - 1/e = 0.632). Essentially, if you have an item with a drop rate of 1/10 and an item with a drop rate of 1/100, you are more likely to get the first one within ten kills than the latter within 100, but that difference is quite small (in this case, only 1.8%) and, most importantly, isn't really a useful statistic. Its main value is that it's fun to know. ;)
 
the math that you gave, 1-(1-([drop chance]))^([number of enemies]), is for "x many enemies with the same drop chance will give a total chance of y" and that is useful, but I have another useful one: ln(1-[%chance in decimal (70% = .7 etc...)])/ln(1-[drop chance]) is how many enemies you need to kill to achieve a x percent chance of the item dropping.
 
the math that you gave, 1-(1-([drop chance]))^([number of enemies]), is for "x many enemies with the same drop chance will give a total chance of y" and that is useful, but I have another useful one: ln(1-[%chance in decimal (70% = .7 etc...)])/ln(1-[drop chance]) is how many enemies you need to kill to achieve a x percent chance of the item dropping.

Nice! :D
 
Back
Top Bottom