The expected number of Vitcoins for the order σ1,σ2,…,σn is ∑k=1nwσk∏j<kpσj.
In the first example the order (1,2,3) yields 4.55, and the maximum is 8.7, reached by the order (2,3,1). In the third example the orders (2,3,1) and (3,2,1) yield the same expectation, and (2,3,1) comes first lexicographically.