Stat 35b: Introduction to Probability with Applications to Poker - PowerPoint PPT Presentation

About This Presentation
Title:

Stat 35b: Introduction to Probability with Applications to Poker

Description:

Stat 35b: Introduction to Probability with Applications to Poker Outline for the day, Tues 2/26/13: Midterms back. Review of midterm. Poisson distribution, ch 5.5. – PowerPoint PPT presentation

Number of Views:84
Avg rating:3.0/5.0
Slides: 18
Provided by: Tria291
Learn more at: http://www.stat.ucla.edu
Category:

less

Transcript and Presenter's Notes

Title: Stat 35b: Introduction to Probability with Applications to Poker


1
  • Stat 35b Introduction to Probability with
    Applications to Poker
  • Outline for the day, Tues 2/26/13
  • Midterms back.
  • Review of midterm.
  • Poisson distribution, ch 5.5.
  • (Hand of the day, Joe Hachem, Bob Bounhara, and
    David Sands.)
  • 4. Continuous random variables, ch. 6.1.
  • 5. Uniform, normal, and exponential
    distributions, ch 6.2-6.4.
  • 6. Project B functions.
  • 7. Project B example, Zelda.
  • Homework 3, due Thur Feb 28, 11am 4.7, 4.8,
    4.12, 4.16, 5.6, 6.2.
  • Project B is due Fri, March 8, 8pm, by email.

2
  • Midterms.
  • Your score becomes Score/2 50, if you got
    lt 100.
  • For instance, if you got 60/100, score this as
    60/2 50 80.
  • After this transformation,
  • 90-100 A range, 80-90 B range, 70-80 C
    range, etc.
  • 2. Review of the midterm.
  • Note that many of the final exam questions will
    be the same as, or similar to, midterm questions.
  • On the final, you will get to use the book plus
    two 8.5 x 11 pages of notes, each double sided.

