2852683

https://math.stackexchange.com/questions/2852683/how-many-subsets-of-size-k-from-1-2-n-such-that-if-subset-contains-2-it-doe

How many subsets of size k from {1,2,…n} such that if subset contains 2 it doesn't contain 1

answer 1
$$\binom nk-\binom{n-2}{k-2}.$$

"$$\{1,2\}\subseteq A$$" is false.

answer 2
"does not contain $$1$$ if it contains $2$" is the same as "does not contain $1$ or does not contain $2$".

Let $\mathcal S_1$ $\mathcal S_1$ denote the subcollection of subsets of $\{1,\dots,n\}$ having size k and such that $i\notin S$ for every $$S\in\mathcal S_i$$.

So actually $$\mathcal S_i:=\{S\in \wp (\{1,\dots,n\}) \mid i \notin S\wedge|S|=k\}$$

Then with inclusion/exclusion and symmetry we find:

$$|\mathcal S_1\cup \mathcal S_2|=|\mathcal S_1|+|\mathcal S_2|-|\mathcal S_1\cap \mathcal S_2|=2|\mathcal S_1|-|\mathcal S_1\cap \mathcal S_2|=2\binom{n-1}{k}-\binom{n-2}k$$

answer 3
Let $$E(A,X) =_{def} A.E'(X)$$ the species of sets of sort X that contains also one A.

then the species in the problem is:

$$E_kE_m(A,B,X) =A.B. (E_kE_m)''(X) = $$

$$E_k(A,B,X).E_m(X) + E_k( A,X).E_m( B,X) + E_k( B,X).E_m( A,X) + E_k(X).E_m(A,B,X)$$

The coefficient \frac{x^{n-2}}{(n-2)!} of the sum of the last three terms is the required number.

$$ \binom{n-2}{k-1} + \binom{n-2}{k-1} + \binom{n-2}{k} $$

Why do we have $$\binom nk$$ and $$\binom{n-1}k$$ as terms in the previous answers ? This is because the coefficient of \frac{x^{n-2}}{(n-2)!} in the e.g.f. of F" is the same with coeff  \frac{x^{n-1}}{(n-1)!} for F' and with  \frac{x^n}{n!} for F even we do not have isomorphisms.