[Math] Hitting a Target

probability

If the probability of hitting a target is $1/5$, and 10 shots are fired independently, what is the probability of the target being hit at least twice?

Let $X$ be the number of times the target is hit. We want to find $P(X \geq 2)$. So $$P(X \geq 2) = 1-P(X < 2)$$

$$ = 1- \binom{10}{0} (0.2)^{0} (0.8)^{10}-\binom{10}{1} (0.2)^{1}(0.8)^{9}$$

Would that be correct?

Thanks

Best Answer

One way to check theory is to simulate the problem. The code snippet below (using Octave) gives the empirical value of $0.62980$ which is comparable to the answer you have: $0.62419$ (See computation at Wolfram Alpha).

Of course, simulations like the one below are no guarantee that your theoretical answer is correct. However, at the very least they can help rule out incorrect answers and serve as a secondary check to your theoretical analysis.

function ev = ProbEst()

# Probability of hit is 1/5
probHit = 1/5;

totalIter = 10000;
noShots = 10;

# Counter to track if the event of interest
# has occurred 
eventOccurred = 0;

# Set seed of random number generator
rand("state",[11;22;3209;42038021;11]);

for iter =1:totalIter
    targetHit = 0;
    for shot = 1:noShots
        if (rand(1,1) < probHit)
            targetHit += 1;
        endif
    endfor 
    if (targetHit >= 2)  
        eventOccurred += 1;
    endif
endfor

# Output empirical probability to console
eventOccurred/totalIter

endfunction