We are given \( n \) white balls and \( n \) black balls, each marked \( 1, 2, 3, \ldots, n \). The problem asks for the number of ways to arrange these balls such that no two neighboring balls have the same color.
Step 1: Understanding the arrangement constraints
In order for neighboring balls to be of different colors, we must alternate between white and black balls. This means that there are two possible patterns for the arrangement: - White ball first: \( W, B, W, B, \ldots \) - Black ball first: \( B, W, B, W, \ldots \)
Step 2: Arranging the white and black balls
For both patterns, we need to arrange the \( n \) white balls and \( n \) black balls in the alternating positions. For each of the two possible color patterns, the white balls can be arranged in \( n! \) ways, and the black balls can also be arranged in \( n! \) ways. Thus, for each pattern, the total number of ways to arrange the balls is: \[ n! \times n! \]
Step 3: Considering both patterns
Since there are two possible patterns (white ball first or black ball first), we multiply the number of ways for one pattern by 2: \[ 2 \times (n!)^2 \]
\[ \boxed{2(n!)^2} \]