2. Introduction
The purpose of my project is to find the formula for placing two queens on an nxn
chessboard so that no queen attacks any other queen. I will be using n=2 and n=3 to find out the
formula for using any n where the queen doesn’t attack any other.
I used this formula where n = 2.
𝑛4
−
10
3
𝑛3
+ 3𝑛2
−
2
3
𝑛
2
(2)4
−
10
3
(2)3
+ 3(2)2
−
2
3
(2)
2
=
16 −
80
3
+ 12 −
4
3
2
=
0
2
= 0
If n = 3,
9 × 1 + 7 × 8
32
=
65
9
= 7.222
𝑛4
−
10
3
𝑛3
+ 3𝑛2
−
2
3
𝑛
2
=
(3)4
−
10
3
(3)3
+ 3(3)2
−
2
3
3
2
=
81 − 90 + 27 − 2
2
=
16
2
= 8
Q
Q
Q
Q
Q
7 7 7
7 9 7
7 7 7
Q
Q
Q
Q
Q
Q
Q
Q
3. Q
Q
𝑛2
(𝑛2
− 𝑆 𝑞 )
2
=
32
(32
− 7.222)
2
=
16
2
= 8
Sq is my average number of squares that a queen controls on an nxn chessboard.
If we put two queens on a 3 x 3 chessboard so that no queen attacks another, we get 8 ways.
Finding Average
First, I use the stone. It has no rule on where it can be moved. A stone cannot move so it
never attacks another piece. Next, I used the rook and moved it around the board. The rule for
the rook is it can only be moved vertically and horizontally. For a rook, it always controls n+n-1
squares. After that, I used the queen. I placed it on the board and moved it along the board. The
rule for the queen is it can move vertically, horizontally and diagonally. To find the answer to
my question, I focused on the average number of squares that a queen controls on an nxn
chessboard. For the queen, it depends on where the queen is placed on the board.
From a corner, a queen controls n+(n-2)+n squares.
For example, n = 3
For example, n = 4
n+(n-2)+n
4+(4-2)+4 = 10
If the queen is placed on outer square of the board, it controls 10 places. If it is placed on the
inner square of the board, it controls 12 places. The average number of squares controlled by the
queen where n = 4 is:
Q
Q
7 7 7
7 9 7
7 7 7
10 10 10 10
10 12 12 10
10 12 12 10
10 10 10 10
4. 12 × 4 + 10 ∗ 12
16
= 10.5
For example, n = 5
13 13 13 13 13
13 15 15 15 13
13 15 17 15 13
13 15 15 15 13
13 13 13 13 13
n+(n-2)+n
5+(5-2)+5=13
If the queen is placed in the outer square, it controls 13 places. If we put the queen in the inner
square, it controls 15 places. If the queen is centered in the middle, it controls 17 places. The
average number of squares the queen controls when n = 5 is:
17 × 1 + 15 × 8 + 13 × 16
25
= 13.8
I used the same method to find the average number all the way up to n = 12. If n = 6, my
average is 17.11. While I was looking for the formula, I found that
16𝑛2
+ 6𝑛+4
𝑛2 = 17.11
If I used n = 7, my average is 20.428. While looking for the formula, I found that
19𝑛2
+10𝑛
𝑛2 = 20.428
If I used n= 8, my average is 23.75.
If I used n = 9, my average is 27.07.
If I used n = 10, my average is 30.40.
If I used n = 11, my average is 33.72.
If I used n = 12, my average is 37.055.
5. I tried finding a formula that would work for n=1 to n=12, but the formula is
different for each n = c.
I used the combination formula to show the number of possible combinations of n objects from a
set of k objects.
𝑛!
𝑘! ( 𝑛 − 𝑘)!
Stone and Rook Problem
I used two methods for the stone and rook problem.
Method 1 Stone Problem: There are n2 tiles on an nxn chessboard. We can choose two stones in
(n2) ways.
Method 2 Stone Problem: The first stone can be chosen from n2 tiles. The second stone can be
chosen from n2-1 tiles. Both stones can be chosen
𝑛2
(𝑛2
−1)
2
= ( 𝑛2) ways. I divided by 2 because
the stones can be switched.
𝑛!
2! ( 𝑛2 − 2)!
=
𝑛4
− 𝑛2
2!
=
𝑛4
2
−
𝑛2
2
≈
𝑛4
2
I used two methods for the rook problem, as well.
Method 1: I chose two rows for the rooks in (n) ways. I then chose two columns for the rooks in
(n) ways.
There are two ways to place the rooks in the intersection of the rows and columns for 2 (n)(n)
total ways.
Method 2: The first rook can be placed on any of n2 tiles. This rook controls n+n-1 total tiles. So
the second rook can be placed on any n2 – ( n + n -1) tiles.
𝑛2
(𝑛2
−(2𝑛−1))
2
= 2𝑛
( 𝑛−1)
2
𝑛
(𝑛−1)
2
=
𝑛2
(𝑛−1)2
2
=
𝑛2
(𝑛2
−2𝑛+1)
2
= 2( 𝑛)(𝑛)
The total number of ways of placing the two rooks is
𝑛2
(𝑛2
−(𝑛+𝑛−1)
2
= 2(n)(n). It is divided by
two because the rocks can be switched.
The Queen’s Problem
2
2
2
2
2 2
22
22
6. Method 1: We don’t know (because nobody has proved this)!
Method 2: We can use method 2 to find the answer to the question ‘How many ways can we put
two queens on a nxn chessboard so that the queens do not attack each other? To do method 2, it
depends on where the queen is placed. How many squares does the queen control? We will call
this Sq. The answer will be
𝑛2
(𝑛2
−𝑆 𝑞)
2
, where n2 represents putting the first queen, and (n2 – Sq)
represents putting the second queen.
1) # of squares controlled is:
n + n – 1 + n – 1
# of such squares is:
n + n + n – 2 + n – 2
2) # of squares controlled is:
n + n – 1 + n – 1 + 2
# of such squares is:
n – 2 + n – 2 + n – 4 + n – 4
3) # of squares controlled is:
n + n – 1 + n – 1 + 4
Q
7. # of such squares is:
n – 4 + n – 4 + n – 6 + n – 6
General Formula:
# of squares controlled is:
3n + 2j – 4
# of such squares is:
4n – 8j + 4
where J represents # of squares controlled.
I compute these formulas where n is evenand 𝟏 ≤ 𝒋 ≤
𝒏
𝟐
1
𝑛2
= ∑(3𝑛 + 2𝑗 − 4)(4𝑛 − 8𝑗 + 4) = 𝑆 𝑞
𝑛
2
𝑗 =1
To find Sq, I used these two formulas.
∑ 𝑗 =
𝑛
2
(
𝑛
2
+ 1)
2
𝑛
2
𝑗=1
∑ 𝑗2
=
𝑛
2
(
𝑛
2
+ 1)(2
𝑛
2
+ 1)
6
𝑛
2
𝑗=1
First I multiplied (3𝑛 + 2𝑗 − 4)(4𝑛 − 8𝑗 + 4)
3𝑛(4𝑛 − 8𝑗 + 4) = 12𝑛2
− 24𝑛𝑗 + 12𝑛
2𝑗(4𝑛 − 8𝑗 + 4) = 16𝑗2
− 8𝑛𝑗 + 8𝑗
9. The formula for how many ways we can put two queens on an nxn chessboard so that no queen
attacks any other is:
𝑛2
(𝑛2
− 𝑆 𝑞)
2
We substituted Sq in and got:
𝑛2
(𝑛2
− (
10
3
𝑛 − 3 +
2
3𝑛
))
2
This formula works where n is odd:
𝑛2
(𝑛2
− (
10
3
𝑛 − 3 +
2
3𝑛
))
2
=
𝑛
2
4
−
5
3
𝑛3
+
3
2
𝑛2
−
1
3
𝑛
If n equals an odd number, we can also use the formula above.
If n = 4, the average number of squares that a queen controls on a 4 x 4 chessboard is equal to
10.5. I can directly use this number in my formula
𝑛2
(𝑛2
−𝑆 𝑞 )
2
.
Sq =
12×10+4×12
2
= 10.5
42(42−10.5)
2
= 44
𝑛4−
10
3
𝑛3+3𝑛2−
2
3
𝑛
2
=
44−
10
3
43+3(4)2−
2
3
(4)
2
= 44
If n = 5, the average number of squares that a queen controls on a 5 x 5 chessboard is equal to
13.8. I can directly use this number in my formula
𝑛2
(𝑛2
−𝑆 𝑞 )
2
.
Sq =
17×1+15×8+13×16
25
= 13.8
52(52−13.8)
2
= 140
54−
10
3
53+3(5)2−
2
3
(5)
2
=
54−
10
3
53+3(5)2−
2
3
(5)
2
= 144
10 10 10 10
10 12 12 10
10 12 12 10
10 10 10 10
10 10 10 10
10 12 12 10
10 12 12 10
10 10 10 10
10. 13 13 13 13 13
13 15 15 15 13
13 15 17 15 13
13 15 15 15 13
13 13 13 13 13
The average number of squares that a queen controls depends on where the queen is placed on
the board.
If n = 5, we see that if we put the queen on the outer edges, we have 13 possibilities. If we place
this queen on the inner square, we have 15 possibilities. Placing the queen in the center will give
you 17 possibilities. The closer you get to the center; the possibilities go up by 2.
If n = 6
𝑛2
(𝑛2
− 𝑆 𝑞)
2
=
62
(62
− 17.11)
2
= 340
If n = 7
𝑛2
(𝑛2
− 𝑆 𝑞)
2
=
72
(72
− 20.43)
2
= 700
If n = 8
𝑛2
(𝑛2
− 𝑆 𝑞 )
2
=
82
(82
− 23.75)
2
= 1288
If n = 9
𝑛2
(𝑛2
− 𝑆 𝑞 )
2
=
92
(92
− 27.07)
2
= 2184
If n = 10
𝑛2
(𝑛2
− 𝑆 𝑞 )
2
=
10(102
− 30.40)
2
= 3480
If n = 11
11. 𝑛2
(𝑛2
− 𝑆 𝑞 )
2
=
112
(112
− 33.72)
2
= 5280
If n = 12
𝑛2
(𝑛2
− 𝑆 𝑞 )
2
=
122
(122
− 37.05)
2
= 7700
I will use a graph to represent n = 2 to n = 12.
12. Main Result
The number of ways of placing 2 queens on an nxn chessboard so that no queen attacks the other
is:
𝑛
2
4
−
5
3
𝑛3
+
3
2
𝑛2
−
1
3
𝑛
. The graph shows the number of possibilities that two queens could be placed on an nxn
chessboard without attacking each other. For example, if there is a 2x2 chessboard, then there are
no possibilities. If n = 3, then we have eight possibilities.
0 8 44 144 340
700
1288
2184
3480
5280
7700
0
1000
2000
3000
4000
5000
6000
7000
8000
9000
0 2 4 6 8 10 12 14
NumberofPossibilities
n
Number of Possibilites