4. Code Lock. Petya approaches the entrance door with a code lock, on which buttons with digits from 0 to 9 are located. To open the door, he needs to press three correct buttons simultaneously. Petya doesn't remember the code and tries combinations one by one. For each attempt, Petya spends 2 seconds.

a) (6th grade. 1 point). How much time will Petya need to definitely get into the entrance?

b) (6th grade. 1 point). On average, how much time will Petya need?

c) (6th grade. 1 point). What is the probability that Petya will get into the entrance in less than one minute?
Solution: a) The total number of possible combinations of three digits is $C_{10}^{3}=\frac{10 \cdot 9 \cdot 8}{2 \cdot 3}=120$. Therefore, Petya will spend $120 \cdot 2=240$ seconds, which is 4 minutes.

b) In the best case, Petya will need exactly 1 attempt, and in the worst case, all 120. Since all combinations are equally likely, on average Petya will need $\frac{120+1}{2}=60.5$ attempts, which is 121 seconds.

c) To enter the building in less than a minute, Petya must succeed in no more than 29 attempts. The probability of this is $\frac{29}{120}$.

Answer: a) 4 minutes; b) 2 minutes 1 second; c) $\frac{29}{120}$.