How many ways to put n objects into n bins, with object i not in bin i for 1<=i<=n ??

185 Views Asked by At

How many ways are there to arrange n objects into n bins, subject to the n constraints that the ith object can't go in the ith bin for any 1 <= i <= n ? Each bin has to contain exactly one object.

1

There are 1 best solutions below

1
On

You do not state that each bin can only contain $1$ object, if this were so then the answer would be derangements (as JW comments)

Each of the $n$ objects can go into $n-1$ bins ... there are $\color{red}{(n-1)^n}$ ways to do this.