Putting letters in the $4$ $X$ $4$ square board Find the number of ways of arrangement of 9 distinct letters in $4$ $X$ $4$ square board such that neither a row nor a column remains empty.
I have thought of this in this way:
If neither a row nor a column remains empty then first case can be putting 4 letters on the board diagonal and arranging rest of the letters on rest part of board.But there can be even more cases.So i thought of inclusion-exclusion method i.e.
Total Cases-(Those cases in which row and column are empty)
But My answer was wrong again..
Can We genaralize this type of situation for $n$ by $n$ square board??
 A: There are ${{16}\choose{9}}$ ways to select 9 squares out of 16, and for each of these combinations, there are $9!$ ways to fill in the 9 numbers. As such, the total amount of combinations equals ${{16}\choose{9}} 9!$. However, we must subtract all possibilities which have an empty row or column. There are 4 ways to select an empty column, and ${{12}\choose{9}} 9!$ to fill the remainder of the grid. There are also 4 ways to select an empty row, and again ${{12}\choose{9}} 9!$ to fill the remainder of the grid. However, there are 16 combinations in which both an empty column and an empty row exist, so these must be added again to the total number of possibilities. All in all, the total number of possible ways to correctly fill in the grid equals:
$$\bigg({{16}\choose{9}} - 8 {{12}\choose{9}} + 16\bigg) 9! = 3,518,484,480$$
As a generalization, if we want to fill in $(n-1)²$ numbers in a grid of $n \times n$ squares, the total number of combinations equals:
$$\bigg({{n^2}\choose{(n-1)^2}} - 2 n {{n^2 - n}\choose{(n-1)^2}} + n^2\bigg) (n-1)^2!$$
