Mean and Median in a Classic River Crossing Problem

Using @EuYu idea that fixing a single trip (eg. the third trip) each subset of the right cardinality have the same probability, you can write the average traversing time as: $$E[ \text{time} ] = E[ \text{one person trip} ] * N[ \text{one person trip} ] + E[ \text{two person trip} ] * N[ \text{one person trip} ]$$ and you know that: $$N[ \text{one person trip} ]=N-2 \\ E[ \text{one person trip} ]=\frac{\sum_i x_i}{N} \\ N[ \text{two person trip} ]=N-1 \\ E[ \text{two person trip} ]=\frac{\sum_{i,j} \min(x_i,x_j)}{N*(N-1)/2}=\frac{\sum_i(x_i*(i-1))}{N*(N-1)/2} $$

For example, for the case $N=4$ and $x_i=1,2,5,10$, you have 2 one person trip with a mean time of $(1+2+5+10)/4=18/4=4.5$, 3 two person trip with a mean of $(1*0+2*1+5*2+10*3)/(4*3/2)=42/6=7$ for a total expected time of $2*4.5+3*7=30$.

This method works for the mean, for other statistic (like the median) I think a computational approach should be used.


There are $N!(N-1)!^2/2^{N-1}$ different schedules. The average for the generalized problem has already been calculated in carlop's answer. I suspect that calculating the median for the generalized problem in closed form is intractable. Here's code that checks the average of $30$ and determines the median. The time taken for the schedule just below the middle is $27$, the time taken for the schedule just above the middle is $30$. According to the usual definition of the median of an even number of numbers as the mean of the two central ones, the median is therefore $28\frac12$.