How many permutations of $\{1,2,3,...,n\}$ are there with no 2 consecutive numbers?
For example:
$n=4$, $2143$, $3214$, $1324$ are the permutations we look for and $1234$, $1243$, $2134$ are what we DON'T look for.
My solution:
we will sub from all the permutations the bads. All permutations= $n!$
bads:
Lets define $A_i$ to be a group of all permutations containing $i,i+1$ in it. ($1\leq i\leq n-1$)
My problem is to count to group of :$|A_i \cap A_j|$ where $1 \leq i < j \leq n-1$.
Because there is a big difference between $A_i \cap A_{i+1}$ and $A_i \cap A_{i+5}$ (for instance), we can't say that both are the same. So we need to divide $|A_i \cap A_j|$ to 2 options.
- when $i+1 = j$ then $|A_i \cap A_j|=(n-2)!$
- when $i+1 < j$ then $|A_i \cap A_j|=(n-2)!$
So $|A_i \cap A_j|=(n-2)!+(n-2)!$
This is a big mistake but I have no clue why.
(the rest of the solution is the same).
Any help would be welcome.
Stav
If, as appears to be the case, you’re planning to use an inclusion-exclusion argument, you’ll need $\left|\bigcap_{k\in I}A_k\right|$ for every non-empty $I\subseteq[n-1]$. The trick is to realize that no matter how the integers in $I$ are spaced, the cardinality is going to be the same. When $|I|=2$, the case that you’re discussing in the question, there are two possibilities: the two members of $I$ are consecutive, or they are not. But in both cases it turns out that the cardinality of the intersection is $(n-2)!$: there are different calculations for the two cases, but they lead to the same result. Note that there is no reason at all to add these calculations: no $I$ belongs to both cases.
The set $I$ can be divided into blocks of consecutive integers. For example, $I=\{2,3,5,6,7,9\}$ has $3$ blocks: $\{2,3\},\{5,6,7\}$, and $\{9\}$. Suppose that $I$ has a block $\{k,k+1,\ldots,k+r\}$. Then every permutation in $\bigcap_{k\in I}A_k$ must contain the subsequence $\langle k,k+1,\ldots,k+r,k+r+1\rangle$; call this an extended block. If $I$ has $b$ blocks altogether, each permutation of $[n]$ that belongs to $\bigcap_{k\in I}A_k$ must contain all $b$ extended blocks as subsequences, but it can contain them in any order. Those extended blocks contain altogether $|I|+b$ integers: the blocks themselves contain $|I|$ integers, and each extended block has one extra integer on the righthand end. That leaves $n-|I|-b$ members of $[n]$ that can be permuted arbitrarily, because they aren’t in any extended block of $I$. Thus, the permutations in $\bigcap_{k\in I}A_k$ are really permutations of
$$b+(n-|I|-b)=n-|I|$$
things: $b$ extended blocks, and the $n-|I|-b$ single elements that are not part of any extended block. It follows that
$$\left|\bigcap_{k\in I}A_k\right|=(n-|I|)!$$
whenever $\varnothing\ne I\subseteq[n-1]$.
Now the inclusion-exclusion principle tells you that
$$\begin{align*} \left|\bigcup_{k\in[n-1]}A_k\right|&=\sum_{\varnothing\ne I\subseteq[n-1]}(-1)^{|I|-1}\left|\bigcap_{k\in I}A_k\right|\\ &=\sum_{\varnothing\ne I\subseteq[n-1]}(-1)^{|I|-1}(n-|I|)!\\ &=\sum_{k=1}^{n-1}\binom{n-1}k(-1)^{k-1}(n-k)!\;, \end{align*}$$
and I’ll leave the rest for you to finish off.