Thursday, September 14, 2017

Rule of Two, Rule of Four, and the Professor Makes a Mistake, or Three...

A couple of well-known shortcuts for estimating probabilities of coming from behind are the Rule of Two and the Rule of Four, which are as follows:



  • Suppose you have x outs. Your chance of winning with 1 card to come is approximately 2x%. For example, if you have 6 outs, then you have about a 12% chance of hitting one of them in one card.
  • Again suppose you have x outs. Your chance of winning with 2 cards to come is approximately 4x%. For example, if you have 6 outs on the flop, then you have about a 24% chance of getting there by the river.
Of course, while these are useful shortcuts at the poker table, our goal in the combinatorics unit that we are currently studying is to learn how to calculate these and other such probabilities exactly.

I have just assigned our first RMarkdown assignment for the class, in which one of the tasks is to write code to calculate these probabilities for a range of x's and plot the probabilities according to the shortcut and according to the exact calculation. Their completed plot, e.g. for the Rule of Four, should look something like the following:


So, it is a good approximation when the number of outs is small, but breaks down as that number gets larger.

The calculations in this graph are assuming that all of your outs are not only good, but also give you a lock; e.g. if any of your outs do come on the turn, your opponent does not have the chance to then outdraw you back on the river. But, what if this isn't the case?

To explore this, I made up the following example in class last week:

Suppose we are holding Ac,Qh
Our opponent is holding 10h,8d
The flop is 10s,7c,3d

The key features of the example are that our opponent has a pair of 10s, and there are no possible flushes, but I might have some of the cards not exactly correct otherwise. Which leads me to my FIRST MISTAKE: if I make it up on the fly, I'm probably not going to remember it exactly when I want to refer to it on another day. This was indeed a slight issue as I have tried to use this example across three different days so far, and I'm worried about any inadvertent confusion that may arise simply because I keep changing the cards slightly.

On the first day using this example, I asked: what is the probability that we will be ahead on the turn? This was fine; we have 6 outs out of 45 unseen cards, so the answer is:
$$\frac{6}{45} \approx 0.133$$
No problem there, and it matches up reasonably well with the 12% that we would get from Rule of Two.

But then I tried to revisit this example on the next day, with the following question: what is the probability that we will be ahead at the very end of the hand (showdown)?

