5

If I have the numbers $0,1,2,3,4,5,6,7,8,9$ written down in that order, how many ways can the $10$ digits be written down so that no even digit is in its original position?

It would seem that I can move rewrite it starting from $0$ in $9!$ ways, and same with $2,4,6,8$, hence the answer is $5*9!=1814400$ is this correct?

Tony
  • 568
  • 2
    What about all the ways you can place the odd digits? – Null Aug 28 '14 at 14:44
  • @Null Sorry I meant that no even digit can be in original position – Tony Aug 28 '14 at 14:54
  • Yes, I know. But once you've chosen the places for the 5 even digits you can arrange the 5 odd digits in multiple places. For example:

    9 0 1 2 3 4 5 6 7 8

    is one arrangement that works but

    7 0 1 2 3 4 5 6 9 8

    also works. The two sequences are identical, except that I swapped the 7 and the 9. You aren't counting these two cases.

    – Null Aug 28 '14 at 14:57
  • @Null I think I am, I have my evens avoid their homes, and then the rest get arranged by the factorials? – Tony Aug 28 '14 at 15:13
  • The factorials are arranging the 5 even digits but you need to arrange the 5 odd digits as well. Once you have arranged the even digits there are 5 places to put the 1, 4 places to put the 3, 3 places to put the 5, etc.

    Even so, I think you may be double counting some of the even digit placements. For example, if you place the 0 where the 2 was then you can place the 2 in any of the 9 remaining places. But if you place it elsewhere you can only place the 2 in 8 places -- not where the 0 is and not in its original place.

    – Null Aug 28 '14 at 15:22

4 Answers4

6

As suggested by Robert Israel, here is a solution using Inclusion-Exclusion:

Let S be the set of all arrangements of the digits, and for $1\le i\le5$

let $A_i$ be the set of arrangements with the $i$th even digit in its original position.

Then $|{A_1}^{c}\cap \cdots \cap {A_5}^{c}|=|S|-\sum|A_i|+\sum|A_i\cap A_j|-\sum|A_i\cap A_j\cap A_k|+\cdots$

$=10!-\binom{5}{1}9!+\binom{5}{2}8!-\binom{5}{3}7!+\binom{5}{4}6!-\binom{5}{5}5!=2,170,680.$

user84413
  • 27,211
4

Let $r(m,n)$ be the number of ways of placing $m$ objects, with $n$ of them constrained not to go in a particular position, where the $n$ particular positions are all different. Then we have $r(m,0)=m!$ (obviously), $r(m,1)=(m-1)(m-1)!$ (because we may place the constrained object in $m-1$ ways, and then the remainder unconstrained), and $$r(m,n)=(n-1)r(m-1,n-2)+(m-n)r(m-1,n-1)$$ We may place a constrained object in a place blocked to another object ($n-1$ possibilities), then the remainder in $r(m-1,n-2)$ ways, or we can place it in one of the places where any object may go and the remainder can then be placed in $r(m-1,n-1)$ ways. Calculating, we get $r(10,5)=2170680$.

almagest
  • 18,380
  • This idea is similar to the recurrence relation of the number of derangements where it split cases based on the choice of the person whose position is taken by the 1st person. Here we split cases based directly on the 1st person's choice. Here when "a constrained object in a place blocked to another object", assume it is in the place of $k$th object, then $k$th object becomes unconstrained , so $r(m-1,n-2)$. – An5Drama Dec 31 '23 at 03:12
3

Hint: Inclusion-exclusion principle. For a set of $k$ even digits, how many permutations are there where those digits are in their original positions?

Robert Israel
  • 448,999
0

We can also solve with this problem based on "Probability that exactly k of N people matched their hats" where "(hat,person)" is here "(position,digit)" although it takes some time to understand the calculation of this probability.

Then we can split into cases where exactly $5+k,0\le k\le 10-5$ digits including even digits are not in theirs original positions.

So the equation is $$ \sum_{k=0}^{m=N-5=10-5=5}N!\binom{m}{k}\frac{P_{N-k}}{P_{k}^N} $$ Here $k$ is the number of digits which are in theirs original positions , $N!$ is due to that we are to calculate permutation number instead of probability and $\binom{m}{k}$ is due to that we are caring about all possible non-matching cases instead of only one specific non-matching case.

After some calculation, the result is same as other answers.

An5Drama
  • 166