Neil and Jean each choose a number at random from the set {1, 2, 3, 4, 5, 6, 7, 9, 10}; their numbers are allowed to be the same. What is the probability that the product of those two numbers is even?
In order for the product to be even, it can be an odd x even or even x even.
For the first case, odd x even, there are 5 choices for odd numbers and 4 choices for even numbers. So there are 20 ways the product is even.
For the second case, even x even, there are 4 choices for the first even number and 4 choices for the second even number. So there are 16 ways the product is even as well.
In total, there are 36 ways the product is even.
The total number of products is 9 * 9= 81.
So the probability that th product of the two numbers is even is 36/81=4/9.
Begin:o=0;e=0;listforeach(m, d=((1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 10, 10, 12, 12, 12, 12, 14, 14, 15, 15, 16, 18, 18, 18, 18, 20, 20, 20, 20, 21, 21, 24, 24, 25, 27, 27, 28, 28, 30, 30, 30, 30, 35, 35, 36, 36, 36, 40, 40, 42, 42, 45, 45, 49, 50, 50, 54, 54, 60, 60, 63, 63, 70, 70, 81, 90, 90, 100);
if(m%2==0,e=e+1, o=o+1);print"Even Num =",e; print"Odd Num =", o
OUTPUT:
Even products = 56
Odd products = 25
Probability =56 / 81