BThat is 5 to the power 5, which lets two queens share a column.
CThat is the answers, boards with no two queens on a diagonal too.
4question 4
7 by 7 checks 42 squares, and 6 by 6 checks 171. Why can the bigger board cost less?
the answer, and why
the answer is C
The cost depends on how often the method goes back. On 7 by 7 it goes back twice; on 6 by 6, 25 times. Section 3's table shows it: 9 queens put down on 7 by 7 to end with 7, 31 on 6 by 6 to end with 6.
A friend wants to solve 8 by 8 by trying every board with one queen in each row and each column, then looking at its diagonals.
How many boards is that?
How many squares does the method check instead?
Why does the method need so few?
a hint
Use question 2 of the learn page, and section 3's table.
a worked answer
8 choices in row 1, then 7, and on: 8 times 7 times 6 times 5 times 4 times 3 times 2 times 1 is 40,320 boards. The method checks 876 squares. As soon as one queen is attacked, it moves on, so it never looks at the boards that start that way.
Question 2: trying every board instead, how many boards, , have one queen in each row and each column?3 of 3 shown
1the move: row 1
the line:
why it is allowed: No queen is down yet, so any of its squares will do. For 4 by 4, a1, b1, c1 or d1.
2the move: the rows below
the line:
row 1
row 2
row 3
a1
b2
c3
a1
c2
b3
b1
a2
c3
b1
c2
a3
c1
a2
b3
c1
b2
a3
3 by 3, diagonals not looked at yet: 3 choices in row 1, each with 2 in row 2, each with 1 in row 3. 3 times 2 times 1, which is 6 boards.
why it is allowed: Each queen above takes a column, and no two queens share one. So row 2 has one choice fewer than row 1, row 3 two fewer, and on down to 1.
guess it, then
3the move: multiply them
the line:
why it is allowed: By lines 1 and 2. Whichever square row 1 takes, row 2 has one fewer left, and whichever pair, row 3 two fewer, so the choices multiply, down to 1: . For 8 by 8, 40,320 boards, before any diagonal is looked at. The method checks 876 squares there.
guess it, then
try it with a small : at , line 3 gives , which you can work out by hand