This led me to my SECOND MISTAKE: I didn't notice the possibility of a runner-runner straight! i.e. if the turn and river are a king and a jack, giving us 10,J,Q,K,A. One of my students brought this up when I asked the class how we should solve this problem, and I hadn't even thought of that possibility! (kudos Jake O'Neill)

I proceeded with the example telling us to IGNORE the possibility of a straight, to keep things a little simpler for now, and then we would revisit the problem later to tackle that part.

So the question now becomes: what is the probability that we win with anything other than a straight? For this to occur, we have 6 outs: the 3 Aces and 3 Queens. However, if we hit one of them, we still lose if our opponent gets another 10 or 8, giving them 3 of a kind or two pair, respectively.

This leads me to my THIRD MISTAKE: the solution that I gave in class last week was:
$$\frac{6 \times 39 + 40 \times 6}{45 \times 44} \approx 0.239$$
where there are 45 remaining unseen cards in the deck and we could hit one of our 6 outs on the turn, multiplied by the number of possibilities where we dodge a 10 or an 8 (45-5-1=39 such cards), or we could hit any non-10 non-8 first (45-5=40 cards), and then hit one of our 6 outs. It matches up really closely to Rule of Four (24%), but is unfortunately incorrect!

Question to the audience (not including my students since we have since fixed it in class): Where did I go wrong?? I welcome your answers in my comments section.

---------
Note 1: This question can be solved considering order or not considering order, and the answer will be the same either way as long as we are consistent in our numerator and denominator. Above, I was attempting to solve it considering order. I welcome the unordered solution in my comments section as well; if there are no takers for either approach, I'll post it myself in a couple days.

Note 2: My blog, including the comments section, is MathJax-enabled. So, you can input your answer as latex code, between TWO $ delimiters to open your latex code, and another TWO to close your latex code. I just tested it and it won't show up correctly in the preview, but it should come through in the published version. For example, the above incorrect answer was typed as follows:

$$\frac{6 \times 39 + 40 \times 6}{45 \times 44} \approx 0.239$$
----------


So, I think I have learned that I cannot trust myself to make up poker hand examples on the fly and get it right! Even with as much experience as I have with probability/combinatorics and Texas Hold'em, the old saying of "math is much harder on the chalkboard in front of a room" rings true and I need to actually be prepared with the examples that I want to demonstrate. Bummer b/c I like having spontaneity as part of my teaching style, but I'll just have to be a little more careful going forward.

Now, the question still remains: how do we solve this taking into account the possibility that we make a runner-runner straight? We started the ordered solution in class on Wednesday, and both the ordered solution and unordered solution are current homework problems for the class. I welcome your solutions to this (students included now, since we didn't finish this in class) in the comments. Again if no takers on any of this, I'll post solutions in a couple days.

Next up: we finish the combinatorics unit, and move onto conditional probability and independence. Also, our next poker night is around the corner in a couple weeks...

6 comments:

  1. You know I can't resist a good probability problem!

    For the ignore the straight possibility, the error in the original solution is double counting the case where both cards are good for the player (i.e., both are either A or Q). The 45 remaining cards are:
    - 6 good (the 6 remaining As and Qs)
    - 5 bad (the remaining 10s and 8s)
    - 34 miscellaneous that help neither player

    The possibly orderings where the player can win are:
    - good followed by misc
    - misc followed by good
    - good followed by good

    So the numerator should be $$6 \times 34 + 34 \times 6 + 6 \times 5$$.

    This expression could alternatively be considered as:
    - good followed by either misc or good
    - misc followed by good

    which would make the numerator $$6 \times (34+5) + 34 \times 6$$.

    Looking forward to reading more about your experiment!

    ReplyDelete
  2. Nice, Abby! This matches what I finally came to.

    I have offered my class extra credit for posting the unordered solution that includes the possibility of us making a straight.

    So far it looks like there have been no takers on that. I've given them until today at 5pm, and I'll post it tomorrow if there are still no takers by then.

    ReplyDelete
  3. Alright so it is after 5pm on Monday (I can't see the days of comments but I am hoping I am safe to post now...)

    Unordered solution that includes the possibility of making a straight:

    Denominator is $${45 \choose 2}$$ since there are 45 cards left.

    Numerator needs to count the number of mutually exclusive ways we could have a winning hand:
    - 2 "good" cards = ${6 \choose 2}$
    - 1 "good" card and one "misc" card: ${6 \choose 1} \times {34 \choose 1}$
    - or one king and one jack needed for a straight (4 of each left in the deck so number of unordered combinations is: ${4 \choose 1}\times{4 \choose 1}$

    So all of that leads to: $$\frac{15 + 204 + 16}{990} = 0.237$$

    ReplyDelete
    Replies
    1. Well google let me down and told me I could use single $ signs for inline equations in mathjax, so I am retyping the numerator part here:

      Numerator needs to count the number of mutually exclusive ways we could have a winning hand:
      - 2 "good" cards = $${6 \choose 2}$$
      - 1 "good" card and one "misc" card: $${6 \choose 1} \times {34 \choose 1}$$
      - or one king and one jack needed for a straight (4 of each left in the deck so number of unordered combinations is: $${4 \choose 1}\times{4 \choose 1}$$

      Delete
  4. Awesome! Yeah sorry about the $ thing -- by default MathJax doesn't do it, but it's possible to add script so that it does. But I didn't do that since, with all the poker talk, I figured dollar signs would be a needed character every now and then, haha.

    Also, I'm bummed that none of my students attempted the extra credit. As far as your timing: 1) hm yeah weird that the comments section doesn't show the day. I'll see if I can fix that; 2) I told them that the blog welcomed all solutions and if anyone outside of the class did it, the game was over for them.

    Anyways, here's my ORDERED solution including a straight:
    $$
    \frac{6 \times 39 + 8 \times (4+6)+26 \times 6}{45 \times 44}
    \approx 0.237 $$


    where:
    - 6 is the number of A or Q, then 39 remaining non-10, non-8 cards
    - 8 is the number of J or K, in which case you then have 4 chances to hit the other one (i.e. if the turn is J, then you have 4 Ks to make a straight), or also A or Q still helps
    - 26 is the number of remaining non-10, non-8 cards. If any of those is the turn, then we just have our original 6 outs.

    And PHEW it matches your unordered solution!

    ReplyDelete
  5. Abby (if you ever find your way back to this particular post): I finally figured out how to show the date on comments. That took me way longer than it should have...

    ReplyDelete