2

From Combinatorics by Mazur:enter image description here


I am trying this with $\{A,B,C,D\}$ but I am getting two answers. If I enumerate then I get $9$.

$ABCD,\ ABDC,\ ACBD,\ ACDB,\ ADBC,\ ADCB$

$BACD,\ BADC(1),\ BCAD,\ BCDA(2),\ BDAC(3),\ BDCA$

$CABD,\ CADB(4),\ CBAD,\ CBDA,\ CDAB(5),\ CDBA(6)$

$DABC(7),\ DACB,\ DBAC,\ DBCA,\ DCAB(8),\ DCBA(9)$


However,

$U=4!$

$$|f_A \cup f_B \cup f_C \cup f_D| = |f_A|+|f_B|+|f_C|+|f_D|-|f_A \cap f_B|-|f_A \cap f_C|-|f_A \cap f_D|-|f_B \cap f_C|-|f_B \cap f_D|-|f_C \cap f_D|+|f_A \cap f_B \cap f_C \cap f_D|$$

$$|f_A \cup f_B \cup f_C \cup f_D|=3!+3!+3!+3!-2!-2!-2!-2!-2!-2!+1=13$$

So, $$U-|f_A \cup f_B \cup f_C \cup f_D|=4!-13=11$$

What is wrong?

user5826
  • 11,982

2 Answers2

1

You skipped the terms with $3$ restrictions in the inclusion-exclusion sum. It should end with ${}+1!+1!+1!+1!-0!$ instead.

joriki
  • 238,052
0

Rather than spot your arithmetic error, perhaps it would help to see an easier derivation of a recursive formula for this number.

Let's denote the number of permutations of $n$ letters which fix no letter as $!n$.

Let's choose where to send $A$, say $A$ goes to $X$. Now $X$ has two options. If $X$ goes to $A$, then we have reduced to the problem of counting $!(n-2)$. If $X$ promises not choose $A$, then we have reduced to the problem of counting $!(n-1)$ (each of the $n-1$ letters have exactly one forbidden choice out of the remaining $n-1$ slots: $X$ has voluntarily forbidden himself to $A$, and the rest are forbidden their own slots).

So $!n=(n-1)(!(n-1)+!(n-2))$

To calculate $!4$ we get:

$!1=0$

$!2=1$

$!3=(3-1)(!(3-1)+!(3-2))=2$

$!4=(4-1)(!4-1)+!(4-2))=3(2+1)=9$

The function you are talking about is known as the subfactorial of $n$, commonly denoted $!n$, and what it counts are the derangements of $n$ letters.