You have $n$ questions in an exam. Question $i$ is answered correctly with probability $p_i > 0$. If question $i$ is answered correctly, you get $R_i$ marks. You can choose to answer the questions in any order. As long as you are giving correct answers, you can accumulate all the marks. However, whenever your answer to a question is incorrect, the examination is over and you are not allowed to answer any other question. Given $R_i$ and $p_i$, what is the optimal order in which you should answer the questions to maximize the total expected marks you score?
Here is my approach - Let $F_t(S_t)$ be the expected max score you can have when $t$ questions are remaining, and the set of questions remaining is $S_t$. We get the recurrence as
$$F_t(S_t)=\max_{i \in S_t} [p_i(R_i+F_{t-1}(S_t-\{i\}))]$$
with $F_0(\phi)=0$.
Now, $F_1(\{i\})=p_iR_i$. $F_2(\{i,j\})=\max(p_i(R_i+p_jR_j),p_j(R_j+p_iR_i))$. We see that the first term is larger when
$$\frac{p_iR_i}{1-p_i}>\frac{p_jR_j}{1-p_j}.$$ This hints that the ordering may be based on the value of $\frac{p_iR_i}{1-p_i}$, but I am not sure how to give a formal proof, or how to solve the recurrence efficiently?