From a table of random numbers, two numbers are chosen at…
From a table of random numbers, two numbers are chosen at random. Let $A$ denote the event that (at least) one of these numbers is prime, and $B$ the event that (at least) one of them is even. What do the events $AB$ and $A+B$ represent?
Explanation of Method
The product $AB$ means "both $A$ and $B$ occur" and the sum $A+B$ means "at least one of $A$, $B$ occurs". We first sort all numbers into four types (prime or not, even or not); the number $2$ plays a special role because it is the only number that is both prime and even. Then we list exactly which pairs of numbers give $AB$, and we describe $A+B$ in the simplest way through its complement, using De Morgan's law $\overline{A+B}=\overline{A}\,\overline{B}$.
Step 1: Setup and the four types of numbers
Denote the two chosen numbers by $n_1$ and $n_2$. Numbers in a table of random numbers are non-negative integers $0,1,2,3,\dots$ Recall:
- A number is prime if it is greater than $1$ and its only divisors are $1$ and itself: $2,3,5,7,11,13,\dots$ The numbers $0$ and $1$ are not prime.
- A number is even if it is divisible by $2$: $0,2,4,6,8,\dots$
Every number belongs to exactly one of four types:
| Type | Prime? | Even? | Examples |
|---|---|---|---|
| even prime | yes | yes | $2$ (the only one) |
| odd prime | yes | no | $3,\ 5,\ 7,\ 11,\ 13,\dots$ |
| even non-prime | no | yes | $0,\ 4,\ 6,\ 8,\ 10,\dots$ |
| odd non-prime | no | no | $1,\ 9,\ 15,\ 21,\ 25,\dots$ |
Why is $2$ the only even prime? Any even number greater than $2$ is divisible by $2$, so it has a divisor other than $1$ and itself and cannot be prime.
The events are
\[ A = \{\text{at least one of } n_1, n_2 \text{ is prime}\}, \qquad B = \{\text{at least one of } n_1, n_2 \text{ is even}\}. \]
Step 2: The event $AB$
Definition
$AB = A\cap B$ occurs when both $A$ and $B$ occur: among the two numbers there is at least one prime and at least one even number.
Which pairs give $AB$?
The prime and the even number may be the same number or two different numbers. This gives exactly two cases:
- Case (a): one of the numbers is $2$. Then this single number is both prime and even, so $AB$ occurs whatever the other number is.
- Case (b): one number is an odd prime and the other is even. Then $A$ occurs thanks to the first number and $B$ occurs thanks to the second.
Why there are no other cases. Suppose $AB$ occurs. Take a prime $p$ among the two numbers.
- If $p$ is even, then $p=2$ — this is case (a).
- If $p$ is odd, then $p$ itself is not the even number, so the even number must be the other number — this is case (b).
So
\[ AB = \{\text{one of the numbers is } 2, \ \text{or one number is an odd prime and the other is even}\}. \]
Examples
| Pair $(n_1,n_2)$ | Prime present? | Even present? | $AB$ occurs? |
|---|---|---|---|
| $(2,\ 9)$ | yes ($2$) | yes ($2$) | ✓ case (a) |
| $(2,\ 7)$ | yes | yes ($2$) | ✓ case (a) |
| $(3,\ 8)$ | yes ($3$) | yes ($8$) | ✓ case (b) |
| $(3,\ 5)$ | yes | no | ✗ |
| $(4,\ 6)$ | no | yes | ✗ |
| $(1,\ 0)$ | no ($0$ and $1$ are not prime) | yes ($0$) | ✗ |
| $(9,\ 15)$ | no | no | ✗ |
Step 3: The event $A+B$
Definition
$A+B = A\cup B$ occurs when at least one of the events occurs: there is a prime among the numbers, or there is an even number among them (or both).
"Some number is prime, or some number is even" is the same as "some number is prime or even". So
\[ A+B = \{\text{at least one of the two numbers is prime or even}\}. \]
Describing it through the complement
It is often easier to say when an event does not happen. By De Morgan's law,
\[ \overline{A+B} = \overline{A}\;\overline{B}. \]
- $\overline{A}$ = "none of the numbers is prime";
- $\overline{B}$ = "none of the numbers is even" = "both numbers are odd".
Together: $\overline{A+B}$ = "both numbers are odd and non-prime", i.e. both come from the set $\{1, 9, 15, 21, 25, 27, \dots\}$. Hence
\[ A+B = \{\text{it is not true that both numbers are odd non-prime numbers}\}. \]
Examples
| Pair $(n_1,n_2)$ | Both odd and non-prime? | $A+B$ occurs? |
|---|---|---|
| $(3,\ 5)$ | no (both prime) | ✓ |
| $(4,\ 6)$ | no (both even) | ✓ |
| $(9,\ 4)$ | no ($4$ is even) | ✓ |
| $(9,\ 15)$ | yes | ✗ |
| $(1,\ 9)$ | yes ($1$ is not prime) | ✗ |
Note. Every pair in $AB$ is also in $A+B$, i.e. $AB\subseteq A+B$. This is always true: if both events occur, then certainly at least one of them occurs.
Result
| Event | Meaning |
|---|---|
| $AB$ | Among the two numbers there is a prime and an even number: one of the numbers is $2$, or one is an odd prime and the other is even. |
| $A+B$ | At least one of the two numbers is prime or even; equivalently, it is not true that both numbers are odd non-primes (such as $1, 9, 15, 21,\dots$). |