# Number of subsets $S$ of $Z$ that contains $m$ elements and also has the property that $S\bigcap X$ has $n$ elements.

Let $$X$$ and $$Y$$ be disjoint sets containing $$p$$ and $$q$$ elements respectively, and let the set $$Z$$ be defined as $$Z\bigcup Y$$. Find the number of subsets $$S$$ of $$Z$$ that contains $$m$$ elements and also has the property that $$S\bigcap X$$ has $$n$$ elements.

What I've tried is:

Total elements in $$Z$$ is $$p+q$$, so subsets containing $$m$$ elements is $$C(p+q,m)m!$$ where $$C$$ denotes combination.

How to include $$n$$ elements interesection ?

Thankyou

• Hint: first choose the $n$ elements of $S$ which are in $X$, and then choose the $m-n$ elements which are in $Y$. – Mike Earnest Feb 7 at 17:33

To construct such a subset, we must take $$n$$ elements fom $$X$$ and $$m-n$$ elements from $$Y$$, so the number of such subsets is
$$\binom{|X|}{n} \cdot \binom{|Y|}{m-n}$$