Given an alphabet with 6 non-distinct integers, how many distinct 4-digit integers are there?

How many distinct four-digit integers can one make from the digits $1$, $3$, $3$, $7$, $7$ and $8$?

I can't really think how to get started with this, the only way I think might work would be to go through all the cases. For instance, two $3$'s and two $7$'s as one case, one $1$, two $3$'s and one $8$ as another. This seems a bit tedious though (especially for a larger alphabet) and so I'm here to ask if there's a better way.

Thanks.

• I don't see any other simpler method. – robjohn Jun 2 '12 at 7:58
• Thanks for the answer, you simplified it a bit from what I was thinking by focusing on the 7s and the 3s. Cheers. – urbanyoung Jun 2 '12 at 8:19

1 Answer

Distinct numbers with two $3$s and two $7$s: $\binom{4}{2}=6$.

Distinct numbers with two $3$s and one or fewer $7$s: $\binom{4}{2}3\cdot2=36$.

Distinct numbers with two $7$s and one or fewer $3$s: $\binom{4}{2}3\cdot2=36$.

Distinct numbers with one or fewer $7$s and one or fewer $3$s: $4\cdot3\cdot2\cdot1=24$.

Total: $6+36+36+24=102$

With larger alphabets,

Suppose there are $a$ numbers with 4 or more in the list, $b$ numbers with exactly 3 in the list, $c$ numbers with exactly 2 in the list, and $d$ numbers with exactly 1 in the list.

Distinct numbers with all 4 digits the same: $a$

Distinct numbers with 3 digits the same: $\binom{4}{3}(a+b)(a+b+c+d-1)$

Distinct numbers with 2 pairs of digits: $\binom{4}{2}\binom{a+b+c}{2}$

Distinct numbers with exactly 1 pair of digits: $\binom{4}{2}(a+b+c)\binom{a+b+c+d-1}{2}2!$

Distinct numbers with no pair of digits: $\binom{a+b+c+d}{4}4!$

Total: $a+4(a+b)(a+b+c+d-1)+6\binom{a+b+c}{2}+12(a+b+c)\binom{a+b+c+d-1}{2}+24\binom{a+b+c+d}{4}$

Apply to the previous case: $a=b=0$, $c=2$, and $d=2$:

$0+0+6\binom{2}{2}+12(2)\binom{3}{2}+24\binom{4}{4}=102$