64 people are standing on an 8x8 chessboard, facing randomly chosen neighbours. If two people are facing each other, they will give each other a high five. On average, how many high fives can we expect to see?
Source: puzzledquant.com
My approach: We divide the chessboard into $3$ groups, based on number of neighbours. If we place indicator variable on each square, for the middle $6$x$6$ = $36$ squares, we have $1/4$ * $1/4$ if the $2$ people face each other and this can happen in $4$ ways (for the $4$ neighbours) hence total we have $1/16$ * $4$ * $36$, similarly for corner squares we have $1/16$ * $2$ * $4$ and for the remaining we have $1/16$ * $3$ * $24$. However, the summation of these 3 don't match the answer of $335/36$.
You should not focus on squares but on edges that separate squares.
Let us call a square an $n$-square if the person on that square has $n$ neighbors.
For every edge that separates two fields there are $4$ possibilities:
Find out how many of each and apply linearity of expectation.