In each problem, make sure tha
In each problem, make sure that you are clearly defining randomvariables, stating their distributions, and writing down theformulas that you are using. (That is, write down the pmf, writedown mean and variance formulas.
4. In the video game Dota 2, the character Phantom Assassin hasa 0.15 chance to land a critical hit with every attack. Assume thateach attack is independent from the previous attacks. (Theyactually aren’t, but we’ll simplify the problem by making thisassumption. See the end of assignment for an interesting discussionof the actual mechanics.) (Hint: Declare a single random variableto use for parts a through d, and a new random variable for parts eand f)
a. Suppose we start hitting a target. What is the probabilitythat we get the first critical hit on our third attack? What is theprobability that it takes more than 10 attacks to get a singlecritical hit?
b. How many attacks should a Phantom Assassin player expect tohave to perform before getting a critical hit? What is the standarddeviation?
c. It’s subjective to decide when our luck is ‘bad’, but acommon definition of an event being unlikely is that it hasprobability less than 0.05. By this definition, how many times dowe need to attack without getting a critical hit before we can saythat our luck was bad?
d. Suppose we attack 20 times without getting a single criticalhit. What is the probability that the next attack will be acritical hit? (Hint: Does the distribution remember that you’vefailed 20 times already? Does it care at all?)
e. Suppose Phantom Assassin attacks an enemy 30 times. What isthe probability that she gets at least 3 critical hits?
f. What is the expected number of critical hits after this manyattacks?
Answer:
a.
Let X be the number of attacks required to get the firstcritical hit. Then X ~ Geometric(p = 0.15). That is, X followsGeometric distribution with parameter p = 0.15
Probability that we get the first critical hit on our thirdattack = (1 – p)2 * p = (1 – 0.15)2 * 0.15 =0.108375
Probability that it takes more than 10 attacks to get a singlecritical 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 acritical hit before we can say that our luck was bad.
d.
Each attack is independent from the previous attacks. So, theprobability 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(Y3) = 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