Let $X = \{1, 2, 3\}$, and let $S = \{(a,b,c,d): a,b,c,d \in X, \text{and each element in X appears at least once in a,b,c, or d}\}$. How can I find $|S|$?
In other words, if I have a set $X$, and a set $S$ of 4-ary sequences over $X$, and in each sequence all elements in $X$ appears at least once, how do I count the sequences in $S$? How can I count similar sequences of different lengths?