How many such positions are there? (chess/math checkmate puzzle) I'm interested in this kind of position:

There are only 4 pieces on the board. If Whites goes first, they can checkmate in one move. If Blacks goes first, they can checkmate in one move. For example:




  The question is: How many such positions are there?


I find 3 main positions:



Each of them gives us another 6 positions. We can move the start position of the black Queen to 6 other 6 squares. So we have 21 basic positions.




  Are there other basic positions?


For each basic position we can : 

1) switch color x2

2) rotate the board x4

3) mirror position x2

So one basic position generate 2x4x2=16 positions.
 And the final answer is: There are 16x21=336 such positions.


  Is this right?
Your second basic position allows for 4 more variants beyond those you already gave, indicated by the following diagram:

[FEN "1q6/1q6/1q6/1q6/Q7/K7/8/1k6 w - - 0 1"]


That brings the tally for "basic positions" to 25. Whether that addition makes the list exhaustive or not I'm not completely sure (though I think it does).

In any case, whatever the number of basic positions is, your extrapolation of the total number of positions from there (x2 for the color switch and x8 for transformations of the board) is correct since the symmetry group of the chessboard does indeed have order 8, as confirmed on p.334 of this chapter from the Handbook of Constraint Programming, for instance. (One does need to be careful about overcounting here, though; see below.) So at the moment I'd conjecture that the answer is 25 x 16 = 400.



I'm adding this mathematical digression because I see from your profile that you're interested in pursuing a further study of math. I may not be saying anything here that you aren't already aware of, but here goes anyway.

Note that there are some chess positions which will come out identical under different symmetries of the board. For instance, consider the act of reflecting across the a1-h8 diagonal. That symmetry of the board will generally change a given position, e.g.



becomes



But of course some positions (namely those that only have pieces on the a1-h8 diagonal) don't change under that symmetry, e.g. the position



remains unchanged when we reflect across that diagonal.

Because of this sort of behavior, one generally needs to be careful not to overcount in this kind of counting problem. For your problem, that means being sure that none of your basic positions repeats itself under any of the (non-identity) symmetries, so that our "x 16" when obtaining the total number of positions from the number of basic positions isn't overcounting. In the present case, your basic positions are complicated/asymmetric enough that it's intuitively clear none of them will get repeated under these symmetries, so there's nothing to worry about, but in math it's often when things are "intuitively clear" that one needs to be most worried about mistakes. (In fact, there's a saying that if you want to find errors in a mathematical proof, start with anywhere it says, "It is clear that ...")