Take an $n \times n$ random matrix whose entries are i.i.d. with uniform distribution in $[0,1]$. Look at the sums of the elements of each row and then permute the rows so that these sums form an increasing sequence. Next, perform the analogous sorting of the columns.
Obvious remarks: Almost surely no two rows or columns will have the same sum and so the double-sorting operation is uniquely defined. Moreover, the operation is symmetrical: it makes no difference to sort the columns first.
Question: What are the expected value and variance (or more generally, the probability distribution) of the $(i,j)$ entry of the matrix?
I imagine that exact answers should be very complicated, so approximate or asymptotic answers (as $n \gg 1$) may be even better.
A variation of the problem is to take each entry uniformly distributed on $\{0,1\}$ (i.e., a fair coin toss). The bi-sorting won't be necessarily unique, but in that case we choose randomly among the possibilities, say.
PS: Here is the output of an experiment with $n=20$: $$ \begin{array}{cccccccccccccccccccc} 0 &0 &0 &1 &1 &0 &0 &0 &0 &1 &0 &1 &0 &0 &1 &1 &0 &1 &1 &0 \\ 1 &0 &0 &0 &0 &0 &1 &0 &1 &1 &1 &0 &0 &1 &0 &1 &1 &0 &0 &1 \\ 0 &1 &1 &0 &0 &0 &1 &0 &0 &1 &0 &1 &0 &0 &1 &0 &0 &1 &1 &1 \\ 0 &0 &0 &0 &0 &0 &1 &0 &0 &1 &1 &1 &1 &1 &1 &0 &0 &1 &1 &0 \\ 0 &1 &0 &0 &0 &1 &1 &1 &0 &0 &0 &1 &1 &0 &0 &0 &1 &1 &0 &1 \\ 1 &1 &0 &0 &0 &0 &1 &1 &0 &1 &1 &1 &1 &1 &0 &1 &0 &0 &0 &0 \\ 0 &0 &1 &0 &1 &0 &0 &1 &1 &1 &1 &0 &1 &1 &0 &0 &1 &0 &1 &0 \\ 0 &1 &0 &1 &0 &1 &0 &1 &1 &0 &0 &0 &1 &1 &0 &0 &1 &0 &1 &1 \\ 1 &0 &0 &1 &0 &0 &0 &1 &1 &0 &0 &0 &1 &0 &1 &1 &1 &0 &1 &1 \\ 0 &1 &0 &0 &0 &1 &1 &0 &1 &0 &1 &0 &0 &1 &1 &1 &0 &0 &1 &1 \\ 0 &0 &1 &1 &0 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