Love those repeated digits

How many six digit integers contain exactly four different digits?


Try more combinatorics problems.


The answer is 294840.

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.

2 solutions

Discussions for this problem are now closed

Anna Anant
Jan 8, 2015

let the numbers be a,a,b,b,c,d there 10c4 ways to select the 4 numbers 4c2 ways to select the 2 to be repeated 6!/2!2! ways to arrange them gives 226,800

now, the other combination. let the numbers be a,a,a,b,c,d then, 10c4 * 4c1 * 6!/3! = 100,800

adding gives 327,600.

now, 10% of these start with 0 - a five digit number so 9/10 * 327600 = 294840

Brock Brown
Dec 27, 2014

Python brute force guess and check:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def distinct(x):
    found = set()
    for i in str(x):
        found.add(i)
    return len(found)
count = 0
i = 100000
while i < 1000000:
    if distinct(i) == 4:
        count += 1
    i += 1
print count

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...