Advertisement
Guest User

Levy-Gritter E-mail

a guest
May 20th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.73 KB | None | 0 0
  1.  
  2. Akash Levy <akashlevy@gmail.com>
  3. Question about tonk probabilities
  4. 3 messages
  5. Akash Levy <akashlevy@gmail.com> Sun, May 19, 2013 at 4:35 PM
  6. To: mgritter@cs.stanford.edu
  7. Dear Dr. Gritter,
  8.  
  9. 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.
  10.  
  11. --
  12. Sincerely,
  13. Akash
  14. Mark Gritter <mgritter@cs.stanford.edu> Sun, May 19, 2013 at 5:35 PM
  15. To: Akash Levy <akashlevy@gmail.com>
  16. Hi, Akash.
  17.  
  18. I have the code from that experiment around, but unfortunately it is
  19. not a particularly simple calculation. I used a generating function
  20. to calculate the number of possibilities.
  21.  
  22. You can think of the problem as the ways to choose a fixed value, from
  23. a multiset { 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, ...., 10, 10, 10, 10,
  24. 10, 10, 10, 10, 10 } representing the value of every card. (We could
  25. take some cards out to represent what we hold, if we are interested in
  26. the distribution of the opponent's hand.) It is thus similar to
  27. problems like "given N nickels and P pennies, how many ways can I make
  28. change for a dollar?" except that we have more options (1 through 10)
  29. and a fixed number of each value (4 for everything but 10, 16 for
  30. 10's) and a limitation on the number of total coins.
  31.  
  32. The second answer here:
  33. http://math.stackexchange.com/questions/15521/making-change-for-a-dollar-and-other-number-partitioning-problems
  34. might be helpful. I don't have a good reference on generating
  35. functions handy--- most examples consider infinite sequences, which
  36. aren't relevant here.
  37.  
  38. The generating function G(x,y) is the product of many terms
  39. 1+y*x^(a_k) where a_k is the successive values of the multiset, that
  40. is,
  41.  
  42. G(x,y) = (1+yx)(1+yx)(1+yx)(1+yx)(1+yx)(1+yx^2)(1+yx^2)....(1+yx^10)
  43.  
  44. The term of this very big polynomial with the exponent y^5 represent
  45. the ways to pick 5 cards. Of those, the coefficients on items with
  46. x^N represent the number of ways to make a point value of N. The
  47. "intuition" here is that for each card, we can either not include it
  48. (the "1" part of each term) or we can include it and cause the number
  49. of cards and the value of go up ("y" by one and "x" by the value of
  50. the card). Multiplication of the terms gives us all possible
  51. combinations.
  52.  
  53. You might be able to translate that reasoning into some more direct
  54. counting approach, but it would probably be a quite complicated
  55. recurrence.
  56.  
  57. For an easier example, suppose you just had {1, 1, 1, 2, 2, 2} in the
  58. deck and a 2-card hand, then the generating function is
  59.  
  60. G(x,y) = (1+yx)(1+yx)(1+yx)(1+yx^2)(1+yx^2)(1+yx^2)
  61.  
  62. Using Wolfram Alpha to do the algebra, that expands to:
  63. 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
  64. 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
  65. y+1
  66. if we look at the terms for y^2 they are
  67. 3 x^4 y^2
  68. 9 x^3 y^2
  69. 3 x^2 y^2
  70.  
  71. So there are 3 ways to make 4 points, 9 ways to make 3 points, and 3
  72. ways to make 2 points. We can check that since there are thee ways to
  73. pick two from (2, 2, 2), three ways to pick two from (1, 1, 1), and to
  74. make 3 points we need one card from each value, so there are 9 ways.
  75.  
  76. I have attached the python code I used, which comes with no guarantee
  77. that it is actually correct. :)
  78.  
  79. Mark Gritter
  80. (not Dr., unfortunately)
  81. [Quoted text hidden]
  82. [Quoted text hidden]
  83. [Quoted text hidden]
  84.  
  85. tonk.py
  86. 3K
  87. Akash Levy <akashlevy@gmail.com> Sun, May 19, 2013 at 6:15 PM
  88. To: Mark Gritter <mgritter@cs.stanford.edu>
  89. 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.
  90. [Quoted text hidden]
  91. --
  92. Sincerely,
  93. Akash
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement