Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Hand in hw3. 2.Review of midterm. 3.Project B functions and example.

Slides:



Advertisements
Similar presentations
After the flop – nobody raised before the flop Strategy: No-Limit.
Advertisements

Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Zelda, continued. 2.Difficult homework 3 problem. 3.WSOP 2013 hand.
Short Stack Strategy – How to play after the flop Strategy: No Limit.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Midterms. 2.Hellmuth/Gold. 3.Poisson. 4.Continuous distributions.
Intelligence for Games and Puzzles1 Poker: Opponent Modelling Early AI work on poker used simplified.
Intro to Probability & Games
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Ly vs Negreanu. 2.Flush draws and straight draws 3.Project B teams.
Overview Odds Pot Odds Outs Probability to Hit an Out
Stat 13, Thu 5/3/ Correction on normal notation. 2. Normal percentiles. 3. Normal probability plots. 4. Bernoulli and Binomial random variables.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Straight draws. 2.HW2 clarification. 3.Greenstein vs. Farha AA.
Brain Teasers. Answer 3 Quantitative Finance Society Gambling Strategies & Statistics.
Introduction for Rotarians
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Hand in hw4. 2.Review list 3.Tournament 4.Sample problems * Final.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 0. Collect hw2, return hw1, give out hw3. 1.Project A competition.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Midterm. 2.Review of Bernoulli and binomial random variables. 3.Geometric.
Stat 35: Introduction to Probability with Applications to Poker Outline for the day: 1.Addiction 2.Syllabus, etc. 3. Wasicka/Gold/Binger Example 4.Meaning.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Collect Hw4. 2.Review list. 3.Answers to hw4. 4.Project B tournament.
Suppose someone bets (or raises) you, going all-in. What should your chances of winning be in order for you to correctly call? Let B = the amount bet to.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day, Tue 3/13/12: 1.Collect Hw WSOP main event. 3.Review list.
Shortstack Strategy: How do you play before the flop? Strategy: No Limit.
Outline for the day: 1.Discuss handout / get new handout. 2.Teams 3.Example projects 4.Expected value 5.Pot odds calculations 6.Hansen / Negreanu 7.P(4.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Addiction 2.Syllabus, etc. 3. Wasicka/Gold/Binger Example 4.Meaning.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.HW3 2.Project B teams 3.Gold vs. Helmuth 4.Farha vs. Gold 5.Flush.
Stat 35b: Introduction to Probability with Applications to Poker Poker Code competition: all-in or fold.   u 
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Project B teams 2.Project B example 3.Gold vs Farha 4.Bayes Rule.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day, Tues 2/28/12: 1.Midterms back. 2.Review of midterm. 3.Poisson distribution,
Short stack strategy: Draws in a free play situation Strategy: No Limit.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Expected value and pot odds, continued 2.Violette/Elezra example.
All In To put all the rest of your money into the pot.
Introduction to Poker Originally created by Albert Wu,
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Project B example, again 2.Booth vs. Ivey 3.Bayes Rule examples.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Odds ratios revisited. 2.Gold/Hellmuth. 3.Deal making. 4.Variance.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Hand in hw1! Get hw2. 2.Combos, permutations, and A  vs 2  after.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Tournaments 2.Review list 3.Random walk and other examples 4.Evaluations.
1)Hand in HW. 2)No class Tuesday (Veteran’s Day) 3)Midterm Thursday (1 page, double-sided, of notes allowed) 4)Review List 5)Review of Discrete variables.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Uniform, normal, and exponential. 2.Exponential example. 3.Uniform.
(Day 14 was review. Day 15 was the midterm.) Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Return and review.
Outline: 1) Odds ratios, continued. 2) Expected value revisited, Harrington’s strategy 3) Pot odds 4) Examples.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1. Combos, permutations, and A  vs 2  after first ace 2.Conditional.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Expected value. 2.Heads up with AA. 3.Heads up with Gus vs.
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Review List 2.Review of Discrete variables 3.Nguyen / Szenkuti.
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
GORDONs NB-6-max overview (V. 1.0 DocSnyder)
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Stat 35b: Introduction to Probability with Applications to Poker
Presentation transcript:

Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.Hand in hw3. 2.Review of midterm. 3.Project B functions and example. 4.WSOP 2013 hand. 5.Conditional expectation. Homework 3 is due today, and hw4 is due Mar 14. Project B is due Mar 8, 8pm, by to

