Let S
be the sum of the ranks of the dishes we eat during both phases.
S=(m−k+1)X+∑k−1j=1Rj,
where Rj
is the rank of dish j,
excluding the highest ranked dish, from the exploration phase. Since
E(Rj)=(X−1)X2×(X−2k−2)(k−1)(X−1k−1)=(X−1)X2×1X−1=X2,
E(S)=(m−k+1)E(X)+(k−1)E(X)2=(m−k)E(X)+(k+1)E(X)2.