We are given $7$ shots to choose randomly (with uniform distribution) from the interval $[0,1]$. After choosing each number we can decide whether we want to keep this number or throw it away. Once we get to keeping $3$ numbers we stop playing the game. What is the best strategy to maximize the sum of those $3$ numbers? What is the expected return of this strategy?
Here are my thoughts on the best strategy (which are wrong!): If we choose $7$ random numbers uniformly, expected value of the smallest one is $1/8$, the second smallest one is $2/8$ and so on. So in our first shot if we get a number greater than or equal to $5/8$ we should keep the number and continue the game with $6$ shots remaining and capacity of 2 numbers to hold. This can happen with the probability of $3/8$. If this doesn't happen then we don't keep the first shot and continue the game with $6$ shots and capacity of $3$ numbers to hold. So we can write a recursive formula for the expected return of this strategy. Let $E(n,k)$ be the expected return with $n$ shots and capacity of $k<n$ numbers to hold. We have the following recursion:
$$E(n,k)=\frac{k}{n+1}(E(n-1,k-1)+\frac{2n+2-k}{2n+2})+\frac{n+1-k}{n+1}E(n-1,k)$$ The boundary condition should be $E(k,k)=\frac{k}{2}$. This strategy gives $E(2,1)=11/18$. Which is less than $5/8$ given by the strategy that if the first shot is greater than $1/2$ keep it otherwise take the second shot.
This is a dynamic programing problem. First compute $E(n,1),\ n=1,\dots,7$. We have $E(1,1)=\frac12$. Then $E(2,1)=\frac58$. To compute $E(n,1)$, we should accept the first draw if it is $\geq E(n-1,)$ and otherwise reject it. Therefore, $$E(n,1)=\int_0^{E(n-1,1)}E(n-1,1)\,\mathrm{d}x+\int_{E(n-1,1)}^1x\,\mathrm{d}x=\frac12+\frac12E(n-1,1)^2$$
Use the same idea to compute $E(n,k)$ for larger values of $k$. If the current draw is $x$, we should accept it if $$x+E(n-1,k-1)\geq E(n-1,k)$$ and reject it otherwise.