1. Hand in hw3. Your overall hw score will be curved toward 100. score -> (score + 100)/2. So 80 -> 90, 70 -> 85, 60 -> 80, etc. 2. Review of midterm problems.

3) Proj. B functions and example. TESTING OUT YOUR FUNCTION FOR PROJECT B. Suppose your function is called “neverfold”. Run 6 neverfolds against 6 zeldas. install.packages(holdem) ## you must be connected to the internet for this to work. library(holdem) a = neverfold z = zelda decision = c(a,a,a,a,a,a,z,z,z,z,z,z) name1 = c("n1","n2","n3","n4","n5","n6","z1","z2","z3","z4","z5","z6") tourn1(name1, decision) ## Do this line a few times. Make sure there’s no error. For project B, you will get full credit if you just turn in the same function you used for part A. So, don’t stress about it. But, if you want to compete, you might use Zelda and tweak a few things in it. But please test it yourself and correct your errors.

SOME FUNCTIONS YOU CAN USE 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

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 = 2*blinds1+1 ## how much a tiny raise would be a4 = 4*blinds1+1 ## how much a small raise would be a5 = max(8*blinds1,mychips1/4)+1 ## how much a big raise would be a6 = max(12*blinds1,mychips1/2)+1 ## how much a huge raise would be a7 = dealer1 - ind1 if(a7 < -.5) a7 = a7 + numattable1 ## your position: a7 = how many hands til you're dealer if((crds1[1,1] == 14) && (crds1[2,1] == 13)){ a1 = max(a2,a5) }

