Simulating an attack with a fixed number of shooters and targets, where a single random value yields the number of targets hit

51 Views Asked by At

There are A shooters and B targets. Each shooter picks one target at random and fires, and their probability of hitting the target is C. It is possible for two shooters to pick the same target. The objective is to find out the number of targets that will be hit with at least one bullet, which we will call Y.

A, B, and C are all fixed values.

X is a random number between 0 and 1, which has an equal probability of being each value.

What I need to find is a formula for Y, such that after solving the formula a large number of times (with a different value for X each time), the distribution of results will be the same as if the situation was simulated each time.

Sorry if there are standardized mathematical terms for these things that I'm not using. I come from the programming world and this question is designed for a simulation, but this is clearly more of a graphing and formula problem than a programming one.

1

There are 1 best solutions below

1
On

Warning: non-maths answer!

One option is to do a monte carlo simulation to find an approximate solution, and then encode that approximation into your simulation.

e.g. A=1, B=1, C=0.4

You simulate this ten times and generate three casualties and conclude that P(X=0)=0.7 and P(X=1)=0.3

This result is clearly incorrect but it is approximately correct.

Think carefully about why you need to reduce the calculation down to a single random number. Random numbers are typically "cheap" which implies that A and B are large... which implies that your current simulation/solution might not be appropriate. If A and B are large numbers then it might not be reasonable to assume a random distribution between targets. I'd question whether or not shots can be assumed to be independent events.