3
3. Poisson distribution, ch 5.5. Player 1 plays
in a very slow game, 4 hands an hour, and she
decides to do a big bluff whenever the second
hand on her watch, at the start of the deal, is
in some predetermined 10 second interval. Now
suppose Player 2 plays in a game where about 10
hands are dealt per hour, so he similarly looks
at his watch at the beginning of each poker hand,
but only does a big bluff if the second hand is
in a 4 second interval. Player 3 plays in a
faster game where about 20 hands are dealt per
hour, and she bluffs only when the second hand on
her watch at the start of the deal is in a 2
second interval. Each of the three players will
thus average one bluff every hour and a
half.   Let X1, X2, and X3 denote the number of
big bluffs attempted in a given 6 hour interval
by Player 1, Player 2, and Player 3,
respectively. Each of these random variables is
binomial with an expected value of 4, and a
variance approaching 4. They are converging
toward some limiting distribution, and that
limiting distribution is called the Poisson
distribution
4
They are converging toward some limiting
distribution, and that limiting distribution is
called the Poisson distribution. Unlike the
binomial distribution which depends on two
parameters, n and p, the Poisson distribution
depends only on one parameter, ?, which is called
the rate. In this example, ? 4. The
pmf of the Poisson random variable is f(k)
e-??k/k!, for k0,1,2,..., and for ? gt 0, with
the convention that 0!1, and where e 2.71828.
The Poisson random variable is the limit in
distribution of the binomial distribution as n -gt
8 while np is held constant.
5
For a Poisson(?) random variable X, E(X) ?, and
Var(X) ? also. ? rate.   Example. Suppose in
a certain casino jackpot hands are defined so
that they tend to occur about once every 50,000
hands on average. If the casino deals
approximately 10,000 hands per day, a) what are
the expected value and standard deviation of the
number of jackpot hands dealt in a 7 day period?
b) How close are the answers using the binomial
distribution and the Poisson approximation? Using
the Poisson model, if X represents the number of
jackpot hands dealt over this week, what are c)
P(X 5) and d) P(X 5 X gt 1)? Answer. It is
reasonable to assume that the outcomes on
different hands are iid, and this applies to
jackpot hands as well. In a 7 day period,
approximately 70,000 hands are dealt, so X the
number of occurrences of jackpot hands is
binomial(n70,000, p1/50,000). Thus a) E(X) np
1.4, and SD(X) v(npq) v(70,000 x 1/50,000 x
49,999/50,000) 1.183204. b) Using the Poisson
approximation, E(X) ? np 1.4, and SD(X)
v? 1.183216. The Poisson model is a very close
approximation in this case. Using the Poisson
model with rate ? 1.4, c) P(X5) e-1.4
1.45/5! 1.105. d) P(X 5 X gt 1) P(X 5
and X gt 1) P(X gt 1) P(X 5) P(Xgt1)
e-1.4 1.45/5! 1 - e-1.4 1.40/0! e-1.4
1.41/1! 2.71.
6
4. Continuous random variables and their
densities, p103-107. Density (or pdf
Probability Density Function) f(y) ?B f(y) dy
P(X in B). Expected value, µ E(X) ? y f(y)
dy. ( ? y P(y) for discrete X.) Variance, s2
V(X) E(X2) m2. SD(X) vV(X). For
examples of pdfs, see p104, 106, and 107.
7
5. Examples uniform, normal, standard normal
exponential random variables. Uniform (0,1).
See p107-109. f(y) 1, for y in (0,1). µ 0.5.
s 0.29. P(X is between 0.4 and 0.6) ?.4 .6
f(y) dy ?.4 .6 1 dy 0.2. Exponential (l).
See p114. f(y) le-ly, for y  0. E(X) 1/l.
SD(X) 1/l. Normal. pp 115-117. mean µ,
SD s, f(y) 1/v(2ps2) e-(y-µ)2/2s2.
Symmetric around µ, 50 of the values are
within 0.674 SDs of µ, 68.27 of the values are
within 1 SD of µ, and 95 are within 1.96 SDs
of µ. Standard Normal. Normal with µ 0, s
1. See pp 117-118.
8
Standard normal density 68.27 between -1.0 and
1.0 95 between -1.96 and 1.96
9
Exponential distribution, ch 6.4. Useful for
modeling waiting times til something happens
(like the geometric).   pdf of an exponential
random variable is f(y) ? exp(- ? y), for y
0, and f(y) 0 otherwise. If X is exponential
with parameter ?, then E(X) SD(X) 1/? If the
total numbers of events in any disjoint time
spans are independent, then these totals are
Poisson random variables. If in addition the
events are occurring at a constant rate ?, then
the times between events, or interevent times,
are exponential random variables with mean
1/?.   Example. Suppose you play 20 hands an
hour, with each hand lasting exactly 3 minutes,
and let X be the time in hours until the end of
the first hand in which you are dealt pocket
aces. Use the exponential distribution to
approximate P(X 2) and compare with the exact
solution using the geometric distribution.
10
Answer. Each hand takes 1/20 hours, and the
probability of being dealt pocket aces on a
particular hand is 1/221, so the rate ? 1 in
221 hands 1/(221/20) hours 0.0905 per hour.
Using the exponential model, P(X 2 hours) 1
- exp(-2?) 16.556. This is an approximation,
however, since by assumption X is not continuous
but must be an integer multiple of 3 minutes.
Let Y the number of hands you play until you
are dealt pocket aces. Using the geometric
distribution, P(X 2 hours) P(Y 40 hands)
1 - (220/221)40 16.590.   The survivor
function for an exponential random variable is
particularly simple P(X gt c) ?c8 f(y)dy ?c8
? exp(-? y)dy -exp(-? y)c8 exp(-? c).
  Like geometric random variables, exponential