if((crds1[1,1] == 14) && (crds1[2,1] == 12)){ if(a2 < a4){ a1 = a4 } else if(a2 > a5){ a1 = 0 } else a1 = a2 } if(((crds1[1,1] == 14) && ((crds1[2,1] 9.5))) || ((crds1[1,1] == 13) && (crds1[2,1] > 10.5)) || ((crds1[1,1] == 12) && (crds1[2,1] == 11))){ if(a2 < a3) a1 = a2 } if(((crds1[1,1] == 14) && (crds1[2,1] == 9)) || ((crds1[1,1] == 13) && ((crds1[2,1] == 10) || (crds1[2,1] == 9))) || ((crds1[1,1] == 12) && (crds1[2,1] == 10)) || ((crds1[1,1] == 11) && (crds1[2,1] == 10)) || ((crds1[1,1] == 10) && (crds1[2,2] == 9))){ if((a2 < a3) && (a7<2.5)) a1 = a2 } if((crds1[1,2] == crds1[2,2]) && (crds1[1,1] == 14) && (crds1[2,1] < 11.5)){ if(a2<a4) a1 = a2 ## Note: this trumps the previous section, since it comes later in the code. }

if((crds1[1,1] == crds1[2,1])){ ## pairs: if(crds1[1,1] < 9.5){ if(a2 < a4) a1 = a2 } else if(crds1[1,1] < 13.5){ if(a2<a5) a1 = a5 else a1 = mychips1 } else { if(a2 < blinds1 +.5) a1 = a4 else a1 = min(2*a2,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]),mychips1) ## how much big bet would be (prev round's pot size) a6 = min(.5*sum(roundbets[,1]),mychips1) ## how much a small bet would be x = handeval(c(crds1[1:2,1], board1[1:3,1]), c(crds1[1:2,2], board1[1:3,2])) ## what you have x1 = handeval(c(board1[1:3,1]),c(board1[1:3,2])) ## what's on the board y = straightdraw1(c(crds1[1:2,1], board1[1:3,1]))

z = flushdraw1(c(crds1[1:2,2], board1[1:3,2])) topcard1 = max(board1[1:3,1]) a7 = runif(1) ## random number uniformly distributed between 0 and 1 a8 = (1:numattable1)[roundbets[,1] == roundbets[ind1,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 1:length(a9)) if(a9[i]<.5) a9[i] = a9[i] + numattable1 a10 = ind1 - dealer1 if(a10 <.5) a10 = a10 + numattable1 a11 = 2*(a10 == max(a9)) ## So a11 = 2 if you're last to decide; otherwise a11 = 0. if((x1 > ) && (x < )){ if(a2 < a6) a1 = a2 } else if((x1 > ) && (x < )){ if(a2 < a6) a1 = a2 } else if(x > ^3*topcard1){ a1 = max(a5,a2) } else if((a2 1)))){ a1 = a6 } if((y == 4) || (z == 4)) a1 = max(a6, a2) if(x > ) a1 = a2 }

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/3*sum(roundbets[,1:2]),mychips1) ## small bet (1/3 of prev round's pot size) a5 = min(.75*sum(roundbets[,1:2]),mychips1) ## medium bet (3/4 of prev round's pot) x = handeval(c(crds1[1:2,1], board1[1:4,1]), c(crds1[1:2,2], board1[1:4,2])) ## what you have x1 = handeval(c(board1[1:4,1]),c(board1[1:4,2])) ## what's on the board y = straightdraw1(c(crds1[1:2,1], board1[1:4,1])) z = flushdraw1(c(crds1[1:2,2], board1[1:4,2])) topcard1 = max(board1[1:4,1]) oldtopcard1 = max(board1[1:3,1]) if((x1 > ) && (x < )){ if(a2 < a6) a1 = a2 } else if((x1 > ) && (x < )){ if(a2 < a6) a1 = a2 } else if(x > ^3*topcard1){ a1 = mychips1} else if(x > ^3*oldtopcard1){ if(a2 < a5) a1 = a2 } else if((y == 4) || (z == 4)){ if(a2 < a5) a1 = a2 } }

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 =.45+runif(1)/10 ## random number between.45 and.55 a5 = min(a6*sum(roundbets[,1:3]),mychips1) ## small bet~ 1/2 of pot size; varies randomly x = handeval(c(crds1[1:2,1], board1[1:5,1]), c(crds1[1:2,2], board1[1:5,2])) x1 = handeval(c(board1[1:5,1]),c(board1[1:5,2])) ## what's on the board if((x1 > ) && (x < )){ if(a2 < a5) a1 = a2 } else if((x1 > ) && (x < )){ if(a2 < a5) a1 = a2 } else if(x > ){ a1 = mychips1 } else if(x > ){ if(a2 < a5) a1 = a2 } else if(runif(1)<.10){ a1 = mychips1} } round(a1) } ## end of zelda

4. WSOP 2013 hand. 5. Conditional expectation, E(Y | X), ch Suppose X and Y are discrete. Then E(Y | X=j) is defined as ∑ k k P(Y = k | X = j), just as you’d think. E(Y | X) is a random variable such that E(Y | X) = E(Y | X=j) whenever X = j. For example, let X = the # of spades in your hand, and Y = the # of clubs in your hand. a) What’s E(Y)? b) What’s E(Y|X)? c) What’s P(E(Y|X) = 1/3)? a. E(Y) = 0P(Y=0) + 1P(Y=1) + 2P(Y=2) = x39/C(52,2) + 2 C(13,2)/C(52,2) = 0.5. b. X is either 0, 1, or 2. If X = 0, then E(Y|X) = E(Y | X=0) and E(Y | X=0) = 0 P(Y=0 | X=0) + 1 P(Y=1 | X=0) + 2 P(Y=2 | X = 0) = x26/C(39,2) + 2 C(13,2) / C(39,2) = 2/3. E(Y | X=1) = 0 P(Y=0 | X=1) + 1 P(Y=1 | X=1) + 2 P(Y=2 | X = 1) = / (0) = 1/3. E(Y | X=2) = 0 P(Y=0 | X=2) + 1 P(Y=1 | X=2) + 2 P(Y=2 | X = 2) = (0) + 2(0) = 0. So E(Y | X = 0) = 2/3, E(Y | X = 1) = 1/3, and E(Y | X = 2) = 0. That’s what E(Y|X) is c. P(E(Y|X) = 1/3) is just P(X=1) = 13x39/C(52,2) ~ 38.24%.