8. Cards and PIN codes. Once, a pickpocket named Brick ${ }^{1}$ stole a wallet, which contained four credit cards and a note with four PIN codes for these cards. Brick does not know which PIN code corresponds to which card. If the wrong PIN code is entered three times for any card, the card will be blocked.

a) (from 6th grade, 1 point). Show that Brick will be able to withdraw money from three cards if he acts correctly.

b) (from 7th grade, 2 points). What is the probability that Brick will be able to withdraw money from all four cards?

![](https://cdn.mathpix.com/cropped/2024_05_06_a933850cc044137d5d9dg-04.jpg?height=540&width=583&top_left_y=1923&top_left_x=1339)[^0]

## $\mathrm{XI}$ Internet Olympiad in Probability Theory and Statistics. Main (correspondence) round. $15.12 .77-21.01 .18$
Solution. a) Taking the first code and trying it on four cards in turn, Brick will find the card to which this code fits. Taking the second code and trying it on the three remaining cards, he will find the second match. Then - the third. Thus, he will find codes for three cards. The fourth one may turn out to be blocked.

b) Brick will not be able to find codes for all four cards only if he is extremely unlucky. If he managed to find a card for the first code only on the fourth attempt (the probability of this is $1 / 4$), then he has three codes and three cards left, but only two attempts for each card. If he managed to find a card for the second code only on the third attempt (the probability is $1 / 3$), then two codes and two cards are left. If he is unlucky again (the probability is $1 / 2$), then one of the remaining two cards will be blocked, and he will be able to find a code for the other. The probability of such a sequence of events is $\frac{1}{4} \cdot \frac{1}{3} \cdot \frac{1}{2}=\frac{1}{24}$. Therefore, the probability of the opposite event is $\frac{23}{24}$.

Answer: b) $\frac{23}{24}$.