I will use the fundamental principle of counting to solve this question.
Given the set of numbers, $D = \{2, 2, 3, 3, 3, 4, 4, 4, 4\}$.
Here, count(2's) = 2, count(3's) = 3, count(4's) = 4.
We are required to construct 4-digit numbers greater than 3000. For easy visualisation, we will use dashes on paper, _ _ _ _.
Case 1: Thousandth's place is 3.
Set, $D' = \{2, 2, 3, 3, 4, 4, 4, 4\}$.
Rest of the 3 places can be filled in $3 \times 3 \times 3$ ways provided we have 3 counts of the three unique digits, for filling each of the 3 places. But count(2's) = 2, count(3's) = 2 in the new set. Deficiency for each digit is 1. (Impossible numbers - 3222, 3333).
Therefore, ways to fill = $3 \times 3 \times 3 - (1+1) = 25$.
Case 2: Thousandth's place is 4.
Set, $D' = \{2, 2, 3, 3, 3, 4, 4, 4\}$.
Similarly, the deficiency is of only digit 2, which is 1 count. (Impossible number - 4222)
Therefore ways to fill = $3 \times 3 \times 3 - 1 = 26$.
Summing each case up, we get $26 + 25 = 51$.
Hope this helps.
The objects you are counting may be placed into bijection with solutions to $$x_1+x_2+x_3+x_4+x_5=22$$
such that $0\le x_i\le 9$ and also $x_1\ge 1$. Via the substitution $x_1'=x_1-1$, we may instead solve $$x_1'+x_2+x_3+x_4+x_5=21$$ such that the variables are nonnegative integers, and also $x_1\le 8, x_i\le 9$ ($2\le i\le 5$).
Without the upper bound restriction, using stars and bars, there are ${26 \choose 22}$ solutions. Now we must consider the various upper bounds, using inclusion-exclusion. Let $A_1$ denote the set of solutions where $x_1'>8$, and $A_i$ denote the set of solutions where $x_i\ge 10$. By considering the substitution $x_1''=x_1-9\ge 0$, we have $$x_1''+x_2+x_3+x_4+x_5=12$$
Again using the stars-and-bars approach, we have $|A_1|={17\choose 13}$. If instead we want $x_2\ge 10$, we use the substitution $x_2'=x_2-10\ge 0$ and $$x_1'+x_2'+x_3+x_4+x_5=11$$ and so $|A_2|={16\choose 12}$. By symmetry, $|A_3|=|A_4|=|A_5|$.
To complete the problem, you also need to compute all the various $|A_1\cap A_2|$ and $|A_2\cap A_3|$, and then combine all the data using the inclusion-exclusion principle, which I leave for you as an exercise.
Best Answer
HINT:
How many $4$-digit numbers use only one digit?
How many pairs of digits are there?
If a $4$-digit number uses the digits $a$ and $b$, it must have one $a$ and three $b$’s, two of each, or three $a$’s and one $b$. How many $4$-digit numbers are there in each of those three categories?
Your answer will depend on whether leading zeros are allowed. If they are not allowed, so that you cannot count $0101$, for instance, then you’ll have to split the pairs into those that contain $0$ and those that don’t.