Artificial intelligent assistant

Prove that no. of combinations of $p+q+r$ things wherein p be alike and q be alike and rest different is $(p+1)(q+1)2^r$ Prove that no. of combinations of $p+q+r$ things wherein p be alike and q be alike and rest different is $(p+1)(q+1)2^r$. I tried taking all the $p$ and $q$ objects as $2$ objects but couldn't come up with anything useful. Any help would be appreciated. Thank you.

I think this question is asking for the number of sub-multisets of the multiset $$\\{\overbrace{x,x,\ldots,x}^{p \text{ copies}}\\} \cup \\{\overbrace{y,y,\ldots,y}^{q \text{ copies}}\\} \cup \\{1,\ldots,r\\}.$$

To construct a sub-multiset:

* we choose anywhere from $0$ to $p$ copies of $x$,
* we choose anywhere from $0$ to $q$ copies of $y$, and
* we choose a subset of $\\{1,\ldots,r\\}$.



These are combined (multiset union) to give a sub-multiset of the original set.

Thus there's $p+1$ choices for the number of $x$'s, for each of which there are $q+1$ choices for the number of $y$'s, and for each of which there are $2^i$ choices for the subset of $\\{1,\ldots,r\\}$. Thus giving $$(p+1)(q+1)2^r$$ sub-multisets (or "combinations").

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy a84f83bf7237bb97ccdefd1dc755ed8f