\definereferenceformat [inproblem] [text=Problem]

 setups    

\setuplayout[marking=on,location=middle,
  backspace=1.25in,
  leftmargindistance=0.125in, 
  width=4.75in,
  rightmargindistance=0.25in, 
    headerdistance=24bp,
  height=8.5in,
     bottom=12bp]


  [problem]
  
  ]

\starttext

  many games  flipping     tedious.
 computer  instead simulate  games  pseudorandom numbers
as  substitute    coin.    several runs produced by 
 
   with $1$  $2$  indicate  player won the 
then   shows the    resulted in  win.
 these  iterations, each player   times.   reasonable
conclusion       Each     chance

 try    With   games, one   count the
number     player  scanning the  beginnings.
computer  the 
Each run    because  program  different
pseudorandom  each  produces  different   The 
recent   $68$: In  words, player~$1$  
 and player~$2$ won  times.   probability  
winning now seems closer  $2/3$   $1/2$.

\externalfigure[fig/coin-flip.1]

    value,  diagram   as  tree.  
  contains  and T, and  one flip.   game
ends  the leaves, when     heads.  The boldface
 show the   the first  wins, e.g.  TTH, 
TTTTH.   probabilities of each  way are, 
     The  sum    is
the    the first  
\placeformula\startformula        
 .
\stopformula

This    summed using   formula (see
However,  more enjoyable   which    
formula in \inproblem[prob:explain-geometric-series]   
noticing the presence of   tree  its  one
 down.   is,  the first   tails,  happens
    the second player starts the game as 
he   were the first player.     player wins
the game with probability $1/2$ times  (the factor   is from
 probability     tosses tails).  Because one of
the two     two winning   and $p/2$
add  unity.  Therefore, $p=2/3$,   from the 

\startMPinclusions
def r_ladder := draw unitsquare; enddef;
\stopMPinclusions

\startstaticMPfigure{resistiveladder}
  r_ladder;
\stopstaticMPfigure

\usestaticMPfigure[resistiveladder]

\stoptext
