Puzzle

How many legal chess positions are there in which there are 8 pawns on the 2nd rank, 8 pawns on the 7th rank, 8 pieces on the 1st rank, and 8 pieces on the 8th rank?

By “legal” I mean a position which can be arrived at from the starting position by a sequence of legal moves.

In how many of these positions is it white’s move? In how many is it black’s?

Bill Smythe

My guess is 96. Since nothing between the bishops can move, that leaves only rooks and knights. If all knights stay on their original side, each corner can independently be in one of two states 2 ** 4 = 16. The same holds true if all knights go to the other side for another 16. If only one knight each goes to the other side, a specific corner can be in one of four states: RN, NR, Rn, nR but the other corner on that same side has to make do with the other knight for only two states. (42) * (42) = 64. So the answer is 16 + 64 + 16 = 96.

I’ll let someone else tackle whose side it is to move.

Knights cannot “lose” moves in the way the other pieces can (even pawns can sometimes do this). And in this position, the rooks cannot lose a move, as they can only oscillate between (say) a1 & b1.

So I’m going to guess that it’s always White to move.

If white’s knight on B1 moves to G1 and the one on G1 moves to B1, is that considered 1 position or 2?

If each side has a KN and a QN instead of just two N’s, the one of each situation occurs three times for a total of 192.

P.S. On second thought, let’s make that 384. If there are four objects with two each interchangable, the number of ways they can be arranged is
4! / (2! * 2!) = 4321 / 21 * 2*1 = 6 ways to place four knights in the corners. When multiplied by 16 (2 states per corner raised to the number of corners power) that gives 96, the answer in the first post. If each knight is unique, there are 24 ways to arrange them–multiply that by 16 to get 384.

But if I read the problem literally as posed, wouldn’t it also be possible to have positions where the White Knights and Black Knights have traded places, and then isn’t it also possible to have distinguish between whether the opposite color KN and KN trade places, or the opposite color KN and QN trade places?

BTW, I’m not sure that a KN/QN “transposition” constitutes a different position, since there are no differences in available legal moves. They have different histories, but they are, I think, the same position.

Finally, there don’t seem to be any other color exchanges that could occur because to get 8 pawns on the 2nd/7th and 8 pieces on the 1st/8th there would have to be a trade to allow the maneuvering, and then we are short of pieces to put on the 1st, 2nd, 7th, or 8th. Only the Knights seem to be able to accomplish a “color exchange” sans trading.

(Of course, since the N’s and R’s can transpose, the opposite color R’s and N’s can also transpose.)

Does this include bughouse? If so then you start with 65,536 different pawn positions (12,870 if there are eight pawns of each color). If the standard 16 starting pieces are the ones used then there are almost 326,918,592,000 possibilities (reduce that because some are immediately multiple checks). You can’t do a simple multiplication of the two numbers because that sometimes adds immediate multiple checks, but it is getting up there. If the 16 pieces could include some that started on your partner’s board then the number goes way up.

Originally I was a little suspicious of the “64” part of your 16 + 64 + 16. I was afraid there might be unweeded duplications or something. But then I realized there’s another way to look at. There are two ways of distributing the two knights (one of each color) between white’s kingside and queenside corner regions. Within each of these, there are two ways of locating the rook. So that’s 222. On black’s side, there are likewise 222. So that’s still 64.

It was my intention that those “two” positions are just one. It’s analogous to the triple-occurrence rule. If two rooks (for example) have interchanged positions, that’s still considered the same position for triple-occurrence purposes.

And yes, it’s always white’s move in all of these positions. If all the rooks are on their original squares, then the remaining squares (b1,b8,g1,g8) come in two-color pairs. If any knight changed color (i.e. made an odd number of moves), then another knight would have had to do the same to compensate, so the total number of knight moves would have to be even. If any rook made an odd number of moves, then that would screw up the color balance on the kngiht’s squares, making the knight total odd too. Each parity change (odd to even or vice versa) among rook moves would result in a corresponding parity change among knight moves, so the total would still be even.

Bill Smythe

I think my method in my previous post (the P.S. part) is more straightforward: The permutation of 4 items with two each interchangable times the two states of the corners raised to the number of corners power.

IOW it’s = (4! / (2! * 2!) ) * 2**4 = 96. It’s kinda similar to how many ways are there to arrange the letters: MISSISSIPPI ?

  1. Nh3 Nh6 2. Nf4 Nf5 3. Nh5 Nh4 4. Ng3 Ng6 5. Nf5 Nf4 6. Nh6 Nh3 7. Ng8 Ng1 ?

