To solve this problem, we need to find the expected value of the sum of the first ( m ) elements after ( k ) random adjacent swaps starting from the ordered sequence ( 1, 2, \dots, n ).
Understanding the Swaps:
At each step, we randomly select one of the ( n - 1 ) adjacent pairs with equal probability ( \frac{1}{n - 1} ) and swap them. Over ( k ) steps, this process can be thought of as a Markov chain where the positions of elements change over time.
Calculating Expected Change in the Sum:
Let ( S_t ) denote the expected sum of the first ( m ) elements at time ( t ). We start with ( S_0 = \frac{m(m + 1)}{2} ) because the sequence is initially ( 1, 2, \dots, m ).
At each swap, only swaps involving indices up to ( m ) can affect the sum ( S_t ). Specifically, swapping positions ( p ) and ( p+1 ) for ( p \leq m ) can change the sum ( S_t ). The expected change in ( S_t ) due to swapping positions ( p ) and ( p + 1 ) is:
[ \Delta S = \text{Expected value after swap} - \text{Expected value before swap} ]
For a swap at positions ( p ) and ( p + 1 ), the change in ( S_t ) is ( X_{p+1} - X_p ), where ( X_j ) is the element at position ( j ).
Total Expected Change per Swap:
The expected change in the sum per swap is the average of the changes over all possible swaps:
[ \Delta = \frac{1}{n - 1} \sum_{p=1}^{m} (E[X_{p+1}] - E[X_p]) = \frac{E[X_{m+1}] - E[X_1]}{n - 1} ]
Because ( E[X_{m+1}] ) and ( E[X_1] ) tend toward the average value ( \frac{n + 1}{2} ) as swaps occur, the expected change per swap becomes:
[ \Delta \approx \frac{(n + 1)/2 - (n + 1)/2}{n - 1} = 0 ]
However, initially, there's a difference between ( E[X_{m+1}] ) and ( E[X_1] ), so the expected change per swap is not zero. Initially, ( E[X_1] = 1 ) and ( E[X_{m+1}] ) is closer to ( (m + 1) ).
The total expected change after ( k ) swaps is:
[ \text{Total Expected Change} = k \times \Delta ]
Calculating Expected Sum after ( k ) Swaps:
The total change in the expected sum ( S_k ) from its initial value ( S_0 ) to the equilibrium value ( m \times \frac{n + 1}{2} ) (which is the expected sum if the elements were randomly permuted) is:
[ \Delta S_{\text{total}} = m \times \frac{n + 1}{2} - \frac{m(m + 1)}{2} = \frac{m(n - m)}{2} ]
There are ( \frac{n(n - 1)}{2} ) possible adjacent swaps needed to mix the entire sequence, so the expected change per swap is:
[ \delta = \frac{\Delta S_{\text{total}}}{\frac{n(n - 1)}{2}} = \frac{m(n - m)}{n(n - 1)} ]
Therefore, after ( k ) swaps, the expected sum is:
[ E[S_k] = S_0 + k \times \delta = \frac{m(m + 1)}{2} + \frac{k m (n - m)}{n(n - 1)} ]
Answer:
An explicit expression: Expected sum = ½·m(m + 1) + k·m·(n − m) ⁄ [n(n − 1)]; that is,
E[Sₖ] = ½·m(m + 1) + k·m(n − m)/(n(n − 1))