random variables have the memorylessness
property if X is exponential, then for any
non-negative values a and b, P(X gt ab X gt a)
P(X gt b). Thus, with an exponential (or
geometric) random variable, if after a certain
time you still have not observed the event you
are waiting for, then the distribution of the
future, additional waiting time until you observe
the event is the same as the distribution of the
unconditional time to observe the event to begin
with.
11
  • 6) Proj. B functions.
  • FUNCTIONS FOR PROJECT B
  • straightdraw1 function(x)
  • returns 4 is there are 2 possibilities for
    a straight.
  • returns 2 for a gutshot straight draw.
  • returns 0 otherwise
  • Note returns 26 if you already have a
    straight!
  • flushdraw1 function(x)
  • returns the max number of one suit
  • (4 if flush draw, 5 if a flush already!)
  • handeval function(num1,suit1)
  • Straight-flush return 8 million - 8,999,999
  • 4 of a kind return 7 million - 7,999,999
  • Full house 6 million - 6,999,999, etc.
  • . nada 1pr 2pr 3-kind straight
    flush full-house 4-kind str-flush .
  • 0 1mil 2mil 3mil 4mil 5mil
    6mil 7mil 8mil 9mil

12
7) Proj. B example. zelda function(numattable1,
crds1, board1, round1, currentbet, mychips1,
pot1, roundbets, blinds1, chips1, ind1,
dealer1, tablesleft) a1 0 how much I'm
gonna end up betting. Note that the default is
zero. a2 min(mychips1, currentbet) how
much it costs to call if(round1 1)
pre-flop AK Make a big raise if nobody has
yet. Otherwise call. AQ call a small raise,
or make one if nobody has yet. AJ, AT, KQ,
KJ, QJ call a tiny raise. A9, KT, K9, QT,
JT, T9 call a tiny raise if in late position
(within 2 of the dealer). Suited A2-AJ call
a small raise. 22-99 call a small raise.
TT-KK make a huge raise. If someone's raised
huge already, then go all in. AA make a
small raise. If there's been a raise already,
then double how much it is to you. a3
2blinds11 how much a tiny raise would be a4
4blinds11 how much a small raise would
be a5 max(8blinds1,mychips1/4)1 how much
a big raise would be a6 max(12blinds1,mychips1
/2)1 how much a huge raise would be a7
dealer1 - ind1 if(a7 lt -.5) a7 a7
numattable1 your position a7 how many hands
til you're dealer if((crds11,1 14)
(crds12,1 13)) a1 max(a2,a5)
13
if((crds11,1 14) (crds12,1 12))
if(a2 lt a4) a1 a4 else if(a2 gt
a5) a1 0 else a1 a2 if(((crds11
,1 14) ((crds12,1 lt 11.5) (crds12,1
gt 9.5))) ((crds11,1 13)
(crds12,1 gt 10.5)) ((crds11,1 12)
(crds12,1 11))) if(a2 lt a3) a1
a2 if(((crds11,1 14) (crds12,1
9)) ((crds11,1 13) ((crds12,1
10) (crds12,1 9)))
((crds11,1 12) (crds12,1 10))
((crds11,1 11) (crds12,1 10))
((crds11,1 10) (crds12,2 9)))
if((a2 lt a3) (a7lt2.5)) a1
a2 if((crds11,2 crds12,2)
(crds11,1 14) (crds12,1 lt 11.5))
if(a2lta4) a1 a2 Note this trumps the
previous section, since it comes later in the
code.
14
if((crds11,1 crds12,1)) pairs
if(crds11,1 lt 9.5) if(a2 lt a4) a1 a2
else if(crds11,1 lt 13.5) if(a2lta5) a1 a5
else a1 mychips1 else if(a2 lt
blinds1 .5) a1 a4 else a1
min(2a2,mychips1) if(round1 2)
post-flop If there's a pair on the board
and you don't have a set, then check/call up to
small bet. Same thing if there's 3-of-a-kind
on the board and you don't have a full house or
more. If you have top pair or an
overpair or two pairs or a set, make a big bet
(call any bigger bet). Otherwise, if
nobody's made even a small bet yet, then with
prob. 20 make a big bluff bet. If you're the
last to decide and nobody's bet yet, then
increase this prob. to 50. If you have an
inside straight draw or flush draw then make a
small bet (call any bigger bet). If you have
a straight or better, then just call.
Otherwise fold. a5 min(sum(roundbets,1),mychi
ps1) how much big bet would be (prev round's
pot size) a6 min(.5sum(roundbets,1),mychips1
) how much a small bet would be
x handeval(c(crds112,1, board113,1),
c(crds112,2, board113,2)) what you
have x1 handeval(c(board113,1),c(board113,
2)) what's on the board y
straightdraw1(c(crds112,1, board113,1))
15
z flushdraw1(c(crds112,2,
board113,2)) topcard1 max(board113,1) a7
runif(1) random number uniformly
distributed between 0 and 1 a8
(1numattable1)roundbets,1
roundbetsind1,1 others who can still bet
with you The next 5 lines may seem weird, but
the purpose is explained in the next comment a9
a8 - dealer1 for(i in 1length(a9))
if(a9ilt.5) a9i a9i numattable1 a10
ind1 - dealer1 if(a10 lt .5) a10 a10
numattable1 a11 2(a10 max(a9)) So a11
2 if you're last to decide otherwise a11
0. if((x1 gt 1000000) (x lt 3000000))
if(a2 lt a6) a1 a2 else if((x1 gt 3000000)
(x lt 6000000)) if(a2 lt a6) a1 a2 else
if(x gt 1000000 153topcard1) a1
max(a5,a2) else if((a2 lt a6) ((a7 lt .20)
((a7 lt .50) (a11gt1)))) a1 a6 if((y
4) (z 4)) a1 max(a6, a2) if(x gt
4000000) a1 a2
16
if(round1 3) after turn If there's a
pair on the board and you don't have a set, then
check/call up to small bet. Same thing if
there's 3-of-a-kind on the board and you don't
have a full house or more. Otherwise, if you
have top pair or better, go all in. If you
had top pair or overpair but now don't, then
check/call a medium bet but fold to more. If
you have an inside straight draw or flush draw
then check/call a medium bet as well.
Otherwise check/fold. a6 min(1/3sum(roundbets
,12),mychips1) small bet (1/3 of prev
round's pot size) a5 min(.75sum(roundbets,12
),mychips1) medium bet (3/4 of prev round's
pot) x handeval(c(crds112,1,
board114,1), c(crds112,2, board114,2))
what you have x1 handeval(c(board114,1),c
(board114,2)) what's on the board y
straightdraw1(c(crds112,1, board114,1)) z
flushdraw1(c(crds112,2, board114,2)) topc
ard1 max(board114,1) oldtopcard1
max(board113,1) if((x1 gt 1000000) (x lt
3000000)) if(a2 lt a6) a1 a2 else
if((x1 gt 3000000) (x lt 6000000)) if(a2 lt
a6) a1 a2 else if(x gt 1000000
153topcard1) a1 mychips1 else if(x gt
1000000 153oldtopcard1) if(a2 lt a5) a1
a2 else if((y 4) (z 4)) if(a2 lt
a5) a1 a2
17
if(round1 4) after river If there's
a pair on the board and you don't have a set,
then check/call up to small bet. Same thing
if there's 3-of-a-kind on the board and you don't
have a full house or more. Otherwise, if you
have two pairs or better, go all in. If you
have one pair, then check/call a small bet.
With nothing, go all-in with probability 10
otherwise check/fold. a6 .45runif(1)/10
random number between .45 and .55 a5
min(a6sum(roundbets,13),mychips1) small
bet 1/2 of pot size varies randomly x
handeval(c(crds112,1, board115,1),
c(crds112,2, board115,2)) x1
handeval(c(board115,1),c(board115,2))
what's on the board if((x1 gt 1000000) (x lt
3000000)) if(a2 lt a5) a1 a2 else
if((x1 gt 3000000) (x lt 6000000)) if(a2 lt
a5) a1 a2 else if(x gt 2000000) a1
mychips1 else if(x gt 1000000) if(a2 lt
a5) a1 a2 else if(runif(1)lt.10) a1
mychips1 round(a1) end of zelda
Write a Comment
User Comments (0)
About PowerShow.com