expected value of 7 cards game

129 Views Asked by At

hi i am trying to find a question about calculating the expected value of a card game. The overall game should be like this:

(1) you have 7 cards with number 1- 7 printed on each , and they are all faced down, listed one by one on a table in front you.

(2) you get to pick 1 card, and you get paid 1 dollar if the card you picked has 1 on it, so on and so forth.

(3) how much is the game worth of? (This I think should be 4)

(4) Then I think the question goes along the lines of "if you are not happy with the first card, you can put it aside, and continue to pick a second card, the second card will decide how much you get paid eventually"

I remember the solution was to first calculate E(R) without the option, which is 4.

Then you calculate the E(R) with option using 5 x some probability +6 x some p +7 x some p, you get some value and then you multiply that value with a p + 4 x p. sorry if this is very confusing, I have spent large effort in finding out that question but it's been very hard given I only remember part of the solution. Thank you!

1

There are 1 best solutions below

0
On

Suppose your rule is to take a second card if the score on the first is below 4 (with probability $3/7).$ Then:

  • The only way to get a final score of $1$ is to get 1 on the second draw. So $P(S = 1) = (3/7)(2/3)(1/6) = 2/42 = 1/21.$ Similarly, $P(S =k) = 1/21,$ for $k = 1,2,3.$ [The factor $2/3$ is because one of the cards 1,2,3 is known to be missing.]

  • The remaining equally likely probabilities for scores $4,5,6,7$ must add to $1 - 3(1/21) = 6/7.$ Thus $P(S = k) = 3/14,$ for $k = 4,5,6,7.$

  • It follows that $E(S) = 5, SD(S) = 1.633.$

.

pdf=c(2,2,2,9,9,9,9)/42; k = 1:7
mu = sum(k*pdf);  mu
[1] 5
vr = sum(k^2*pdf)-mu^2;  sqrt(vr)
[1] 1.632993

These results can be simulated in R as follows:

set.seed(2020)
draw = replicate(10^6, sample(1:7, 2))
draw= t(draw)   # 1 million rows, 2 cols
a = draw[,1]*(draw[,1]>=4)  # s from 1st
b = draw[,2]*(draw[,1]<4) # s from 2nd
s = a + b                  # final score
mean(s); sd(s)
[1] 5.000813     # aprx E(S) = 5
[1] 1.632899     # aprx SD(S) = 1.633

table(s)/10^6
s
       1        2        3        4        5        6        7 
0.047651 0.047448 0.047540 0.214394 0.214292 0.214115 0.214560 

42*table(s)/10^6
s
       1        2        3        4        5        6        7 
2.001342 1.992816 1.996680 9.004548 9.000264 8.992830 9.011520 

The distribution of the scores has approximate probabilities, agreeing with the theoretical computation.

A look at cards and scores for the last six of a million plays of the game illustrates the procedure used in the simulation.

 tail(cbind(draw, a, b, s))
                a b s
  [999995,] 6 2 6 0 6
  [999996,] 4 6 4 0 4
  [999997,] 3 7 0 7 7
  [999998,] 6 2 6 0 6
  [999999,] 1 4 0 4 4
 [1000000,] 5 2 5 0 5

hdr="2nd Card on < 4: Simulated Dist'n of Scores"
hist(s, prob=T, br=(0:7)+.5, col="skyblue2", main=hdr)
  points(1:7, pdf, col="red", pch=10)

enter image description here

Tf you decide to draw a second card when the first card is 4 or below, then $E(S) is unchanged, but the variability is a little larger. This is shown in the following slightly modified simulation. I will let you figure out the theoretical distribution.

set.seed(2020)
draw = replicate(10^6, sample(1:7, 2))
draw= t(draw)
a = draw[,1]*(draw[,1]>4)
b = draw[,2]*(draw[,1]<=4)
s = a + b
mean(s); sd(s)
[1] 5.001415
[1] 1.8249

table(s)/10^6
s
       1        2        3        4        5        6        7 
0.047651 0.047448 0.047540 0.214394 0.214292 0.214115 0.214560 

42*table(s)/10^6
s
        1         2         3         4         5         6         7 
 2.995272  2.990862  3.001656  3.000018  9.998562 10.010826 10.002804 

 tail(cbind(draw, a, b, s))
                a b s
 [999995,] 6 2 6 0 6
 [999996,] 4 6 0 6 6  # <---- Different
 [999997,] 3 7 0 7 7
 [999998,] 6 2 6 0 6
 [999999,] 1 4 0 4 4
[1000000,] 5 2 5 0 5

hdr="2nd Card on < 5: Simulated Dist'n of Scores"
hist(s, prob=T, br=(0:7)+.5, col="skyblue2", main=hdr)
 points(1:7, c(3,3,3,3,10,10,10)/42, col="red", pch=10)

enter image description here

Finally, from the Question we have "if you are not happy with the first card, you can put it aside, and continue to pick a second card, the second card will decide how much you get paid eventually."

My interpretation is that you lose 'rights' to the first card, if you choose to try a second card. There were some Comments about the maximum of the two cards, which I am not sure are relevant to this problem. The score could be considerably larger on average if you were allowed to choose the maximum of the two cards (in which case you should always take a second card). Here is a brief simulation of a score based on the maximum.

set.seed(2020)
mx = replicate(10^6, max(sample(1:7, 2)))
mean(mx)
[1] 5.335061
table(mx)/10^6
mx
       2        3        4        5        6        7 
0.047229 0.095410 0.142785 0.190273 0.238253 0.286050 

42*table(mx)/10^6
mx
        2         3         4         5         6         7 
 1.983618  4.007220  5.996970  7.991466 10.006626 12.014100