Given set $D=\{0,1,2,3\}$ and a set $C$ of $n$ elements how many $3$-tuples of type $(C_1, C_2, C_3)$ can be found such that $C_1, C_2, C_3$ are non-empty, disjoint subsets of $C$.
Hint: To each $3$-tuple $(C_1, C_2, C_3)$ assign a function $g$ from $C$ to $D$ such that $g(x) = i$ if $x\in C_i$ where $1\le i\le 3$ and $g(x) =0$ otherwise.
When I think about the problem I think about making 3 non-empty partitions within $C$ and then permuting the partitioned subsets. There're: $$ {3-1+n\choose n}={n+2 \choose n} $$ possibilities to partition $C$ into $3$ partitions without the restriction that $C_i: |C_i|\ge1$. With the restriction there're: $$ {3-1+n-3\choose n-3}={n-1 \choose n-3} $$ subsets of $C$.
Because the subsets are elements of an ordered $3$-tuple we need to permute them, so the final answer is: $$ {n-1 \choose n-3}\cdot 3! $$
I'm not sure if I'm on the right track and if I am why do we need that hint about assigning functions.
Once the function $g$ is defined, we can define the subset $C_i$ as $g^{-1}(i)$ for $i=1,2,3$ and we get a 3-tuple of disjoint subsets. Thus we need to count the number of ways of assigning the integers $0,1,2,3$ to the $n$ elements of $C$ such that we assign each of $1, 2, 3$ to at least one element of $C$. This can be done using the Principle of Inclusion Exclusion.
The total number of ways of assigning $0,1,2,3$ is $4^n$. Of these, in $3^n$ of these, 1 is missing, $3^n$ of these 2 is missing and in $3^n$ of these, 3 will be missing. Similarly 2 of $0,1,2,3$ will be missing in $2^n$ and all three will be missing in 1 of the assignments. Thus the required number of functions $g$ is $$4^n - \binom{3}{1}3^n + \binom{3}{2}2^n - \binom{3}{3}1^n$$