Who wants to be a Millionaire?

Consider the following version of the who wants to be a millionaire game: You are given a list L \mathcal{L} , consisting of N N questions. You can answer the questions in any order you like. The probability that you answer the i i th question in L \mathcal{L} correctly is p i p_i and you win v i v_i dollars for answering it correctly , i = 1 , 2 , , N i=1,2,\ldots, N . However, if you give a wrong answer to a question, the game ends immediately and you leave the game with the money you have already won (if any). Naturally, your objective is to answer the questions in an optimal order S \mathcal{S} so as to maximize your expected winning. To be clear, S \mathcal{S} is a permutation of natural numbers from 1 1 to N N which corresponds to your order of answering questions from the list L \mathcal{L} , e.g., if S ( 1 ) = 1000 \mathcal{S}(1)=1000 , it means that you answer the 1000 1000 th question first from L \mathcal{L} and so on.

Here is the data for N = 10000 N=10000 questions, where the row numbers (on the left) correspond to question numbers in the list L \mathcal{L} , the first column corresponds to the probabilities p i p_i 's and the second column corresponds to the prizes v i v_i 's.

Find S ( 2015 ) \mathcal{S}(2015) in the optimal sequence.


The answer is 3132.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Abhishek Sinha
Oct 8, 2015

We will be solving the problem using an interchange argument . Consider any sequence of answering the questions S \mathcal{S} . Let X ( i ) X_{(i)} denote the reward obtained from the i i th question in the sequence S \mathcal{S} . Hence, the total expected reward E R \mathbb{E}R obtained by answering the questions in the order of S \mathcal{S} is given by : E R = E i = 1 N X ( i ) = i = 1 N E X ( i ) \mathbb{E}R=\mathbb{E}\sum_{i=1}^{N}X_{(i)}=\sum_{i=1}^{N}\mathbb{E}X_{(i)} Where we have used Linearity of Expectations in the last equality. Since we obtain a reward associated with the question ( i ) (i) iff we answer all first i i questions correctly, it follows that E X ( i ) = ( j = 1 i p ( j ) ) v ( i ) \mathbb{E}X_{(i)}=(\prod_{j=1}^{i}p_{(j)} )v_{(i)} . Now consider another sequence S \mathcal{S}' , which is the same as S \mathcal{S} , except that we interchange the order of answering i i th and i + 1 i+1 th questions, for some given i i . Hence, from the above equation, it follows that the total expected reward E R \mathbb{E}R' for answering the questions in the order of S \mathcal{S}' is given by E R = E R + ( j = 1 i 1 p j ) ( p ( i + 1 ) v ( i + 1 ) + p ( i ) p ( i + 1 ) v ( i ) p ( i ) v ( i ) p ( i ) p ( i + 1 ) v ( i + 1 ) ) \mathbb{E}R'=\mathbb{E}R +\big( \prod_{j=1}^{i-1}p_j\big)\big(p_{(i+1)}v_{(i+1)}+p_{(i)}p_{(i+1)}v_{(i)}-p_{(i)}v_{(i)}-p_{(i)}p_{(i+1)}v_{(i+1)}\big) If S \mathcal{S} is the optimal sequence, we must have E R E R \mathbb{E}R\geq \mathbb{E}R' . This implies p ( i ) v ( i ) + p ( i ) p ( i + 1 ) v ( i + 1 ) p ( i + 1 ) v ( i + 1 ) + p ( i ) p ( i + 1 ) v ( i ) p_{(i)}v_{(i)}+p_{(i)}p_{(i+1)}v_{(i+1)}\geq p_{(i+1)}v_{(i+1)}+p_{(i)}p_{(i+1)}v_{(i)} Rearranging, p ( i ) ( 1 p ( i + 1 ) ) v ( i ) p ( i + 1 ) ( 1 p ( i ) ) v ( i + 1 ) p_{(i)}\big(1-p_{(i+1)}\big)v_{(i)}\geq p_{(i+1)}\big(1-p_{(i)}\big)v_{(i+1)} i.e., p ( i ) 1 p ( i ) v ( i ) p ( i + 1 ) 1 p ( i + 1 ) v ( i + 1 ) \frac{p_{(i)}}{1-p_{(i)}}v_{(i)} \geq \frac{p_{(i+1)}}{1-p_{(i+1)}}v_{(i+1)} This implies that the optimal sequence is obtained by sorting the questions in the list L \mathcal{L} (in decreasing order) according to their scores s i = p i v i 1 p i s_i=\frac{p_iv_i}{1-p_i} . Once we perform this sorting in the given data, we find that the 2015 2015 th position in the optimal list is occupied by the 3132 3132 nd question.

Abdelhamid Saadi
Oct 10, 2015

Based on the same observation as Abhishek Sinha , this is a program in python 3.5

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
f = open('data')
txtlst = f.readlines()
f.close()
data = []
for k in range(len(txtlst)):
    [a, b] = [eval(x) for x in txtlst[k].split()]
    data.append([k + 1, a, b , a*b/(1 - a)])

sdata = sorted(data, key=lambda x: x[3], reverse=True)
print(sdata[2014][0])

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...