How do you determine the number of ways a computer can randomly generate an integer that is divisible by 4 from 1 through 12?

Jan 6, 2018

Probability: $\frac{1}{4}$
"Number of ways": $3$

Explanation:

The question is quite vague and unclear; there are two possible ways to interpret this question:

Assuming that you are asking for the number of possible integers that are divisible by 4 from 1 through 12, then there would be 3; 4, 8, and 12.

Assuming that you are asking for the probability that a computer will generate a number divisible by 4 if it randomly generates integers from 1 to 12 inclusive:

There are a total of 12 integers from 1 through 12. Three of these integers are divisible by 4: 4, 8, and 12.

Probability is measured as

$P = \setminus \frac{\setminus \textrm{\nu m b e r o f w a y s \to \ge t t h e s p e c \mathmr{if} i e d r e s \underline{t}}}{\setminus \textrm{\to t a l p o s s i b \le \nu m b e r o f r e s \underline{t} s}}$

Here, the specified result is "divisible by 4", and the number of ways to get a number divisible by 4 is 3. The total possible number of results is 12, since there are a total of 12 integers to choose from.

Hence, the probability of picking a number divisible by 4 is

$\frac{3}{12} = \frac{1}{4}$