-

# Game1 : a dice roll with a 100-faces dice, labeled from 1 to 100. 1. You get to roll once and receive the amount of dollars labeled on the face, how much would you like to pay for this roll. 2. How much would you pay if you can roll the dice twice if you are unsatisfied with the first outcome? 3. You can roll the dice infinite times, and costs 1 dollar for each roll except the first one. What is your strategy? Game2: you are competing in a game with 2 other players. with a 21-faces dice (labeled 1-21). All three of you gets to choose a number and then roll the dice. Whoever chose the number closest to the outcome wins. What is your strategy? another twist: what if all three of you can communicated?

Répondre

## Réponses aux questions d'entretien

8 réponse(s)

1

3. This is hard but you have 7 rolls on average to get a number in the top 7th (ie 86+) and the number averages a 93 1/7 . You spend 7 rolls so your expected is 86 1/7

Utilisateur anonyme le

0

the infinite roll approaches the expectation of profit to be 86.3571 please run the following matlab code i wrote % this calculate the expecation of the profit when you throw a 100-faced % dice - given the value of the accepted tossed points - the first toss is % free - starting from the 2nd toss you pay 1£ to play again % input: Nmax -- the largest max number of tosses allowed % output: % N -- number of maximum allowed tosses % P -- expectation of the profit function [N, P] = one_hundred_faced_dice(Nmax) N = linspace(1, Nmax, Nmax); P = N - N; %---if we only throw it once, the expectation is 50.5 P(1) = 50.5; %---throw more times-- P(i-1) is known for i = 2:Nmax, %----if the first toss is lower than N(i-1), toss it again P(i) = floor(P(i-1))*P(i-1)/100; %----if the first toss is higher than N(i-1), accept it for j = (floor(P(i-1))+1):100, P(i) = P(i) + 0.01*j; end %----however from the 2nd toss, we need to pay to play it P(i) = P(i) - 1; end %----draw the curve plot(N, P); end

summer zheng le

0

if you are going to roll an M-faced dice for Nmax times with a fee starting from the 2nd roll please run the following matlab code % this calculate the expecation of the profit when you throw a 100-faced % dice - given the value of the accepted tossed points - the first toss is % free - starting from the 2nd toss you pay 1£ to play again % input: Nmax -- the largest max number of tosses allowed % M -- no. of faces % output: % N -- number of maximum allowed tosses % P -- expectation of the profit function [N, P] = M_faced_dice(Nmax,M,fee) N = linspace(1, Nmax, Nmax); P = N - N; %---if we only throw it once, the expectation is 50.5 P(1) = (1+M)/2; P(1) = P(1) -1; %---throw more times-- P(i-1) is known for i = 2:Nmax, %----if the first toss is lower than N(i-1), toss it again P(i) = floor(P(i-1))*P(i-1)/M; %----if the first toss is higher than N(i-1), accept it for j = (floor(P(i-1))+1):M, P(i) = P(i) + j/M; end %----however from the 2nd toss, we need to pay to play it P(i) = P(i) - fee; end %----draw the curve plot(N, P,'o-'); end

summer zheng le

0

this can be analytically derived - however i used the approximation that floor funciton (expectation _n-1) = expectation . so there will be some errors in the estimation .

summer zheng le

0

It's actually somewhat hard to do the 3rd question in the discrete case. In the continuous case, say the expected value of rolling the dice (without paying the \$1 fee) is s. So if we roll to a number greater than s - 1, we're going to keep it, because the value of rolling again and paying the fee is s - 1. We reroll all numbers lower than s - 1. Lower than s - 1 : probability (s - 1) / 100, value s - 1 Higher than s - 1 : probability (101 - s) / 100, value (100 + s - 1) / 2 = (99 + s) / 2 So we need only solve for s = (s-1)(s-1)/100 + (101-s)(99+s)/200. Not sure I'd want to do that in an interview, but wolfram alpha tells me it's 86.858. So the strategy is to keep rolling until you get 85.858 or higher. It's probably slightly off because of the discrete case, but that a good estimate would be to keep rolling until 86 or higher.

Andrew le

0

for game 2, if no communication, I will pick 11 to minimize the expected value of the difference between the die and my number. If we can communicate, we have to reach a balance unless the discussion won't terminate. So these three has to be 4,11,18. In this case all three guys have 1/3 possibility to win.

Game 2 le

0

The highest expected value if you decide to go for N rolls is 1+99N/(N+1) (think of a line starting a 1 and ending at 100, where you put N equidistant points). Since you have to pay (N-1) dollars for N rolls (the 1st one is for free), the total money you should expect to earn is = 1+99N/(N+1)-(N-1) The maximum of this function is at N=9. So you roll the dice until you get ≥82, where you stop and take the money.

Utilisateur anonyme le

0

For Game 1.3, the epected value of the game is 81.1

Utilisateur anonyme le

## Ajouter des réponses ou des commentaires

Pour commenter ceci, connectez-vous ou inscrivez-vous.