I am doing a worst case scenario analysis where need the solution of the following problem.
A matrix of $k$ rows and $n$ columns is filled with the numbers $1,2,\ldots,k$ such that the following conditions are satisfied:
- Every column contain all the numbers form 1 to $k$ without repetition.
- The sum $S(k,n)$ of the variance of the $k$ rows is maximized; where $S(k,n)$ = Variance of first row + Variance of second row + ... + Variance of $k$-th row.
Questions:
- What is the representation of the maximum value of $S(k,n)$ in a closed form in terms of $k$ and $n$?
- Is there an algorithm to fill the matrix such that $S(k,n)$ is maximized?