Choose a Number

Six people choose a whole number from the range 1 to 10 (inclusive) independently and randomly. What is the probability that there will be two matching numbers and four non-matching numbers?

Example: 6, 2, 7, 4, 6, 10 works

Example: 2, 7, 1, 4, 4, 1 doesn't work

Example: 6, 2, 7, 3, 7, 7 doesn't work

Write your answer as a percentage.


The answer is 45.36.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Jesse Li
Jun 19, 2019

Let's suppose that the second and first person choose the same number and the others choose different numbers.

The probability of that happening is 1 10 × 9 10 × 8 10 × 7 10 × 6 10 \frac{1}{10}\times\frac{9}{10}\times\frac{8}{10}\times\frac{7}{10}\times\frac{6}{10} because the second person has a 1 10 \frac{1}{10} chance of choosing the same number as the first person, the third person has a 9 10 \frac{9}{10} chance of choosing a number different from the first two people, and so on.

However, there are ( 6 2 ) = 15 {6 \choose 2} =15 ways of choosing the two people whose numbers match, so we must multiply the answer we got, 0.03024, by 15, to get 0.4536, which is 45.36 \boxed{45.36} as a percentage.

The "counting" version of this (if yours is the probability version) is to say there are 1 0 6 10^6 possible choices altogether, of which ( 6 2 ) × ( 10 1 ) × ( 9 4 ) × 4 ! = 15 × 10 × 126 × 24 = 453600 {6 \choose 2} \times {10 \choose 1} \times {9 \choose 4} \times 4! = 15 \times 10 \times 126 \times 24 = 453600 meet the criterion. This comes from ( 6 2 ) {6 \choose 2} ways to pick two people with the same number, ( 10 1 ) {10 \choose 1} choices of what that number is, ( 9 4 ) {9 \choose 4} ways to pick four other numbers, and 4 ! 4! ways to assign them to the remaining four people. (I'm not posting this as a separate solution because it isn't, really, but it gives a slightly different way of looking at it.)

Chris Lewis - 1 year, 11 months ago
David Stiff
Jun 19, 2019

Or in Python!

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import random

def run_test(iterations):
    print('Running', iterations, 'tests...')
    test_results = []

    for test in range(iterations):
        choices = [random.randint(1, 10) for i in range(6)]
        numbers = set(choices)

        count_list = []
        for number in numbers:
            number_count = len([True for choice in choices if choice == number])
            count_list.append(number_count)

        pair_count = len([count for count in count_list if count == 2])

        if pair_count == 1:
            test_results.append(True)
        else:
            test_results.append(False)

    return test_results

# Modify the number here in run_test() to try a greater number of trials
# I wouldn't recommend going too far over 1,000,000 or else the interpreter will run out of execution time :)
test_results = run_test(1000000)

true_count = len([i for i in test_results if i == True])
false_count = len([i for i in test_results if i == False])
total = true_count + false_count

probability = true_count/total

print('Permissable:', true_count)
print('Not permissable:', false_count)
print('The probability then of obtaining a permissable set is:', probability)

Kyle T
Jun 19, 2019

More of a brute force solution, but the clever thing here is we're looking for cases where we have 5 distinct numbers out of the 6 that we've chosen

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
$s = 0;
$t=0;
for($a=1;$a<=10;$a++){
    for($b=1;$b<=10;$b++){
        for($c=1;$c<=10;$c++){
            for($d=1;$d<=10;$d++){
                for($e=1;$e<=10;$e++){
                    for($f=1;$f<=10;$f++){
                        if(count(array_unique(array($a,$b,$c,$d,$e,$f)))==5){
                            $s++;
                        }
                        $t++;
                    }
                }
            }
        }
    }
}
echo 100*($s/$t); //45.36
?>

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...