Combinatorics: Count the number of set partitions into groupings of a certain size I have 10 items in a set: $S = \lbrace a,b,c,d,e,f,g,h,i,j\rbrace$. 
I would like to calculate the number of set partitions, where for each set partition $S$, for all subsets $x\in S$, $2\le  |x| \le 3$. 
I see the Bell Equations, and that I can write: 
$$
{10\choose3}*B_3 + {10\choose2}*B_2 
$$
But I can think of reasons why this might be too small of a number, and realize that I haven't actually used the whole Bell Equation (which is making me suspicious that I am doing something wrong). 
How many such set partitions are there (and how do I calculate it)? 
 A: Here is an approach based upon generating functions. The following  can be found in section II.3.1 in Analytic combinatorics by P. Flajolet and R. Sedgewick:

The class $S^{(A,B)}$ of set partitions with block sizes in $A\subseteq \mathbb{Z}_{\geq 1}$ and with a number of blocks that belongs to $B$ has exponential generating function
\begin{align*}
S^{(A,B)}(z)=\beta(\alpha(z))\qquad\text{where}\qquad \alpha(z)=\sum_{a\in A}\frac{z^a}{a!},\quad \beta(z)=\sum_{b\in B}\frac{z^b}{b!}\tag{1}
\end{align*}

In the current situation we are looking for subsets $x\in S$ with size $2\le |x| \le 3$ and set
\begin{align*}
A=\{2,3\}\qquad\text{where}\qquad\alpha(z)=\frac{z^2}{2!}+\frac{z^3}{3!}
\end{align*}
accordingly. Since there is no restriction to the number of partitions we have
\begin{align*}
B={\mathbb{Z}}\qquad\text{where}\qquad \beta(z)=\sum_{j=0}^\infty \frac{z^n}{n!}=\exp(z)
\end{align*}
The resulting generating function is according to (1)
\begin{align*}
\beta(\alpha(z))=\exp\left(\frac{z^2}{2!}+\frac{z^3}{3!}\right)\tag{2}
\end{align*}

Since there are $10$ items in $S$, we are looking for the coefficient $[z^{10}]$ in (2) and calculate
  \begin{align*}
\color{blue}{10![z^{10}]\exp\left(\frac{z^2}{2!}+\frac{z^3}{3!}\right)}
&=10![z^{10}]\sum_{n=0}^\infty\frac{1}{n!} \left(\frac{z^2}{2!}+\frac{z^3}{3!}\right)^n\\
&=10!\sum_{n=0}^5\frac{1}{n!2^n}[z^{10-2n}]\left(1+\frac{1}{3}z\right)^n\tag{3}\\
&=10!\sum_{n=0}^5\frac{1}{n!2^n}\binom{n}{10-2n}\frac{1}{3^{10-2n}}\tag{4}\\
&=10!\left(\frac{1}{4!2^4}\binom{4}{2}\frac{1}{9}+\frac{1}{5!2^5}\binom{5}{0}\frac{1}{1}\right)\tag{5}\\
&=6300+945\\
&\color{blue}{=7245}
\end{align*}

Comment:


*

*In (3) we factor out $\frac{z^{2n}}{2^n}$. We use the linearity of the coefficient of operator and apply the rule $[z^{p-q}]A(z)=[z^p]z^qA(z)$. We also set the upper limit of the series to $5$ since the exponent of $z^{10-2n}$ is non-negative.

*In (4) we select the coefficient of $z^{10-2n}$.

*In (5) we observe that only two summands provide non-zero contributions, since $\binom{p}{q}=0$ if $q>p$.
A: To partition $S$ into five pairs, you have ${10 \choose 2}$ ways to choose the first pair, ${8 \choose 2}$ ways to choose the second and so on.  This would give $\frac {10!}{(2!)^5}$ ways but we probably don't care which order we chose the pairs.  The pairs can come out in $5!$ different ways, so there are $\frac {10!}{(2!)^55!}=945$  
Similarly, for two partitions of $3$ and two of two we have $10 \choose 3$ways to choose the first set of three, $7 \choose 3$ for the second, and $4 \choose 2$ for the first set of two.  Then there are two pairs we can swap in order, so we get $\frac {10!}{(3!)^2(2!)^2(2!)^2}=6300$  
There are a total of $7245$ partitions as you desire.
A: Under the given rules, there can either be one of two possible outcomes: 


*

*Five partitions of $S$ where each partition has $2$ elements

*Four partitions of S where two partitions have $3$ elements and two partitions have $2$ elements. 


In the first case, we have $\frac{1}{5!}\binom{10}{2}\binom{8}{2}\binom{6}{2}\binom{4}{2}$ different partitions. In the second case we have $\frac{1}{(2!)^2}\binom{10}{3}\binom{7}{3}\binom{4}{2}$ different partitions. So together we have $\frac{1}{5!}\binom{10}{2}\binom{8}{2}\binom{6}{2}\binom{4}{2} + \frac{1}{(2!)^2}\binom{10}{3}\binom{7}{3}\binom{4}{2}$  partitions. 
