In: Statistics and Probability
In each problem, make sure that you are clearly defining random variables, stating their distributions, and writing down the formulas that you are using. (That is, write down the pmf, write down mean and variance formulas.
4. In the video game Dota 2, the character Phantom Assassin has a 0.15 chance to land a critical hit with every attack. Assume that each attack is independent from the previous attacks. (They actually aren’t, but we’ll simplify the problem by making this assumption. See the end of assignment for an interesting discussion of the actual mechanics.) (Hint: Declare a single random variable to use for parts a through d, and a new random variable for parts e and f)
a. Suppose we start hitting a target. What is the probability that we get the first critical hit on our third attack? What is the probability that it takes more than 10 attacks to get a single critical hit?
b. How many attacks should a Phantom Assassin player expect to have to perform before getting a critical hit? What is the standard deviation?
c. It’s subjective to decide when our luck is ‘bad’, but a common definition of an event being unlikely is that it has probability less than 0.05. By this definition, how many times do we need to attack without getting a critical hit before we can say that our luck was bad?
d. Suppose we attack 20 times without getting a single critical hit. What is the probability that the next attack will be a critical hit? (Hint: Does the distribution remember that you’ve failed 20 times already? Does it care at all?)
e. Suppose Phantom Assassin attacks an enemy 30 times. What is the probability that she gets at least 3 critical hits?
f. What is the expected number of critical hits after this many attacks?
a.
Let X be the number of attacks required to get the first critical hit. Then X ~ Geometric(p = 0.15). That is, X follows Geometric distribution with parameter p = 0.15
Probability that we get the first critical hit on our third attack = (1 - p)2 * p = (1 - 0.15)2 * 0.15 = 0.108375
Probability that it takes more than 10 attacks to get a single critical hit = P(X > 10) = (1 - p)10 = (1 - 0.15)10 = 0.19687
b.
Expected value of X = 1/p = 1/0.15 = 6.67
Standard deviation = = 6.146
c.
We need to find the minimum value of x such that
P(X > x) < 0.05
(1-p)x < 0.05
Taking log, we get
x * log(1 - 0.15) < log(0.05)
-0.1625 x < -2.996
=> x > 2.996 / 0.1625 = 18.437
So, we need to attack at least 19 times without getting a critical hit before we can say that our luck was bad.
d.
Each attack is independent from the previous attacks. So, the probability that the next attack will be a critical hit will be p = 0.15
e.
Let Y be the number of critical hits done in 30 attacks. Then Y ~ Binomial(n = 30, p = 0.15)
Probability that she gets at least 3 critical hits = P(Y 3) = 1 - P(Y < 3)
= 1 - [P(Y = 0) + P(Y = 0) + P(Y = 2) ]
= 1 - [30C0 * 0.150 * (1 - 0.15)30-0 + 30C1 * 0.151 * (1 - 0.15)30-1 + 30C2 * 0.152 * (1 - 0.15)30-2 ]
= 1 - (0.00763 + 0.0404 + 0.10337)
= 0.8486
f.
Expected number of critical hits after this many attacks = np = 30 * 0.15 = 4.5