0
$\begingroup$

I want to find the number of ways in which two queens can be placed on a chessboard so that they can attack each other. two queens can attack each other on a row, a column or on same diagonal just likes the moves of a queen.

$\endgroup$
1
$\begingroup$

I assume the queens are indistinguishable (say, both white). Wlog. $n\le m$. Then there are $n\cdot{m\choose 2}$ ways with horizontal attacks; $m\cdot {n\choose 2}$ ways with vertical attack; $(m-n)\cdot {n\choose 2}+2\sum_{k=2}^{n-1}{k\choose 2}$ ways with "falling" diagonal attack and the same number with "rising" diagonal. Use the well-known formulas for sums of quadratic sequences to get an explcit expression for $\sum_{k=2}^{n-1}{k\choose 2}$ and add all up.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.