document.write( "Question 1210200: A permutation of the numbers (1,2,3,\dots,n) is a rearrangement of the numbers in which each number appears exactly once. For example, (2,5,1,4,3) is a permutation of (1,2,3,4,5).\r
\n" ); document.write( "\n" ); document.write( " \r
\n" ); document.write( "\n" ); document.write( "Find the number of permutations (x_1, x_2, \dots, x_8) on (1, 2, 3, \dots, 8), such that (x_i, x_{i + 1}), 1 \le i \le 7, is never equal to (1,2), (3,4), (5,6), or (7,8). (However, (x_i, x_{i + 1}) can be equal to (2,1), (4,3), (6,5), or (8,7).)
\n" ); document.write( "

Algebra.Com's Answer #851556 by CPhill(1959)\"\" \"About 
You can put this solution on YOUR website!
Let's solve this problem using the Principle of Inclusion-Exclusion.\r
\n" ); document.write( "\n" ); document.write( "**1. Total Number of Permutations**\r
\n" ); document.write( "\n" ); document.write( "* The total number of permutations of (1, 2, 3, ..., 8) is 8! = 40320.\r
\n" ); document.write( "\n" ); document.write( "**2. Define the Sets**\r
\n" ); document.write( "\n" ); document.write( "Let:\r
\n" ); document.write( "\n" ); document.write( "* A₁ be the set of permutations where (1, 2) appears.
\n" ); document.write( "* A₂ be the set of permutations where (3, 4) appears.
\n" ); document.write( "* A₃ be the set of permutations where (5, 6) appears.
\n" ); document.write( "* A₄ be the set of permutations where (7, 8) appears.\r
\n" ); document.write( "\n" ); document.write( "We want to find |S \setminus (A₁ ∪ A₂ ∪ A₃ ∪ A₄)|, where S is the set of all permutations.\r
\n" ); document.write( "\n" ); document.write( "**3. Apply Inclusion-Exclusion Principle**\r
\n" ); document.write( "\n" ); document.write( "* |S| = 8!
\n" ); document.write( "* |Aᵢ| = 7! (treat (1, 2), (3, 4), (5, 6), (7, 8) as single units)
\n" ); document.write( "* |Aᵢ ∩ Aⱼ| = 6! (treat two pairs as single units)
\n" ); document.write( "* |Aᵢ ∩ Aⱼ ∩ A_k| = 5! (treat three pairs as single units)
\n" ); document.write( "* |A₁ ∩ A₂ ∩ A₃ ∩ A₄| = 4! (treat all four pairs as single units)\r
\n" ); document.write( "\n" ); document.write( "By the Principle of Inclusion-Exclusion:\r
\n" ); document.write( "\n" ); document.write( "|A₁ ∪ A₂ ∪ A₃ ∪ A₄| = Σ |Aᵢ| - Σ |Aᵢ ∩ Aⱼ| + Σ |Aᵢ ∩ Aⱼ ∩ A_k| - |A₁ ∩ A₂ ∩ A₃ ∩ A₄|\r
\n" ); document.write( "\n" ); document.write( "|A₁ ∪ A₂ ∪ A₃ ∪ A₄| = ⁴C₁ * 7! - ⁴C₂ * 6! + ⁴C₃ * 5! - ⁴C₄ * 4!\r
\n" ); document.write( "\n" ); document.write( "**4. Calculate the Values**\r
\n" ); document.write( "\n" ); document.write( "* 7! = 5040
\n" ); document.write( "* 6! = 720
\n" ); document.write( "* 5! = 120
\n" ); document.write( "* 4! = 24\r
\n" ); document.write( "\n" ); document.write( "|A₁ ∪ A₂ ∪ A₃ ∪ A₄| = 4 * 5040 - 6 * 720 + 4 * 120 - 1 * 24
\n" ); document.write( "|A₁ ∪ A₂ ∪ A₃ ∪ A₄| = 20160 - 4320 + 480 - 24
\n" ); document.write( "|A₁ ∪ A₂ ∪ A₃ ∪ A₄| = 16320 + 456
\n" ); document.write( "|A₁ ∪ A₂ ∪ A₃ ∪ A₄| = 16296\r
\n" ); document.write( "\n" ); document.write( "**5. Find the Desired Number of Permutations**\r
\n" ); document.write( "\n" ); document.write( "* Number of permutations = |S| - |A₁ ∪ A₂ ∪ A₃ ∪ A₄|
\n" ); document.write( "* Number of permutations = 8! - 16296
\n" ); document.write( "* Number of permutations = 40320 - 16296
\n" ); document.write( "* Number of permutations = 24024\r
\n" ); document.write( "\n" ); document.write( "**Therefore, there are 24024 permutations that satisfy the given conditions.**
\n" ); document.write( "
\n" ); document.write( "
\n" );