Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Akash Levy <akashlevy@gmail.com>
- Question about tonk probabilities
- 3 messages
- Akash Levy <akashlevy@gmail.com> Sun, May 19, 2013 at 4:35 PM
- To: mgritter@cs.stanford.edu
- Dear Dr. Gritter,
- My name is Akash Levy and I saw your post about tonk probabilities on the twoplustwo forum (http://forumserver.twoplustwo.com/21/draw-other-poker/profitably-dropping-tonk-315444/) from about 5 years ago. As a beginner statistics student at Allderdice high school, I was curious about how you produced the probabilities in your post. Can you please give me a quick explanation of how your probability calculator worked? How did you calculate the number of hands that were lower than any specified hand value? Thanks a lot.
- --
- Sincerely,
- Akash
- Mark Gritter <mgritter@cs.stanford.edu> Sun, May 19, 2013 at 5:35 PM
- To: Akash Levy <akashlevy@gmail.com>
- Hi, Akash.
- I have the code from that experiment around, but unfortunately it is
- not a particularly simple calculation. I used a generating function
- to calculate the number of possibilities.
- You can think of the problem as the ways to choose a fixed value, from
- a multiset { 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, ...., 10, 10, 10, 10,
- 10, 10, 10, 10, 10 } representing the value of every card. (We could
- take some cards out to represent what we hold, if we are interested in
- the distribution of the opponent's hand.) It is thus similar to
- problems like "given N nickels and P pennies, how many ways can I make
- change for a dollar?" except that we have more options (1 through 10)
- and a fixed number of each value (4 for everything but 10, 16 for
- 10's) and a limitation on the number of total coins.
- The second answer here:
- http://math.stackexchange.com/questions/15521/making-change-for-a-dollar-and-other-number-partitioning-problems
- might be helpful. I don't have a good reference on generating
- functions handy--- most examples consider infinite sequences, which
- aren't relevant here.
- The generating function G(x,y) is the product of many terms
- 1+y*x^(a_k) where a_k is the successive values of the multiset, that
- is,
- G(x,y) = (1+yx)(1+yx)(1+yx)(1+yx)(1+yx)(1+yx^2)(1+yx^2)....(1+yx^10)
- The term of this very big polynomial with the exponent y^5 represent
- the ways to pick 5 cards. Of those, the coefficients on items with
- x^N represent the number of ways to make a point value of N. The
- "intuition" here is that for each card, we can either not include it
- (the "1" part of each term) or we can include it and cause the number
- of cards and the value of go up ("y" by one and "x" by the value of
- the card). Multiplication of the terms gives us all possible
- combinations.
- You might be able to translate that reasoning into some more direct
- counting approach, but it would probably be a quite complicated
- recurrence.
- For an easier example, suppose you just had {1, 1, 1, 2, 2, 2} in the
- deck and a 2-card hand, then the generating function is
- G(x,y) = (1+yx)(1+yx)(1+yx)(1+yx^2)(1+yx^2)(1+yx^2)
- Using Wolfram Alpha to do the algebra, that expands to:
- x^9 y^6+3 x^8 y^5+3 x^7 y^5+3 x^7 y^4+9 x^6 y^4+x^6 y^3+3 x^5 y^4+9
- x^5 y^3+9 x^4 y^3+3 x^4 y^2+x^3 y^3+9 x^3 y^2+3 x^2 y^2+3 x^2 y+3 x
- y+1
- if we look at the terms for y^2 they are
- 3 x^4 y^2
- 9 x^3 y^2
- 3 x^2 y^2
- So there are 3 ways to make 4 points, 9 ways to make 3 points, and 3
- ways to make 2 points. We can check that since there are thee ways to
- pick two from (2, 2, 2), three ways to pick two from (1, 1, 1), and to
- make 3 points we need one card from each value, so there are 9 ways.
- I have attached the python code I used, which comes with no guarantee
- that it is actually correct. :)
- Mark Gritter
- (not Dr., unfortunately)
- [Quoted text hidden]
- [Quoted text hidden]
- [Quoted text hidden]
- tonk.py
- 3K
- Akash Levy <akashlevy@gmail.com> Sun, May 19, 2013 at 6:15 PM
- To: Mark Gritter <mgritter@cs.stanford.edu>
- Thanks a lot. For my statistics class's final project, I modeled this situation with a normal model but I don't think the answer was accurate. The problem is complicated by the fact that there are four cards that count as 10 points which skews the curve to the left and makes any predictions about when you should drop invalid. Another complicating factor, is the lack of independence in the deck. Your example with the two card hand really made the explanation much easier to understand. I don't know much about combinatorics but I think I get the gist of what a generating function is. I'm going to try to modify your Python code to calculate the probabilities of getting caught with a seven-card hand instead of a five-card hand. It shouldn't be too hard... I'm going to change the parameter for Y to 7 and regenerate the values. Again, thanks for the help; I really appreciate it.
- [Quoted text hidden]
- --
- Sincerely,
- Akash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement