I thought of solving this question by making cases:
1) All four are same
2) 2 are same,2 are distinct
3) 3 are same ,1 is distinct
4) All are distinct
My difficulty is about how to select identical numbers
Like for case 2.How will I choose between-a,a,a, b,b, and c,c for 2 same numbers
Can somebody tell me about this
The five partitions of $4$ are
So, if you want to do it this way, you're still missing a case. It can be done this way though, with careful bookkeeping.
Partition 1+1+1+1: We must have
a,b,c, anddin some order: $4!=24$ ways.Partition 2+1+1: We have two copies of one letter from
a,b, orc, and choose two other letters to write uniquely, and once these letters are chosen we can write it in $4!/2$ ways (we divide by $2$ since if we count all $4!$ permutations, we count each twice when we swap the two identical letters): $3 \times \binom{3}{2} \times 4!/2=108$ ways.Partition 2+2: We choose two letters from
a,b, orc, and we can write them in $\binom{4}{2}$ ways: total $\binom{3}{2} \times \binom{4}{2}=18$ ways.Partition 3+1: We have three copies of one letter from
aorb, and choose one other letter to write uniquely, and once the letters are chosen, we can write it in $4$ ways: $2 \times \binom{3}{1} \times 4=24$ ways.Partition 4: We write
aaaa: $1$ way.Totaling: $$ 24+108+18+24+1=175 $$ ways.
We can check this by generating them with the GAP code:
And
Size(Q);returns175.