We will determine the $4$ letters chosen by asking four questions:
- How many I's are there?
- How many M's are there?
- How many P's are there?
- How many S's are there?
We will represent the answers to these questions by $x_I, x_M, x_P$ and $x_S$ respectively*. What conditions do we have on these variables?
Since we have $4$ letters in total, we must have $x_I + x_M + x_P + x_S = 4$. Also, since each variable is counting something, it must be a non-negative integer. That is, $x_I, x_M, x_P, x_S \in \mathbb{Z}_{\ge 0}$.**
Stars and bars
Now there is a general method, often called the "stars and bars" argument, for counting the number of ways of writing a number as a sum of smaller numbers. In full generality, suppose we want to write some non-negative integer $n$ as a sum of $k$ non-negative integers; that is
$$ n = y_1 + y_2 + ... + y_k, $$
where $y_1, y_2, ..., y_k \in \mathbb{Z}_{\ge 0}$.
We will draw every such sum using stars and bars; there will be $n$ stars, and $k-1$ bars splitting the separate summands. $y_1$ will be the number of stars before the first bar, $y_2$ will be the number of stars between the first and second bar, and so on, until we get $y_k$ to be the number of stars after the last ($k-1$st) bar. For example, the sum $8 = 3 + 0 + 4 + 1$ would look like
$$ \underbrace{* * *}_{y_1 = 3} | \underbrace{}_{y_2 = 0} | \underbrace{* * * *}_{y_3 = 4} | \underbrace{*}_{y_4 = 1} \; .$$
One important thing to note is that we are counting ordered sums, so the order of the summands is important. For example, the sum $8 = 4 + 3 + 1 + 0$ has the different diagram
$$ \underbrace{* * * *}_{y_1 = 4} | \underbrace{* * *}_{y_2 = 3} | \underbrace{*}_{y_3 = 1} | \underbrace{}_{y_4 = 0} \; ,$$
which will be counted as a distinct solution.
How does this help us count the number of sums? Well, note that every such diagram is simply a permutation of $n$ stars and $k-1$ bars. Moreover, every such permutation corresponds to a different sum. Hence we only need to count these permutations of symbols.
Now there are a total of $n+k-1$ symbols in a line. If we choose $k-1$ of thoes symbols to be bars, that determines the diagram, since the remaining symbols must be stars. Hence the number of sums is
$$\binom{n+k-1}{k-1}.$$
Note that this is equal to $\binom{n+k-1}{n}$, since we could instead choose which $n$ symbols are stars.
"Going down to Mississippi"
Returning to the problem at hand, this means the number of solutions to $x_I + x_M + x_P + x_S = 4$ is $\binom{7}{3} = 35$.
However, while every set of $4$ letters corresponds to one such sum, not every sum comes from a valid choice of letters. Our final restriction comes from the law of conservation of mass, adapted for mathematical wordplay. We cannot select more copies of a letter than appear in the word "MISSISSIPPI".
This means that, along with our non-negativity assumption, we must also have $x_I \le 4, x_M \le 1, x_P \le 2$ and $x_S \le 4$.
Now note that since we are only selecting $4$ letters in total, we can never have $x_I \ge 5$ or $x_S \ge 5$, hence we can ignore those requirements. This leaves only the conditions $x_M \le 1$ and $x_P \le 2$.
Another very useful observation is that we cannot violate both of these conditions at the same time. Indeed, if we had both $x_M \ge 2$ and $x_P \ge 3$, then $x_I + x_M + x_P + x_S \ge 5$. Hence from the $35$ solutions to the sum we counted earlier, we can subtract the solutions with $x_M \ge 2$ and the solutions with $x_P \ge 3$. Since no solution satisfies both those bounds, every bad solution is subtracted exactly once, as it should be.
So how many solutions have $x_M \ge 2$? Well, a nice way to count these is to introduce a new variable, setting $z_M = x_M - 2$. We then have $x_I + z_M + x_P + x_S = x_I + x_M + x_P + x_S - 2 = 4 - 2 = 2$, with $x_I, z_M, x_P, x_S \in \mathbb{Z}_{\ge 0}$. Since we now only require all our variables to be non-negative, rather than having one being at least $2$, we have reduced this to the stars and bars setting. Using the formula, there are $\binom{2 + 3}{3} = \binom{5}{3}= 10$ such solutions.
What about $x_P \ge 3$? This time we set $z_P = x_P - 3$. A similar argument shows there are $\binom{1+3}{3} = \binom{4}{3} = 4$ solutions in this case.
Hence the final answer, that is, the number of selections of $4$ letters from "MISSISSIPPI", is
$$ \binom{7}{3} - \binom{5}{3} - \binom{4}{3} = 35 - 10 - 4 = 21. $$
Final remarks
In closing, let me remark that this is not that much shorter than the case analysis you suggested in your question (indeed, I would suspect that is how you were meant to solve the problem). However, it is always good to know different solutions, and with a longer word this may have proven to be a shortcut.
That being said, with a longer word, several further complications could have arisen. Here we got lucky in that there were only two kinds of bad solutions, and no solution was bad in both ways. In general, this correction would have involved the Inclusion-Exclusion Principle, which would provide an added level of difficulty.
The nice way to solve these problems in general is to use ordinary generating functions (or exponential generating functions if dealing with permutations), as suggested in @Beta's answer. These are a little more advanced, but very powerful and incredibly interesting, and you should hopefully encounter them in some combinatorics course at a later point.
Footnotes
*Why order the variables this way? In honour of Tyrion, of course!
**Some would call this set the naturals, denoted $\mathbb{N}$, but I prefer to have my naturals start from $1$.
First say if $A = 999 \cdots 999$, then $B = 2018 \cdot 9 = 18162$. And this $B$ has the max value possible given $A$ only has $2018$ digits and is divisible by $9$.
Notice if $B$ has $5$ digits, then $C$ at most can only be $35$ (e.g. $B = 17999 \Leftarrow A$ has $1999$ digits of $9$, $1$ digit of $8$ and $18$ digits of $0$), but not $36$ (e.g. $B = 18999$).
Next if $B$ has $4$ digits, then max of $B = 9999$ is possible when $A$ has $1111$ digits of $9$, other digits $0$, so $C = 36$. Quite clearly $37$ or above is impossible if we further reduce the value of $B$.
Also for $A$ to be a $2018$ digit no., $\min B = 9$ $(e.g. A = 10,000, \cdots ,008) \Rightarrow \min C = 9$.
Thus $C$ ranges from $9$ to $36$. The required sum is $45 \cdot 14 = 630$.
[Edit: I missed the fact that divisible by $9$ $\Leftrightarrow$ sum of digits must be multiples of $9$. Hence the required sum should be smaller than from $1$ to $36$.]
Best Answer
The correct answer should be 96 (of course, without duplicate arrangements). There are many ways to solve this problem.
Method 1. Start with arrangements of _ I _ N _ I _ U _ and place 3 Ms in 3 of 5 places. Then subtract arrangements where 2 I's are together
$$= \frac{4!}{2!} . \binom{5}{3} - 3!.\binom{4}{3}$$
Method 2. Start with arrangements of _ N _ U _ and place 2 I's in 2 of 3 places. This results in 4 letters and 5 adjacent places. Then place 3 M's in 3 of 5 places. Then add arrangements where I's are together. Place one M between two I's and 2 M's in 2 of resulting 4 places.
$$= 2!.\binom{3}{2}.\binom{5}{3} + 2!.\binom{3}{1}.\binom{4}{2}$$
Method 3. Start with arrangements of _ N _ U _ and place 3 M's in 3 places. This results in 5 letters and 6 adjacent places. Then place 2 I's in 2 of 6 places. Then add arrangements where 2 M's are together. Place the other M in 1 of 2 remaining places. Then place one I between two M's and other I in resulting 5 places. The last step will be to add arrangement where all M's are together. Place 2 I's between 3 M's to separate them.
$$= 2!.\binom{3}{3}.\binom{6}{2} + 2!.\binom{3}{1}.\binom{2}{1}.\binom{5}{1} + 2!.\binom{3}{1}$$