# Probability of damage problem

I'm encountering the following interesting math problem:

A device consists of 5 independently working blocks.

Each of them has a damage probability of 1/4. Upon damage of 1, 2 or 3 blocks, the probabilities for shutting the device down are respectively 1/5 , 2/5, 4/5.

If more blocks are damaged the device's probability of shutting down is 1 (100%). What is the expected number of damaged blocks? If the device has shut down, what is the probability exactly 2 blocks to be damaged?

What I tried: I tried combining the probabilities for the damaged probability blocks, and then dividing them, but I don't seem to do it properly.

I also thought of: P(A or B) = P(A) + P(B) - P(A and B), but still... to no avail.

Any idea how to proceed will be of use!

Since there are $$n = 5$$ blocks, and each block has a probability $$p =\frac{1}{4}$$ of being damaged, the expected number of damaged blocks $$d$$ equals:

$$d = n \cdot p = 5 \cdot \frac{1}{4} = \frac{5}{4}$$

Call $$X$$ the number of damaged blocks. Using the binomial distribution, we find:

$$P(X = 1) = {5 \choose 1} \left(\frac{1}{4}\right)^1 \left(\frac{3}{4}\right)^4 = 5 \cdot \frac{3^4}{4^5} \approx 0.3955$$

Call $$A$$ the event in which the device is being shut down. We find:

$$P(A, X = 1) = P(X = 1) P(A | X = 1) = 5 \cdot \frac{3^4}{4^5} \cdot \frac{1}{5} \approx 0.0791$$

Likewise, we can determine the probability of the device being shut down because exactly two, three, four or five blocks were damaged:

$$P(A, X = 2) = {5 \choose 2} \left(\frac{1}{4}\right)^2 \left(\frac{3}{4}\right)^3 \cdot \frac{2}{5} \approx 0.1055$$

$$P(A, X = 3) = {5 \choose 3} \left(\frac{1}{4}\right)^3 \left(\frac{3}{4}\right)^2 \cdot \frac{4}{5} \approx 0.0703$$

$$P(A, X = 4) = {5 \choose 4} \left(\frac{1}{4}\right)^4 \left(\frac{3}{4}\right)^1 \cdot 1 \approx 0.0146$$

$$P(A, X = 5) = {5 \choose 5} \left(\frac{1}{4}\right)^5 \left(\frac{3}{4}\right)^0 \cdot 1 \approx 0.0010$$

Given that the device has shut down, the probability of two blocks being damaged thus equals:

$$P(X = 2 | A) = \frac{P(A, X = 2)}{P(A)} = \frac{P(A, X = 2)}{P(A, X = 1) + P(A, X = 2) + P(A, X = 3) + P(A, X = 4) + P(A, X = 5)} \approx \frac{0.1055}{0.0791 + 0.1055 + 0.0703 + 0.0146 + 0.0010} \approx 0.3899$$

Hint 1. The number of damaged blocks follows a Binomial distribution with $$n=5$$ and $$p=\frac14$$

Hint 2. You need to calculate the conditional probability of 2 blocks damaged given that the device breaks down