Playing Tonk Statistically

23
Playing Tonk Statistically By: Akash Levy

description

Playing Tonk Statistically. By: Akash Levy. Introduction. Statistics from a historical perspective What is tonk? What are its rules? How can we use statistics to play tonk profitably?. Rules of Allderdice Tonk. - PowerPoint PPT Presentation

Transcript of Playing Tonk Statistically

Page 1: Playing Tonk Statistically

Playing Tonk Statistically

By: Akash Levy

Page 2: Playing Tonk Statistically

Introduction

• Statistics from a historical perspective• What is tonk?• What are its rules?• How can we use statistics to play tonk profitably?

Page 3: Playing Tonk Statistically

Rules of Allderdice Tonk• Each player is dealt 5 cards (sometimes 7). Play usually proceeds clockwise,

starting left of the dealer.• Each turn, a player picks up a card from either the deck or the discard pile or

“drops”.• The player must then discard a card in his or her hand. Before discarding, this

player can play down a “spread” which is either 3 or 4 cards of the same rank (ex: 4H, 4D, 4C or QH, QD, QC, QS) or three or more consecutive cards from the same suit (ex: 4H, 5H, 6H or 10C, JC, QC, KC). A player can also “hit” an existing spread, meaning adding another card to an existing spread. A player whose hand is hit cannot drop for a number of turns equivalent to the number of cards added to the spread.

Page 4: Playing Tonk Statistically

More Rules of Allderdice Tonk• The goal of the game is to get rid of all of the cards in your hand or “drop” successfully. In Allderdice

tonk, the last person with cards in his or her hand (the loser) pays the first person to have no cards in his or her hand (the winner).

• “Dropping” means putting the cards in your hand on the table with the challenge that nobody is “lower” than you. To calculate how low you are, you add up the points in your hand where aces are one point, 2-9 are a number of points corresponding to the number on the card and 10, J, Q, K (also known as bricks) are ten points. If you drop and have the lowest hand, you win one unit of money from the loser, but if someone else is lower than you (“catches” you), you pay that person one unit of money. This means that if you are playing against just one other player and you “get caught”, you lose two dollars. With more than two players, the play continues and the loser also pays the winner.

• In Allderdice tonk, starting with a hand with all bricks is called a “tonk”. A player who gets a tonk automatically wins.

• Also, if a player plays down all of their spreads at once before anyone else wins, it is called a “bonkey”. The person who bonkeys is payed two units of money by the loser.

Page 5: Playing Tonk Statistically

My Objectives

• Discover how low you should be to drop on the first turn with:

- 5 cards, one other player- 7 cards, one other player

Page 6: Playing Tonk Statistically

Plan for finding profitable first-turn drop

• Our calculations can only serve as an approximation because actual calculations are incredibly complicated

• One assumption we cannot make is independence assumption

• We are going to make this assumption anyways to simplify calculations (by using a normal model)

• What is the approximate mean and standard deviation?

Page 7: Playing Tonk Statistically

Mean

• Expected value for one card: • Expected value for five cards assuming independence of

card values: • Expected value for seven cards assuming independence of

card values: Note: Expected values for five cards and seven cards are approximations because we assume independence.

Page 8: Playing Tonk Statistically

Standard Deviations

• Standard deviation for one card: • Approximate standard deviation for five cards (assuming

independence): • Approximate standard deviation for seven cards (assuming

independence): • Note: The more cards we use, the more normal the

distribution becomes.

Page 9: Playing Tonk Statistically

Calculating expected pay for one other player

• Five cards:

• Seven cards:

Page 10: Playing Tonk Statistically

Calculating points in terms of expected pay

• So when should we drop when playing against one player?

Page 11: Playing Tonk Statistically

Calculating points in terms of expected pay

• Five cards, one person:

• Seven cards, one person:

Page 12: Playing Tonk Statistically

So when should we drop based on these approximations?

Very Low Risk

Low Risk Medium Risk

High Risk Breakeven

Five-card 20 points (19.76)

24 points (23.66)

27 points (26.76)

28 points (28.30)

30 points (29.66)

$0.90 $0.70 $0.40 $0.20 $0.003.33% 10% 20% 26.67% 33.33%

Seven-card 30 points (30.47)

35 points (35.08)

39 points (38.75)

41 points (40.57)

42 points (42.18)

$0.90 $0.70 $0.40 $0.20 $0.003.33% 10% 20% 26.67% 33.33%

Page 13: Playing Tonk Statistically

Approximations? Why not exact answers?

• The more complicated question• What we can and can’t reasonably do• Using an exact model• Why lack of independence is almost impossible to solve

Page 14: Playing Tonk Statistically

The exact answer (not using normal model)

