document.write( "Question 1210171: Find the number of ways of placing three As, three Bs, and three Cs in a 3 \times 3 grid, so that every square contains one letter, and each diagonal contains one A, one B, and one C. \n" ); document.write( "
Algebra.Com's Answer #851444 by CPhill(1959)\"\" \"About 
You can put this solution on YOUR website!
We are asked to count the number of ways to place **three A's, three B's, and three C's** in a **3×3 grid** such that:\r
\n" ); document.write( "\n" ); document.write( "- Every square contains exactly one letter.
\n" ); document.write( "- Each **row** and **column** ends up with 3 letters total (since the grid is filled).
\n" ); document.write( "- **Each diagonal** (main and anti-diagonal) must contain exactly **one A, one B, and one C**.\r
\n" ); document.write( "\n" ); document.write( "---\r
\n" ); document.write( "\n" ); document.write( "### Step 1: Total number of arrangements without the diagonal condition\r
\n" ); document.write( "\n" ); document.write( "We need to place 3 A’s, 3 B’s, and 3 C’s into 9 positions. This is a classic **multinomial coefficient**:\r
\n" ); document.write( "\n" ); document.write( "\[
\n" ); document.write( "\frac{9!}{3! \cdot 3! \cdot 3!} = \frac{362880}{6 \cdot 6 \cdot 6} = \frac{362880}{216} = 1680
\n" ); document.write( "\]\r
\n" ); document.write( "\n" ); document.write( "So there are **1680** total ways to fill the grid with 3 A’s, 3 B’s, and 3 C’s.\r
\n" ); document.write( "\n" ); document.write( "---\r
\n" ); document.write( "\n" ); document.write( "### Step 2: Apply the diagonal condition\r
\n" ); document.write( "\n" ); document.write( "We must now count **only those** of the 1680 arrangements in which:\r
\n" ); document.write( "\n" ); document.write( "- The **main diagonal** (top-left to bottom-right) contains one A, one B, and one C.
\n" ); document.write( "- The **anti-diagonal** (top-right to bottom-left) also contains one A, one B, and one C.\r
\n" ); document.write( "\n" ); document.write( "Let’s define the positions in the grid like this:\r
\n" ); document.write( "\n" ); document.write( "```
\n" ); document.write( "(1,1) (1,2) (1,3)
\n" ); document.write( "(2,1) (2,2) (2,3)
\n" ); document.write( "(3,1) (3,2) (3,3)
\n" ); document.write( "```\r
\n" ); document.write( "\n" ); document.write( "The **main diagonal** is: (1,1), (2,2), (3,3)
\n" ); document.write( "The **anti-diagonal** is: (1,3), (2,2), (3,1)\r
\n" ); document.write( "\n" ); document.write( "Note that the **center square (2,2)** is on **both diagonals**.\r
\n" ); document.write( "\n" ); document.write( "---\r
\n" ); document.write( "\n" ); document.write( "So the union of the two diagonals has 5 distinct squares:\r
\n" ); document.write( "\n" ); document.write( "- Main: (1,1), (2,2), (3,3)
\n" ); document.write( "- Anti: (1,3), (2,2), (3,1)\r
\n" ); document.write( "\n" ); document.write( "=> Union: **(1,1), (2,2), (3,3), (1,3), (3,1)**\r
\n" ); document.write( "\n" ); document.write( "This gives us **5 positions**, with **(2,2)** counted once (in both diagonals).\r
\n" ); document.write( "\n" ); document.write( "---\r
\n" ); document.write( "\n" ); document.write( "We want these two diagonals (i.e., the five cells) to include:\r
\n" ); document.write( "\n" ); document.write( "- Each of A, B, and C **exactly once** in each diagonal.\r
\n" ); document.write( "\n" ); document.write( "Let’s approach it step by step.\r
\n" ); document.write( "\n" ); document.write( "---\r
\n" ); document.write( "\n" ); document.write( "### Step 3: Count the valid diagonal assignments\r
\n" ); document.write( "\n" ); document.write( "We'll now count the number of ways to assign letters to the **5 diagonal positions**, so that:\r
\n" ); document.write( "\n" ); document.write( "- (1,1), (2,2), (3,3) have one A, one B, one C (i.e., main diagonal is a permutation of A, B, C)
\n" ); document.write( "- (1,3), (2,2), (3,1) also have one A, one B, one C (anti-diagonal is a permutation of A, B, C)\r
\n" ); document.write( "\n" ); document.write( "Key insight: The **center** cell (2,2) is in **both** diagonals, so its letter is shared.\r
\n" ); document.write( "\n" ); document.write( "Let’s choose the letter for the **center cell (2,2)** first.\r
\n" ); document.write( "\n" ); document.write( "We have **3 choices**: A, B, or C.\r
\n" ); document.write( "\n" ); document.write( "For each such choice:\r
\n" ); document.write( "\n" ); document.write( "- The main diagonal now needs to use the other two letters (excluding the center), and arrange them in the remaining two diagonal spots: (1,1) and (3,3).
\n" ); document.write( "- Similarly, the anti-diagonal uses the same idea for (1,3) and (3,1).\r
\n" ); document.write( "\n" ); document.write( "So for each choice of letter at (2,2), the number of ways to assign letters to the rest of the diagonals is:\r
\n" ); document.write( "\n" ); document.write( "\[
\n" ); document.write( "(\text{ways to fill the other 2 positions in main diagonal}) \times (\text{ways to fill the other 2 in anti-diagonal}) = 2! \times 2! = 2 \times 2 = 4
\n" ); document.write( "\]\r
\n" ); document.write( "\n" ); document.write( "So total number of valid ways to fill the **5 diagonal squares** is:\r
\n" ); document.write( "\n" ); document.write( "\[
\n" ); document.write( "3 \text{ (choices for center)} \times 4 = 12
\n" ); document.write( "\]\r
\n" ); document.write( "\n" ); document.write( "---\r
\n" ); document.write( "\n" ); document.write( "### Step 4: Fill the remaining 4 squares\r
\n" ); document.write( "\n" ); document.write( "Now we’ve filled 5 of the 9 squares, each with one letter (from A, B, or C). We used 5 letters total, one per square.\r
\n" ); document.write( "\n" ); document.write( "So we have 4 squares left, and **we need to use up the remaining letters** so that each letter (A, B, C) appears exactly 3 times.\r
\n" ); document.write( "\n" ); document.write( "Let’s do the math:\r
\n" ); document.write( "\n" ); document.write( "We used:
\n" ); document.write( "- 1 A, 1 B, 1 C in each diagonal (so 2 of each total),
\n" ); document.write( "- But the center letter was **shared**, so total count so far is:\r
\n" ); document.write( "\n" ); document.write( " - The center letter appears once.
\n" ); document.write( " - The other two letters appear twice each (once in each diagonal).\r
\n" ); document.write( "\n" ); document.write( "Let’s break it down depending on the center letter. For example:\r
\n" ); document.write( "\n" ); document.write( "- Suppose the center is A.
\n" ); document.write( "- Then main diagonal: A (center), B, C → uses 1 B, 1 C
\n" ); document.write( "- Anti-diagonal: A (same center), B, C → uses another 1 B, 1 C\r
\n" ); document.write( "\n" ); document.write( "So we’ve placed:
\n" ); document.write( "- A: 1 time
\n" ); document.write( "- B: 2 times
\n" ); document.write( "- C: 2 times\r
\n" ); document.write( "\n" ); document.write( "So we have:
\n" ); document.write( "- 2 more A’s to place
\n" ); document.write( "- 1 more B
\n" ); document.write( "- 1 more C\r
\n" ); document.write( "\n" ); document.write( "Total of 4 letters to place in the 4 remaining squares.\r
\n" ); document.write( "\n" ); document.write( "This pattern is the same no matter what the center letter is — we always end up needing to place **2 of one letter** (the center one) and **1 of each of the other two**.\r
\n" ); document.write( "\n" ); document.write( "So for each of the 12 diagonal configurations, the remaining 4 letters to place are fixed, and we need to count the number of ways to assign them to the 4 leftover squares.\r
\n" ); document.write( "\n" ); document.write( "We are placing 4 letters: one letter appears twice, the others once each.\r
\n" ); document.write( "\n" ); document.write( "So the number of arrangements is:\r
\n" ); document.write( "\n" ); document.write( "\[
\n" ); document.write( "\frac{4!}{2! \cdot 1! \cdot 1!} = 12
\n" ); document.write( "\]\r
\n" ); document.write( "\n" ); document.write( "---\r
\n" ); document.write( "\n" ); document.write( "### Step 5: Multiply it all together\r
\n" ); document.write( "\n" ); document.write( "- 12 valid ways to assign letters to the 5 diagonal squares
\n" ); document.write( "- For each of those, 12 ways to fill the other 4 squares\r
\n" ); document.write( "\n" ); document.write( "So total number of valid arrangements is:\r
\n" ); document.write( "\n" ); document.write( "\[
\n" ); document.write( "12 \times 12 = \boxed{144}
\n" ); document.write( "\]\r
\n" ); document.write( "\n" ); document.write( "---\r
\n" ); document.write( "\n" ); document.write( "### ✅ Final Answer:\r
\n" ); document.write( "\n" ); document.write( "\[
\n" ); document.write( "\boxed{144}
\n" ); document.write( "\]
\n" ); document.write( "
\n" );