I'm trying to find how many times something has happened given a preset probability and a random number generator ran a specific number of times.
Basically, an equation that solves the following problem:
A number of treasure hunters (X) are searching for treasure. Any one of these treasure hunters has a 0.5% chance of finding treasure. Given a random number generated (y) how much treasure have they found (z)?
X will be given as an arbitrary number. Y will be given by a random number generator. I'm trying to solve for Z.
Basically, I'm writing a program. I know how many treasure hunters there are. What I need is the probability of one person finding treasure, two people finding treasure, three people finding treasure, four people finding treasure, etc all the way out to the chances of all 75 people finding treasure. I'm then going to compare that probability to a randomly generated number, Y, and with that find Z, how many people found treasure.
I want to try to find an equation that works whether I have 75 treasure hunters or 150.
"75 treasure hunters search for treasure. There is a 0.5% chance for one to find treasure. Write an equation that determines the probability of z people finding treasure, where z is a positive int between 0 and 75."
Rather than finding the number of people first, then the probability of that many people finding treasure, I want to take the probability that people find treasure and find how many people that probability equates to.
I've spent a few hours browsing various math websites and community answer boards like this one, trying to find equations for help with this, but I can't quite figure it out. Can someone help me out?