• Mark Gritter’s post on twoplustwo forum• Contacted him• Got reply on how to find the exact answer• Binomial model except calculations are more complicated

• Independence is not factored in (as before)• Generating functions

Page 15: Playing Tonk Statistically

The generating function for the situation

• G(x,y) = (1+yx)(1+yx)(1+yx)(1+yx)(1+yx^2)(1+yx^2)....(1+yx^10)

The full version: (1+y x)^4 (1+y x^2)^4 (1+y x^3)^4 (1+y x^4)^4 (1+y x^5)^4 (1+y x^6)^4 (1+y x^7)^4 (1+y x^8)^4 (1+y x^9)^4 (1+y x^10)^16• When expanded, the coefficients of the y^5 term

represent the ways to pick five cards, the coefficients of the y^7 term represent the ways to pick seven cards

Page 16: Playing Tonk Statistically

How we go about finding the coefficients

• Wolfram Mathematica, of course expr := (1 + y x)^4 (1 + y x^2)^4 (1 + y x^3)^4 (1 + y x^4)^4 (1 + y x^5)^4 (1 + y x^6)^4 (1 + y x^7)^4 (1 + y x^8)^4 (1 + y x^9)^4 (1 + y x^10)^16Coefficient[Expand[expr], y, n]Where n is the number of cards in a hand

Page 17: Playing Tonk Statistically

5 card coefficients

4 x6+28 x7+92 x8+240 x9+484 x10+920 x11+1552 x12+2492 x13+3784 x14+5724 x15+8344 x16+11988 x17+16520 x18+22144 x19+28948 x20+36708 x21+45584 x22+55712 x23+67600 x24+79416 x25+92416 x26+103808 x27+115520 x28+125188 x29+134052 x30+140224 x31+146936 x32+149268 x33+147784 x34+143676 x35+136344 x36+127484 x37+116832 x38+105176 x39+92548 x40+82176 x41+65532 x42+52556 x43+40436 x44+31216 x45+22496 x46+16720 x47+10640 x48+7280 x49+4368 x50

Page 18: Playing Tonk Statistically

7 card coefficients 4 x10+28 x11+112 x12+324 x13+816 x14+1756 x15+3500 x16+6412 x17+11244 x18+18808 x19+30708 x20+48248 x21+74192 x22+110616 x23+160820 x24+227920 x25+316304 x26+430120 x27+574284 x28+753648 x29+969672 x30+1229020 x31+1527544 x32+1869768 x33+2249888 x34+2672392 x35+3121136 x36+3599624 x37+4081096 x38+4564636 x39+5027272 x40+5458256 x41+5838524 x42+6166904 x43+6420560 x44+6581968 x45+6655796 x46+6617080 x47+6491440 x48+6265512 x49+5963204 x50+5579928 x51+5158940 x52+4665228 x53+4152412 x54+3625196 x55+3110448 x56+2614660 x57+2163248 x58+1742460 x59+1378308 x60+1061616 x61+780240 x62+564256 x63+395056 x64+268128 x65+172368 x66+109200 x67+58240 x68+32032 x69+11440 x70

Page 19: Playing Tonk Statistically

The exact graphs

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 500

20000

40000

60000

80000

100000

120000

140000

160000

Count for 5 card

Page 20: Playing Tonk Statistically

The exact graphs

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 690

1000000

2000000

3000000

4000000

5000000

6000000

7000000

Count for 7 cards

Page 21: Playing Tonk Statistically

How good was the approximation using the normal model?

• Pretty good, actually. • If we compare some values:Probability of getting caught (normal model) for 24 points, 5 cards: 0.1088 Probability of getting caught (exact) for 24 points, 5 cards: 0.1188Approximate Difference: 0.0100Probability of getting caught (normal model) for 35 points, 7 cards: 0.09835Probability of getting caught (exact) for 35 points, 7 cards: 0.09932Approximate Difference: 0.00097• Nice!

Page 22: Playing Tonk Statistically

Additional calculations just for fun

• Probability of getting a tonk with 5 cards:

• Probability of getting a tonk with 7 cards:

• Probability of getting a tonk with n cards:

Page 23: Playing Tonk Statistically

Thank you!Credits/Links: • http://www.learningpythonprogramming.com/2011/03/python-card-games.html• http://docs.scipy.org/doc/numpy/reference/generated/numpy.std.html• http://forumserver.twoplustwo.com/25/probability/tonk-odds-dropping-issues-12770

60/

• http://forumserver.twoplustwo.com/21/draw-other-poker/profitably-dropping-tonk-315444/

• http://www.pagat.com/rummy/tonk.html• http://markgritter.livejournal.com/711360.html• http://pastebin.com/cF9jG2BA