9

How can I place one queen, two bishops, two knights, and two rooks, on a 5×5 chessboard without any of them attacking other pieces?

After placing just queen and rooks, I can't make room for the other four pieces.

Peter Mortensen
  • 218
  • 1
  • 8
  • 4
    It would be nice to include a reference to the source of this problem. – Stef Mar 16 '22 at 09:22
  • 3
    I suppose the key is to realize the bishops can be placed on the same color as each other, since the puzzle doesn't specify otherwise. – L. Scott Johnson Mar 16 '22 at 11:33
  • @Stef It was a task at my college for practice. – Josip Maričević Mar 16 '22 at 14:17
  • @L.ScottJohnson There are no restrictions, except they can't attack other pieces. – Josip Maričević Mar 16 '22 at 14:17
  • @JosipMaričević So you should try to do it - for practice. You won't learn anything by giving your difficult work to other people to solve for you. – J... Mar 16 '22 at 14:39
  • 4
    @J... I actually did it by myself, before I got an answer here. I think the practice is the wrong word for it. – Josip Maričević Mar 16 '22 at 14:50
  • 2
    The constraints applicable to this problem are rather interesting. The queen and each rook control one rank and one file, meaning that three ranks and three files are totally controlled by those three pieces alone. This leaves only two ranks and two files for the other four pieces to inhabit - which is exactly enough space! – Kevin Mar 17 '22 at 22:50
  • @Kevin: True. In every solution, bishops and knights are placed on a rectangle, on opposite corners. – Eric Duminil Mar 18 '22 at 10:57

4 Answers4

15

Qa3, Rb1, Rc4, Bd2, Nd5, Ne2, Be5

Qa3, Rb1, Rc4, Bd2, Nd5, Ne2, Be5

Glorfindel
  • 24,825
  • 6
  • 68
  • 114
13

For the sake of completeness, I used chessboard, a Python "CLI to solve combinatoric chess puzzles".

chessboard solve --length=5 --height=5 --queen=1 --bishop=2 --rook=2 --knight=2

outputs 24 boards, corresponding to 3 unique solutions, rotated or mirrored.

The queen must be on the edge of the board, but it can be anywhere along those edges (16 squares). There are 2 possible solutions if the queen is in the corner or in the middle square along the edge, for a total of 24 solutions.

Here's the output:

