15. Games of Chance
Total Page:16
File Type:pdf, Size:1020Kb
15. Games of Chance Robert Snapp [email protected] Department of Computer Science University of Vermont Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 1 / 66 1 A Little History 2 Coin Tossing Pascal’s Triangl Binomial Coefficients 3 The Game of Craps 4 Probability Theory Independence Geometric Series Expected Reward 5 Lotteries Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 2 / 66 The History of Games of Chance Games of chance are rooted in divination. 1 In belomancy arrows in a quiver are labeled according to different military options. The first arrow chosen from the quiver, or the one that flew the farthest, indicated the selection. A biblical reference to belomancy occurs in the book of Ezekial 21:21, “He shakes his arrows.” 2 The Korean game of chance, Nyout, is used for divination on the 15th day of the first month of the year (Hargrave, 1930). 3 Labeled yarrow sticks are thrown at random, and read for prophesy according to the Chinese I Ching. 4 Herodotus (The Histories) describes Scythian soothsayers, who spread bundles of sticks on the ground, for divination. 5 Suetonius (Divus Julius, XXXII) asserts that Julius Ceasar uttered “Jacta alea est,” or “The die is cast,” as he crossed the Rubicon in 49 B.C. on his return Rome. 6 Tarot cards, used since the middle ages in Europe for predicting fortunes. 7 Fortune cookies! Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 3 / 66 Kleromancy Sheep knucklebones, or astragali, usually land in one of four different positions, which are assigned the values 1, 3, 4, and 6. In Ancient Greece five were thrown together, and the resulting sum was identified on a table of prophesies. From the oracular tables of Adada and Limyra: You will have a difficult harvest season. You have this righteous judgement from the gods. Succeeding, friend, you will fulfill a golden oracle. Having done something carelessly, you will blame the Gods. The affair holds a noble understanding. You will have a parting from the companions now around you. Phoibos [Apollo] speaks plainly, “Stay, friend.” You will go on more easily if you wait a short time.” The four final positions of astragali; From left to right, one, three, four, and six points. From Jean-Marie L’Hôte, Histoire Completing many contests, you will seize the crown. des Jeux de Société, Flammarion, Paris, 1994, p. 566. There are not crops to be reaped that were not sown. There is nor fruit to take from a withered shoot. The strife-bearing gift fulfills the oracle. It is necessary to labor, but the change will be admirable. C. Knutson, Early Games of Dice, MacGregor Historic Games, www.historicgames.com, 2004. W. R. Halliday, Greek Divination: A Study of its Methods and Principles, Macmillin, London, 1913. (www.ancientlibrary.com/divination) Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 4 / 66 Astragali Knucklebones were also used in games. Hellenistic terra cotta. Capoue, Italy. 330–300 BCE. British Museum, London. From Jean-Marie L’Hôte, Histoire des Jeux de Société , Flammarion, Paris, 1994, p. 19. Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 5 / 66 The Game of Jacks? Two girls playing jacks with knucklebones in the lower-left corner of Pieter Bruegel’s Kinderspiele. Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 6 / 66 Cowrie Shell Dice: India, 19th century (Colin Mackenzie & Irving Finkel, Asian Games: The Art of Contest, Asia Society, 2004, page 42.) Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 7 / 66 Stick Dice: India, 19th century (Colin Mackenzie & Irving Finkel, Asian Games: The Art of Contest, Asia Society, 2004, page 40.) Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 8 / 66 Cubic Dice: India, 19th century (Colin Mackenzie & Irving Finkel, Asian Games: The Art of Contest, Asia Society, 2004, page 38.) Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 9 / 66 Many sided dice: China, Han dynasty, 206 BCE– 220 CE (Colin Mackenzie & Irving Finkel, Asian Games: The Art of Contest, Asia Society, 2004, page 43.) Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 10 / 66 Coin Tossing A coin offers two outcomes: H or T. (One may think of a coin as a two-sided die.) Let’s now consider a sequence of coin tosses. For example, if a coin is tossed three times, we might see HTT (indicating that the first toss lands heads, and the subsequent two tosses land tails). Other possibilities are THT, TTT, etc. How many different sequences of length three exist? This question can be answered by the multiplication principle. Let n1 denote the number of different possible outcomes for the first toss; n2, for the second toss; and n3 for the third. Here, n1 n2 n3 2: (Why?) D D D Thus by the multiplication principle, the number of different outcomes equals 3 N n1 n2 n3 2 2 2 2 8: D D D D How many different outcomes exist for a sequence of four tosses? How about five tosses? Six tosses? Etc. Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 11 / 66 Coin Tossing (cont.) It is not difficult to list all of the eight possibile sequences: TTT HTT, THT, TTH HHT, HTH, THH HHH. Note that there is only one sequence that contain exactly zero heads (or three tails), three sequences that contain exactly one head, three sequences that contain exactly two heads, and only one that contains exactly three heads. How do these numbers relate to the number of different anagrams that can be formed with each set of letters? How many anagrams can be formed from the letters in the word TTT? How many for HTT? etc. How many different possible sequences exist for four consecutive coin tosses? How many of these contain exactly 0 heads? How many contain 1 head? How many 2 heads? 3 heads? 4 heads? Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 12 / 66 Binary Trees In a binary tree each node has two distinct branches: a left branch, and a right branch. (Some nodes will lack one or both of these, e.g., the leaf nodes). Let the left branch correspond to H and the right branch correspond to T. The level correspond to the location of that toss in the sequence. A binary tree of depth 3 displays every possible outcome of three consecutive coin tosses. H T H T H T H T H T H T H T HHH HHT HTHHTT THH THT TTH TTT Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 13 / 66 Coin Tossing (cont.) If the coin is fair, then roughly one half of a batch of tosses lands H, the remaining tosses being T. We can use probability to express and quantify the regularity in random events. Thus, for a fair coin: P H P T 1=2. f g D f g D What is the probability of getting exactly one heads in three coin tosses? Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 14 / 66 Binary tree for five coin tosses Root Node depth=0 depth=1 depth=2 depth=3 depth=4 depth=5 L e a f N o d e s The number of leaf nodes is 32. The probability of each (for a fair coin) is 1/32. In general, a complete binary tree of depth n has 2n leaf nodes. Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 15 / 66 Coin Tossing: Analysis Consider a sequence of n tosses of a fair coin. For example, HH T H T T T H T H H T „ ƒ‚ … n symbols This sequence corresponds to a particular leaf node of a binary tree of depth n. Since the coin is fair, and there are 2n different leaf nodes on this tree, this sequence of n tosses occurs with probability 1=2n. Let k denote the number of H s in the above sequence. How many T s occur? The number of sequences of n symbols that have k H s and .n k/ T s equals the number of anagrams of that can be created using these symbols: nŠ kŠ .n k/Š Thus, the probability of obtaining k heads and n k tails in a sequence of n tosses (of a fair coin) is nŠ Â1Ãn P.k; n/ : D kŠ .n k/Š 2 Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 16 / 66 Coin Tossing: Analysis nŠ Â1Ãn P.k; n/ D kŠ .n k/Š 2 0.25 n=10 0.20 n=20 0.15 n=40 P.k; n/ 0.10 n=100 0.05 n=200 0.00 0 50 100 150 200 Number of Heads (k) Robert R. Snapp © 2010, 2013 15. Games of Chance CS 32, Fall 2013 17 / 66 Pascal’s Triangle 1 1 1 12 1 13 3 1 1 4 6 4 1 15 10 10 5 1 16 1520 15 6 1 17 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 1 9 36 84 126 126 84 36 9 1 1 10 45 120 210 252 210 120 45 10 1 Robert R.