1. In a computer program written in Turbo Pascal, the function $\operatorname{Random}(x)$ is used, generating integer random numbers from 1 to $x$. What is the probability that when this function is executed, a number divisible by 5 will appear if $x=100?$
Solution. Let's denote the event: $A$ - a number divisible by 5 will appear when $x=100$. We will find the probability of event $A$ by applying formula (1).

When $x=100$, any of the 100 existing integers can appear, so the total number of outcomes of the trial is $n=100$.

To find the number of outcomes of the trial favorable to event $A$, we will use the divisibility rule for numbers by 5. Numbers that end in the digits 0 or 5 are divisible by 5. Among the 100 integers, there are 20 such numbers; therefore, the number of outcomes of the trial favorable to event $A$ is $m=20$.

$$
\text { The probability of event } A \text { is } P(A)=\frac{m}{n}=\frac{20}{100}=0.2 \text {. }
$$