Hi I am a school student with interests in math and I have been tackling the problem stated above, the thing is that I want to generalize for 3 queens but I don`t know how because the problem becomes increasingly complex (I already have a solution for the two queens case) sorry for gramaticall mistakes and errors in the format, it is not my native language and its my first time using the page:
The solution for the two queens is given by the equation $\frac{-4}{n+1}+\frac{2}{3n}+1$ where $n$ is the board size, the solution is explained below:
For the first step, I had to make an equation that gave me the amount of non attacked squares according to the x,y position of the first queen, I made an equation that used minimums which was the following $\boxed{ F(n, x, y) = n^2 - 2n - \left[\min(x-1, y-1) + \min(n-x, n-y) + 1\right] - \left[\min(x-1, n-y) + \min(n-x, y-1) + 1\right] + 3 }$ this is because when you calculate the row and columns the queen attacks, it attacks 2n squares, then the first diagonal can be determined by this formula wich chooses the term with the minimun value $d_1 = \min(x-1, y-1) + \min(n-x, n-y) + 1$ and the second diagonal which has the following formula $d_2 = \min(x-1, n-y) + \min(n-x, y-1) + 1$, then adding all up we get the result seen above, the term n squared represents the whole board and the +3 represents the unecesary intersections.
Then, I realized that you want to sum this formula for all squares but this would be too complex so I realized that most of the squares are just reflections of the positions and the amount of attacked squares is the same, so I saw that you could arrage kind of a staircase pattern, the staircase is shown in the image bellow and each number represents the amount of reflections each square has, you also have to take in consideration that for an even or odd board (refering to the lenght of the board being divisible by 2 or not), the amount of reflections will vary and have a different pattern.
staircase pattern for odd and even board
Now, I realized that because the position x is always greater than y, I could cancel out some terms in the equation that used minimums, so I did it and it turns out that the equation leaves a nice compact expression and that the variable y disapears $n^2-3n+4-2x$.
Because of this, I saw that each columns could be added and the expresion would turn into a sum, in this case, the sum for an even board would be $\frac{\sum_{x=1}^{\frac{n}{2}}(n^{2}-3n+4-2x)(4n-8x+4)}{n^{4}-n^{2}}$, where the second parenthesis takes in account the sum of every reflection of the queens position in each column and the denominator has in account every possible arangement of queens in the board. This sum can then be evaluated to the following expression $\frac{3n^{4}-10n^{3}+9n^{2}-2n}{3n^{4}-3n^{2}}$, then, this can be reduced to the final expression $\frac{-4}{n+1}+\frac{2}{3n}+1$.
Now the interesting part is that if we repeat with an uneven board, we have to make another sum because the center square has no reflections and the overall sum of values in each column is different, so to take everything into account, we have the following expression: $\frac{(n^{2}-4n+3)+\sum_{x=1}^{\frac{x+1}{2}}(n^{2}-3n+4-2x)(4n+4-8x)}{n^{4}-n^{2}}$, this can be turned into a polynomial $\frac{n^{4}+3n^{2}-\frac{10n^{3}+2n}{3}}{3n^{4}-3n^{2}}$ and then be simplified to the same expression as the even board case $\frac{-4}{n+1}+\frac{2}{3n}+1$.
With this, we can conclude that this equation evaluates the probability of putting two queens at random and them not coliding, this can be proved with simulations which I have already done and the results match (you can prove it by comparing the solution to the first column of the image or by running your own simulation)
Results for the probability of putting 2 and 3 non coliding queens in an N x N chessboard
Values of the function for different N
now, would anyone have any suggestions or solutions to the same problem but for 3 queens?
This investigation would not be possible if I didn`t use wolfram alpha, desmos and mathgpt so this could be a tool that may help you to answer the question.