You are on page 1of 6

Mathematics for Computer Science Guess the Bigger Number

MIT 6.042J/18.062J
Team 1:
•  Write two integers from 0 to 7 on two
Introduction to pieces of paper
•  Show to Team 2 face down
Random Variables Team 2:
•  Expose one paper and look at number
Bigger Number Game •  Either stick or switch to other number

Team 2 wins if gets larger number


Albert R Meyer May 6, 2013 ranvarbigger.1 Albert R Meyer May 6, 2013 ranvarbigger.2

Guess the Bigger Number Guess the Bigger Number


Do you think one team has an Do you think one team has an
advantage? advantage? Which one?

You might like to try playing the


game a few times with some
teammates before seeing the
answers below.

Albert R Meyer May 6, 2013 ranvarbigger.3 Albert R Meyer May 6, 2013 ranvarbigger.4

1
Strategy for Team 2 Analysis of Team 2 Strategy
•  pick a paper to expose, giving each
paper equal probability. Let low < high be the
•  if exposed number is “small” then
switch, otherwise stick. That is integers chosen by Team 1.
switch if ≤ threshold Z where There are three cases:
Z is a random integer E [0,7)

Albert R Meyer May 6, 2013 ranvarbigger.5 Albert R Meyer May 6, 2013 ranvarbigger.6

Analysis of Team 2 Strategy Analysis of Team 2 Strategy

Case M: low ≤ Z < high Case H: high ≤ Z


Team 2 wins in this case, so Team 2 will switch, so wins iff
Pr[Team 2 wins | M] = 1 low card gets exposed
1 1
and Pr[M] ≥ Pr[Team 2 wins | H] =
7 2

Albert R Meyer May 6, 2013 ranvarbigger.7 Albert R Meyer May 6, 2013 ranvarbigger.8

2
Analysis of Team 2 Strategy Analysis of Team 2 Strategy

Case L: Z < low So ≥ 1/7 of time, sure win.

Team 2 will stick, so wins iff Rest of time, win 1/2.

high card gets exposed By Law of Total Probability

1
Pr[Team 2 wins | L] =
2

Albert R Meyer May 6, 2013 ranvarbigger.9 Albert R Meyer May 6, 2013 ranvarbigger.11

Analysis of Team 2 Strategy Analysis of Team 2 Strategy


So ≥ 1/7 of time, sure win. So ≥ 1/7 of time, sure win.
Rest of time, win 1/2. Rest of time, win 1/2.
Pr[Team 2 wins] = Pr[Team 2 wins] ≥
Pr[win | M]·Pr[M] + 1 1 ⎛ 1⎞ 4
__ __ 1 ⋅ + ⋅ ⎜1 − ⎟ =
Pr[win | M ]·Pr[ M] 7 2 ⎝ 7⎠ 7
Albert R Meyer May 6, 2013 ranvarbigger.12 Albert R Meyer May 6, 2013 ranvarbigger.14

3
Analysis of Team 2 Strategy Analysis of Team 2 Strategy

So Team 2 has the So Team 2 has the


advantage advantage, no matter
what Team 1 does!

Albert R Meyer May 6, 2013 ranvarbigger.15 Albert R Meyer May 6, 2013 ranvarbigger.16

Team 1 Strategy Optimal Strategy

…& Team 1 can play so


Pr[Team 2 wins] =
4
4
Pr[Team 2 wins] ≤
7
7
is optimal for both
no matter what

Albert R Meyer May 6, 2013 ranvarbigger.17 Albert R Meyer May 6, 2013 ranvarbigger.18

4
Random Variables

Informally: an RV is a number
produced by a random process:
•  threshold variable Z
•  number of exposed card
•  number of larger card
•  number of smaller card

Albert R Meyer May 6, 2013 ranvarindep.19

5
MIT OpenCourseWare
http://ocw.mit.edu

6.042J / 18.062J Mathematics for Computer Science


Spring 2015

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms .

You might also like