π 8 Queens Problem
1.Row 3 blocked entirely. Column 5 blocked entirely. Diagonals: all squares (r,c) where |rβ3|=|cβ5| are blocked β i.e. both main diagonals through (3,5).
2.Columns: 2,4,1,3 β all distinct β. Diagonals: |1β2|=1β |2β4|=2 β; |1β3|=2β |2β1|=1 β; |1β4|=3β |2β3|=1 β; |2β3|=1β |4β1|=3 β; |2β4|=2β |4β3|=1 β; |3β4|=1β |1β3|=2 β. Valid solution.
3.A queen attacks its entire row and column. Placing two queens in the same row or column would make them attack each other immediately β so each must occupy a unique row and a unique column.
4.8! = 40,320 permutations.
5.12 fundamentally distinct solutions (92 Γ· 8 symmetries, accounting for reflections and rotations; one solution is symmetric so the exact count is 12).
6.Accept any valid 8Γ8 arrangement. One example: rows 1β8 at columns 1,5,8,6,3,7,2,4.
7.Backtracking: place a queen in row 1, try each column. For row 2, try each column that doesn't conflict with row 1's queen (row, col, diagonal checks). Recurse. If no valid column exists, backtrack to previous row and try the next column. Pruning: reject any column immediately if it shares a column or diagonal with an already-placed queen, dramatically reducing branches explored.