┌───┬───┬───┬───┬───┐
│ ♛ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♜ │   │
├───┼───┼───┼───┼───┤
│   │ ♝ │   │   │ ♞ │
├───┼───┼───┼───┼───┤
│   │ ♞ │   │   │ ♝ │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│ ♛ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │ ♝ │ ♞ │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♜ │
├───┼───┼───┼───┼───┤
│   │ ♜ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │ ♞ │ ♝ │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │ ♛ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♝ │ ♞ │
├───┼───┼───┼───┼───┤
│ ♜ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♞ │ ♝ │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │ ♛ │   │   │
├───┼───┼───┼───┼───┤
│ ♜ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♜ │   │
├───┼───┼───┼───┼───┤
│   │ ♝ │   │   │ ♞ │
├───┼───┼───┼───┼───┤
│   │ ♞ │   │   │ ♝ │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │ ♛ │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♜ │
├───┼───┼───┼───┼───┤
│   │ ♜ │   │   │   │
├───┼───┼───┼───┼───┤
│ ♞ │   │   │ ♝ │   │
├───┼───┼───┼───┼───┤
│ ♝ │   │   │ ♞ │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │   │ ♛ │   │
├───┼───┼───┼───┼───┤
│ ♞ │ ♝ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♜ │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│ ♝ │ ♞ │   │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │   │   │ ♛ │
├───┼───┼───┼───┼───┤
│   │ ♜ │   │   │   │
├───┼───┼───┼───┼───┤
│ ♞ │   │   │ ♝ │   │
├───┼───┼───┼───┼───┤
│ ♝ │   │   │ ♞ │   │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │   │   │ ♛ │
├───┼───┼───┼───┼───┤
│   │ ♞ │ ♝ │   │   │
├───┼───┼───┼───┼───┤
│ ♜ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♜ │   │
├───┼───┼───┼───┼───┤
│   │ ♝ │ ♞ │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│ ♛ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♜ │   │
├───┼───┼───┼───┼───┤
│   │ ♝ │   │   │ ♞ │
├───┼───┼───┼───┼───┤
│   │ ♞ │   │   │ ♝ │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♛ │
├───┼───┼───┼───┼───┤
│   │ ♜ │   │   │   │
├───┼───┼───┼───┼───┤
│ ♞ │   │   │ ♝ │   │
├───┼───┼───┼───┼───┤
│ ♝ │   │   │ ♞ │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │ ♜ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♝ │ ♞ │
├───┼───┼───┼───┼───┤
│ ♛ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♞ │ ♝ │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │   │ ♞ │ ♝ │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│ ♛ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♝ │ ♞ │
├───┼───┼───┼───┼───┤
│   │ ♜ │   │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │   │ ♜ │   │
├───┼───┼───┼───┼───┤
│ ♞ │ ♝ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♛ │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│ ♝ │ ♞ │   │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│ ♝ │ ♞ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♛ │
├───┼───┼───┼───┼───┤
│ ♞ │ ♝ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♜ │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │ ♞ │   │   │ ♝ │
├───┼───┼───┼───┼───┤
│   │ ♝ │   │   │ ♞ │
├───┼───┼───┼───┼───┤
│   │   │   │ ♜ │   │
├───┼───┼───┼───┼───┤
│ ♛ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│ ♝ │   │   │ ♞ │   │
├───┼───┼───┼───┼───┤
│ ♞ │   │   │ ♝ │   │
├───┼───┼───┼───┼───┤
│   │ ♜ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♛ │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│   │ ♞ │   │   │ ♝ │
├───┼───┼───┼───┼───┤
│   │ ♝ │   │   │ ♞ │
├───┼───┼───┼───┼───┤
│   │   │   │ ♜ │   │
├───┼───┼───┼───┼───┤
│ ♛ │   │   │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │ ♞ │ ♝ │   │
├───┼───┼───┼───┼───┤
│   │ ♜ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♜ │
├───┼───┼───┼───┼───┤
│   │   │ ♝ │ ♞ │   │
├───┼───┼───┼───┼───┤
│ ♛ │   │   │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │   │ ♞ │ ♝ │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│ ♜ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♝ │ ♞ │
├───┼───┼───┼───┼───┤
│   │ ♛ │   │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│ ♝ │   │   │ ♞ │   │
├───┼───┼───┼───┼───┤
│ ♞ │   │   │ ♝ │   │
├───┼───┼───┼───┼───┤
│   │ ♜ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♜ │
├───┼───┼───┼───┼───┤
│   │   │ ♛ │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │ ♞ │   │   │ ♝ │
├───┼───┼───┼───┼───┤
│   │ ♝ │   │   │ ♞ │
├───┼───┼───┼───┼───┤
│   │   │   │ ♜ │   │
├───┼───┼───┼───┼───┤
│ ♜ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │ ♛ │   │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│ ♝ │ ♞ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♜ │
├───┼───┼───┼───┼───┤
│ ♞ │ ♝ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♛ │   │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │   │ ♜ │   │   │
├───┼───┼───┼───┼───┤
│ ♝ │   │   │ ♞ │   │
├───┼───┼───┼───┼───┤
│ ♞ │   │   │ ♝ │   │
├───┼───┼───┼───┼───┤
│   │ ♜ │   │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♛ │
└───┴───┴───┴───┴───┘
┌───┬───┬───┬───┬───┐
│   │ ♝ │ ♞ │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │ ♜ │   │
├───┼───┼───┼───┼───┤
│ ♜ │   │   │   │   │
├───┼───┼───┼───┼───┤
│   │ ♞ │ ♝ │   │   │
├───┼───┼───┼───┼───┤
│   │   │   │   │ ♛ │
└───┴───┴───┴───┴───┘
Glorfindel
  • 24,825
  • 6
  • 68
  • 114
Eric Duminil
  • 248
  • 1
  • 6
9

Another solution (not clearly equivalent to Glorfindel's)

enter image description here

gdelab
  • 191
  • 3