1

For rook we have obviously $$R(n,m)=nm(n+m-2)$$ and for bishop $$B(n,m)=4\left(m\binom{n}{2}-\binom{n+1}{3}+\binom{n-m+1}{3}\right)$$ if we assume $\binom{n}{k}=0$ for $n<0$.

Is there a way to write it in more simple and nice form?

user514787
  • 1,475
  • 1
    Expand and calculate? – nonuser Dec 27 '18 at 21:00
  • @greedoid, I mean something special, for example using floor function or nice looking sum. – user514787 Dec 27 '18 at 22:23
  • Maybe not an exact duplicate, but this question asked (among other things) for the number of ways you can put two bishops on a chessboard so that they don't attack each other, which is trivially equivalent to asking the number of ways you can put two bishops on a chessboard so that they do attack each other, which is half the number of possible bishop moves. – bof Dec 28 '18 at 07:03

2 Answers2

3

As greedoid commented, it is so simple to expand and simplify. $$B(n,m)=4\left(m\binom{n}{2}-\binom{n+1}{3}+\binom{n-m+1}{3}\right)=\frac{2}{3} m(m-1) (3 n-m-1)$$

1

The number of possible bishop moves on an $m\times n$ chessboard is equal to $4$ times the number of $k\times k$ squares, $2\le k\le\min(m,n)$, on that chessboard, since each bishop move is a move from one corner to the opposite corner of one of those squares.

From this we get the formula $$B(m,n)=4\sum_{k=2}^{\min(m,n)}(m+1-k)(n+1-k)$$$$=8\binom{\min(m,n)}3+4(|m-n|+1)\binom{\min(m,n)}2$$ which you may or may not consider "simple and nice". For square chessboards it becomes simpler and nicer: $$B(n,n)=4\sum_{k=2}^n(n+1-k)^2=4\left[1^2+2^2+3^2+\cdots+(n-1)^2\right]$$$$=8\binom n3+4\binom n2=\frac23(n-1)n(2n-1).$$

See also the answer to the question How many ways can you put: a) two bishops b) two knights c) two queens on a chessboard in such a way that one piece does not attack the other?.

bof
  • 78,265
  • Thank you for answer and for edition too! English not my native, sorry. Formulas in your answer which you linked need to be more popular. It also can be generalized to any figure for which some of 4 directions (|a|,|b|) are allowed. Another criteria - max length of move (in selected direction). Thinking about it show how primitive basic chess rules (but it still hard to play). – user514787 Jan 01 '19 at 00:40
  • 1
    You're welcome! – bof Jan 01 '19 at 00:55