Bill’s conditions were:

1.There are 8 pawns on the 2nd rank,
2. 8 pawns on the 7th rank,
3. 8 pieces on the 1st rank,
4. 8 pieces on the 8th rank,
5. The position was arrived at from the starting position by a sequence of legal moves.

Also (for example):

  1. Nc3 Nc6 2. Nb5 Nb4 3. Na3 Na6 4. Nc4 Nc5 5. Na5 Na4 6. Nb3 Nb6 7. Nc5 Nc4 8. Na6 Na3 9. Nb8 Nb1
  2. Nf3 Nc6 2. Nd4 Ne5 3. Nb3 Ng4 4. Nc5 N4f6 5. Na6 Nh5 6. Nc5 Nf4 7. Na6 Nh3 8. Nb8 Ng1

And other similar lines, or lines where the Knights exchange places with the Rooks.

Kevin, you are actually agreeing with wbport.
Each corner (a1/b1, g1/h1, a8/b8 and g8/h8) can have a knight and a rook. The rook can’t get out, so there can’t be two rooks or two knights in one corner. The rook can either be in the corner or next to the corner. That is the 2**4 portion of the formula (4 corners, 2 locations for the rook in each corner) which comes to 16 possible combinations of locations for the rooks.

The next part is the distribution of the knights for each of those 16 locations. With four corners and two knights of each color that is the (4! / (2! * 2!) ) part of the formula, which comes to 6. The 6 possibilities for the white knights are: both queenside; both kingside; both first rank; both eighth rank; Q-side black/K-side white; and Q-side white/K-side black. For the four corner squares not occupied by rooks with four knights to be distributed (hence the 4!), each distribution of the two white knights (hence the first 2!) leaves exactly one distribution of two black knights (hence the second 2!), so the number remains 6.

With 6 possible knight distributions for each of the 16 rook distributions that comes to 96 positions.

11!/(4!*4!*2!*1!) = 34,650. 11 possible positions for the M. For each of those 11 there are 45 possible positions for the two Ps. For each of those 495 there are 70 possible positions for the 4 Ss. For each of those 34,650 there is our only four spots left unfilled and four Is to fill them.

I see. I went back and re-read his post - I had misunderstood what he was doing with the Knights.

I guess it’s time for another puzzle.

Construct a legal position (which can be arrived at by a sequence of legal moves from the opening position) in which there are:

  • eight black pieces on the 1st rank.
  • eight white pieces on the 8th rank,
  • N black pawns on the 2nd rank, and
  • N white pawns on the 7th rank.

Here is an example with N=4:

Can it be done with N=5? N=6? Winner is the person who can come up with a solution for the largest possible N.

Bill Smythe

That’s not always a bad thing to happen!

Another way to look at the combinations of two pairs of interchangable items (knights) is
1100
1010
1001
0110
0101
0011

Exactly right!

  1. b4 b5, 2) a4 c5, 3) ab cb, 4) g4 g5, 5) h4 f5, 6) hg fg gives us four pawns on each side (white b5, c2, f2, g5 and black a7, b4, g4, h7) that can now move to the other side without getting barricaded by an opposing pawn. Add a center pawn for each side and N=5. You didn’t say that the eight pieces had to be the original eight pieces, but each capture of a piece requires the promotion of a pawn to replace it, so you still have a minimum number of captures to be made.

  2. a4 b5 2) g4 h5 3) ab hg allows the extra b and g pawns to promote but that still only frees up four files. 4) c4 d5 5) e4 f5 6) ef dc gets us N=6 with no pawn barricaded, but with doubled b, c, f and g pawns. One more set of captures to undouble the pawns (one being bc or cb and the other being fg or gf) still limits us to N=5.

I’m inclined to agree that N=5 is as good as it gets.

There is an alternative approach, however, to the N=4 case.

The diagrammed position can be achieved without any pawn captures (i.e. captures by pawns) at all. A white knight can come out and capture the four black queenside pawns on or near their home squares. A black knight can do the same to the white kingside pawns. The rest is easy (or, at least, possible).

Whether this will help with N=5 or N=6, I doubt. But it might open up a different avenue.

Bill Smythe

I thought about captures of or by pieces. However, each capture of a piece by a pawn can only free up that pawn, and does so at the expense of requiring a pawn promotion. Each capture of a pawn by a piece frees up only the pawn opposite the captured pawn. Only pawns capturing pawns can free two pawns of each color in three files (on a 12x12 board with 12 pawns on each side, N=8 can be easily achieved, and on a 6x6 board N=4 is easily achieved).