TomVerhoeff. Technische Universiteit Eindhoven Faculty of Math. & Computing Science Software Construction



Similar documents
Stat 20: Intro to Probability and Statistics

GAMES WITH ONE DIE Games where you only use a single die can be plenty exciting indeed. Here are two good examples of this!

Question 1 Formatted: Formatted: Formatted: Formatted:

Played With Five Standard Six-Sided Dice. by Paul Hoemke

Probability Distribution for Discrete Random Variables

Elementary Statistics and Inference. Elementary Statistics and Inference. 16 The Law of Averages (cont.) 22S:025 or 7P:025.

AMS 5 CHANCE VARIABILITY

Thursday, November 13: 6.1 Discrete Random Variables

Ready, Set, Go! Math Games for Serious Minds

Paper 1. Calculator not allowed. Mathematics test. First name. Last name. School. Remember KEY STAGE 3 TIER 6 8

Blackjack Counter database Omega II Count System

What is the Probability of Pigging Out

Settling Multiple Debts Efficiently: Problems

Sequential lmove Games. Using Backward Induction (Rollback) to Find Equilibrium

Sue Fine Linn Maskell

The game of roulette is played by throwing a small ball onto a rotating wheel with thirty seven numbered sectors.

X: Probability:

rattlebones_rules_mas.indd :59

Ch. 13.2: Mathematical Expectation

Feb 7 Homework Solutions Math 151, Winter Chapter 4 Problems (pages )

That s Not Fair! ASSESSMENT #HSMA20. Benchmark Grades: 9-12

Solutions for Review Problems for Exam 2 Math You roll two fair dice. (a) Draw a tree diagram for this experiment.

Unit 19: Probability Models

MAKING MATH MORE FUN BRINGS YOU FUN MATH GAME PRINTABLES FOR HOME OR SCHOOL

Northumberland Knowledge

Monte-Carlo Methods. Timo Nolle

BNG 202 Biomechanics Lab. Descriptive statistics and probability distributions I

Exam 3 Review/WIR 9 These problems will be started in class on April 7 and continued on April 8 at the WIR.

Everyday Math Online Games (Grades 1 to 3)

The Rational Gambler

Discrete Math in Computer Science Homework 7 Solutions (Max Points: 80)

Rules of core casino games in Great Britain

15-251: Great Theoretical Ideas in Computer Science Anupam Gupta Notes on Combinatorial Games (draft!!) January 29, 2012

Betting systems: how not to lose your money gambling

Introduction Solvability Rules Computer Solution Implementation. Connect Four. March 9, Connect Four

Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test

University of California, Los Angeles Department of Statistics. Random variables

Ch5: Discrete Probability Distributions Section 5-1: Probability Distribution

General Controls 3. Game Night Done Right! 5. Your Game Show 9 SORRY! SLIDERS 11 SCRABBLE FLASH 18 YAHTZEE BOWLING 23 BOP IT 30

Contemporary Mathematics Online Math 1030 Sample Exam I Chapters No Time Limit No Scratch Paper Calculator Allowed: Scientific

The Normal Approximation to Probability Histograms. Dice: Throw a single die twice. The Probability Histogram: Area = Probability. Where are we going?

Third Grade Math Games

$ ( $1) = 40

E3: PROBABILITY AND STATISTICS lecture notes

Zero: If P is a polynomial and if c is a number such that P (c) = 0 then c is a zero of P.

Loss rebates. December 27, 2004

Solution. Solution. (a) Sum of probabilities = 1 (Verify) (b) (see graph) Chapter 4 (Sections ) Homework Solutions. Section 4.

CONNECTING THE DOTS DOMINO MATH GAMES STEPHANIE GARCIA

Bayesian Tutorial (Sheet Updated 20 March)

Spaceball7. Manual Outlet Version 1

Chicago Booth BUSINESS STATISTICS Final Exam Fall 2011

Chapter 4 Lecture Notes

Thursday, October 18, 2001 Page: 1 STAT 305. Solutions

Colored Hats and Logic Puzzles

Laboratory work in AI: First steps in Poker Playing Agents and Opponent Modeling

Mathematical goals. Starting points. Materials required. Time needed

2. More Use of the Mouse in Windows 7

How to Play. Player vs. Dealer

Lab 11. Simulations. The Concept

1 Combinations, Permutations, and Elementary Probability

Download a huge range of popular boardgame rules summaries, reference sheets and player aids at

Chapter 20: chance error in sampling

Chapter What is the probability that a card chosen from an ordinary deck of 52 cards is an ace? Ans: 4/52.

Financial Literacy Meeting Ideas Daisy Financial Literacy Games and Activities

Elementary Statistics and Inference. Elementary Statistics and Inference. 17 Expected Value and Standard Error. 22S:025 or 7P:025.

Solution Let us regress percentage of games versus total payroll.

Hoover High School Math League. Counting and Probability

Explore the world of Catan online at

A Comprehensive Probability Project for the Upper Division One-Semester Probability Course Using Yahtzee

Ch. 13.3: More about Probability

Math Board Games. For School or Home Education. by Teresa Evans. Copyright 2005 Teresa Evans. All rights reserved.

PROBABILITY SECOND EDITION

Contemporary Mathematics- MAT 130. Probability. a) What is the probability of obtaining a number less than 4?

A wargame with dynamic pieces for two to six players. by Jonathan A. Leistiko

The Impact of a Finite Bankroll on an Even-Money Game

Introductory Probability. MATH 107: Finite Mathematics University of Louisville. March 5, 2014

Topic 9 ~ Measures of Spread

Gaming the Law of Large Numbers

Hooray for the Hundreds Chart!!

Section 6.2 Definition of Probability

The Taxman Game. Robert K. Moniot September 5, 2003

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question.

Mental Maths module for the Foundation Phase

Settlers of Catan Analysis

Programming Your Calculator Casio fx-7400g PLUS

MA 1125 Lecture 14 - Expected Values. Friday, February 28, Objectives: Introduce expected values.

INSTRUCTIONS TO CANDIDATES

MAS108 Probability I

Worldwide Casino Consulting Inc.

Expect the Unexpected When Teaching Probability

Measuring the Performance of an Agent

BIG MATHS A GUIDE FOR PARENTS AND CARERS

Chapter 11 Monte Carlo Simulation

Using games to support. Win-Win Math Games. by Marilyn Burns

Branch-and-Price Approach to the Vehicle Routing Problem with Time Windows

CARD RPG ADVANCED. Based on CardRPG originally created by Ray of Ash Edited by Stephen A. Rogers

Maths Targets for pupils in Year 2

Savvy software agents can encourage the use of second-order theory of mind by negotiators

Transcription:

Optimal Solitaire Yahtzee Strategies TomVerhoeff Technische Universiteit Eindhoven Faculty of Math. & Computing Science Software Construction T.Verhoeff@TUE.NL http://www.win.tue.nl/~wstomv/yahtzee/ *) Yahtzee is a registered trademark of the Milton Bradley Company. c 1999 2004, Tom Verhoeff Yahtzee 1

Micro Yahtzee: Equipment & Rules ONE fair die : values 1 [ ] to 6 [..], equiprobable TWO primary categories on score card, each used once: Category Double Square TOTAL Score value doubled value squared sum above PLAY: roll, choose category, score, roll, score in other category AIM: maximize total score Yahtzee 2

Micro Yahtzee: Dilemma Empty score card: Category Score Double... Square... TOTAL... What to do if first roll is 4? Score 8 in Double? Score 16 in Square? Yahtzee 3

Game Tree roll Turn 1 Turn 2 choose roll choose Begin 1 1 2 2 3 Dbl 3 4 4 Sqr 5 5 6 6 Sqr End Yahtzee 4

Micro Yahtzee: Analysis Number of games: 6 2 6 1=72 Number of deterministic strategies: 2 6 1 6 =64 Probability of each game: 1 6 16 =0.02777... Yahtzee 5

Solving Micro Yahtzee Dice rolls are independent: probability of game is product Event scores are independent: total score is sum Merge equivalent states Game Graph For each state, compute optimal expected additional score Start at the end (without choice), work backwards Yahtzee 6

Micro Yahtzee: Game Graph Begin 1 2 3 Double 1 2 3 4 5 6 Square En 4 5 6 Square 1 2 3 4 5 6 Double Roll Choose Roll "Choose" Copyright (c) 2004, Tom Verhoeff

Micro Yahtzee: Expected Scores 1/6 x 1/6 x 1/6 x 1/6 x 2 + 1 + 4 + 1 + 1/6 x 4 + 9 + 4 + 16 + 6 + 25 + 9 + 36 + 8 + 2 + 1/6 x 16 + 4 + 1/6 x 10 + 25 + 12 + 1/6 x 6 + 8 + 10 + 36 + 12 + Roll Choose Roll "Choose" Copyright (c) 2004, Tom Verhoeff

25 17/18 Micro Yahtzee: Optimal Expectation 1/6 x 1/6 x 1/6 x 1/6 x 17 1/6 19 1/6 21 1/6 4 2 + 1 + 9 4 + 15 1/6 1 + 1/6 x 16 4 + 9 + 4 + 25 16 + 6 + 9 + 36 25 + 36 + 8 + 23 1/6 2 2 + 1 1/6 x 1/6 x 32 43 16 + 10 + 25 + 12 + 36 + 7 1/6 x 4 6 8 10 4 + 6 + 8 + 10 + 12 + Roll Choose Roll 12 "Choose" Copyright (c) 2004, Tom Verhoeff

Yahtzee Equipment 5 Dice: values 1 to 6, equiprobable 1 Score Card: 13 primary categories Yahtzee 7

Yahtzee Score Card Category Score Aces... Twos... Threes... Upper Fours... Fives... Section Sixes... Upper Section Bonus... Three of a Kind... Four of a Kind... Full House... Lower Small Straight... Large Straight... Section Yahtzee... Chance... Extra Yahtzee Bonus... GRAND TOTAL... Yahtzee 8

Official Yahtzee Playing Rules Take empty score card repeat Roll all dice Keep any dice, reroll other dice Keep any dice, reroll other dice Score roll in any empty primary category until all primary categories scored Calculate GRAND TOTAL for final score *) Player is free to choose among options Aim : Maximize final score Yahtzee 9

Official Yahtzee Scoring Rules Category Condition Score Aces sum 1s Twos sum 2s Threes sum 3s Fours sum 4s Fives sum 5s Sixes sum 6s U. S. Bonus U.S.Tot 63 35 once Three of a Kind 3 equals sum values Four of a Kind 4 equals sum values Full House 2+3 equals 25 Small Straight 4inseq. 30 Large Straight 5inseq. 40 Yahtzee 5 equals 50 Chance sum values Extra Y. Bonus 5 equals & 50 at Y. 100 each GRAND TOTAL sum above Yahtzee 10

Joker Rule *) 5 ys act here as Joker, provided Category ys in Upper Section has already been scored, and Yahtzee has already been scored Yahtzee 11

Dilemmas First turn, first roll: 1 1 6 6 6 What to do? Keep 6 6 6? Keep all and score 25 in Full House? First turn, second roll: 1 1 3 4 6 What to do? First turn, third roll: 6 6 6 6 1 What to do? Score 24 in Sixes? Score 25 in Four of a Kind? Yahtzee 12

Random Play (without Bonuses and Jokers) Expected Category Probability Score Aces 1 0.83 Twos 1 1.67 Threes 1 2.50 Fours 1 3.33 Fives 1 4.17 Sixes 1 5.00 Three of a Kind 1656/7776 3.73 Four of a Kind 156/7776 0.35 Full House 300/7776 0.96 Small Straight 1200/7776 4.63 Large Straight 240/7776 1.23 Yahtzee 6/7776 0.04 Chance 1 17.50 GRAND TOTAL 45.95 Yahtzee 13

Optimality Criteria Maximize expected final score Minimize variance in final score Maximize probability to beat High Score Maximize probability to beat opponent Maximize minimum final score Yahtzee 14

roll all choose keepers reroll others choose keepers reroll others choose category Yathzee Turn Tree.............................. 1node 6 5 nodes 6 5 2 5 6 5 7 5 6 5 7 5 2 5 6 5 7 5 7 5 Yahtzee 15

Yahtzee Game Tree Number of games: ( 65 7 5 7 5) 13! 1.7 10 170 Game probabilities: range from ( (6 5 ) 3 ) 13 5.5 10 151 to ( 6 5 ) 13 3.8 10 50 Number of deterministic strategies: 10 10100?? Yahtzee 16

Reduced Yathzee Turn Graph 1node roll all choose keepers reroll others choose keepers reroll others choose category.............................. 252 nodes 462 252 462 252 Yahtzee 17

Reduced Yahtzee Game States Between turns: 2 18 3=786 432 Set of unscored primary categories: 2 13 How much needed for Upper Section Bonus: 64 = 2 6 (0.. 63) Will 5 equals get Extra Yahtzee Bonus: 2 (false, true; only when Yahtzee score box used) Within turns: 1+2 462+3 252 = 1681 Yahtzee 18

Reduced Yahtzee Game States Roll index: 3 (1.. 3) Roll versus Choose: 2 Rolled dice: Kept dice: ( ) 5+6 1 5 = 252 ( ) 5+7 1 5 = 462 Yahtzee 18

Dynamic programming Computational Approach Store optimal-expected-additional-scores to avoid recomputation Two-level Store optimal-expected-additional-score between turns only: Table of 786 432 reals of 8 byte = 6 MB Recompute within turns Self-initializing Compute required states only: 536 448 Yahtzee 19

And now what? Characterize optimal strategies Exact results versus simulation Compare to other strategies E.g. random play Investigate effect of rule changes E.g. 2 or 4 rolls per turn, no Jokers,... Yahtzee 20

What s in it for you? Optimal Solitaire Yahtzee Player Submit your game state on WWW and get advice Yahtzee Proficiency Test Play game on WWW and get analysis Also available as stand-alone PC program Yahtzee 21

Approximate Results Numeric Evaluation: Evalute exact recipe with finite precision Issues: numeric stability (rounding, cancellation) how many bits precision Simulation: Take average over a number of instances Issues: quality of random number generator how many instances (variance) Yahtzee 22

Dilemmas Resolved First turn, first roll: 1 1 6 6 6 Keep 6 6 6: 265.12 ± 61 Keep all and score 25 in Full House: 253.91 ± 57 First turn, second roll: 1 1 3 4 6 Keep 3 4: 245.17 ± 57 Keep 1 1: 245.14 ± 57 Keep 4: 244.96 ± 57 Keep 3: 244.74 ± 57 Keep none: 244.55 ± 57 Keep 6: 244.52 ± 57 Yahtzee 23

Dilemmas Resolved First turn, third roll: 6 6 6 6 1 Score 24 in Sixes: 268.23 ± 53 Score 25 in Four of a Kind: 260.54 ± 54 Yahtzee 23

Optimal Strategy Trivia Expected final score: 254.59 ± 60 Median final score: 248 Best roll in first turn: yyyyy Score 50 in Yahtzee: 320.84 ± 83 Worst first roll in first turn: 1 1 2 3 6 Keep 6: 249.83 ± 58 Yahtzee 24

Optimal Strategy Trivia Worst third roll in first turn: 2 3 4 4 6 Score 19 in Chance: 238.96 ± 57 Minimum score: 12 Yahtzee 24

Final Scores per Category for Optimal Strategy Category E SD % 0 Aces 1.88 1.22 10.84 Twos 5.28 2.00 1.80 Threes 8.57 2.71 0.95 Fours 12.16 3.29 0.60 Fives 15.69 3.85 0.50 Sixes 19.19 4.64 0.53 U. S. Bonus 23.84 16.31 31.88 Three of a Kind 21.66 5.62 3.26 Four of a Kind 13.10 11.07 36.34 Full House 22.59 7.38 9.63 Small Straight 29.46 3.99 1.80 Large Straight 32.71 15.44 18.22 Yahtzee 16.87 23.64 66.26 Chance 22.01 2.54 0.00 Extra Y. Bonus 9.58 34.08 91.76 GRAND TOTAL 254.59 59.61 0.00 Yahtzees Rolled 0.46 0.69 63.24 Jokers Applied 0.04 0.19 96.30 Yahtzee 25

Final Scores, playing w/o Extra Yahtzee Bonus and Jokers Category E SD % 0 Aces 1.82 1.14 9.19 Twos 5.25 1.95 1.31 Threes 8.57 2.65 0.59 Fours 12.19 3.24 0.46 Fives 15.74 3.81 0.40 Sixes 19.29 4.61 0.46 U. S. Bonus 24.14 16.19 31.02 Three of a Kind 22.23 5.50 3.44 Four of a Kind 13.04 11.44 39.38 Full House 22.86 6.99 8.54 Small Straight 29.53 3.71 1.55 Large Straight 33.04 15.16 17.40 Yahtzee 15.89 23.28 68.21 Chance 22.26 2.44 0.00 GRAND TOTAL 245.87 39.82 0.00 Yahtzees Rolled 0.41 0.61 64.76 Jokers Applied Yahtzee 26

Distribution of Final Score for Optimal Strategy Score range % Cum.% 100 119 0% 0% 120 139 0% 0% 140 159 2% 2% 160 179 3% 5% 180 199 9% 14% 200 219 13 % 27 % 220 239 14 % 41 % 240 259 20 % 60 % 260 279 19 % 80 % 280 299 6% 86% 300 319 5% 90% 320 339 2% 92% 340 359 1% 93% 360 379 1% 94% 380 399 2% 96% 400 419 2% 98% 420 439 1% 99% 440 459 0% 99% 460 479 0% 99% Yahtzee 27

Distribution, playing w/o Extra Yahtzee Bonus and Jokers Score range % Cum.% 100 119 0% 0% 120 139 0% 0% 140 159 2% 2% 160 179 3% 5% 180 199 9% 14% 200 219 13 % 27 % 220 239 14 % 40 % 240 259 21 % 61 % 260 279 21 % 82 % 280 299 8% 90% 300 319 6% 97% 320 339 3% 100 % 340 359 0% 100 % Results based on simulation of 10 5 games Yahtzee 28

Cumulative Distribution of Optimal Final Score Final score % Games f scoring <f 152 1% 180 5% 195 10 % 218 25 % 248 50 % 273 75 % 319 90 % 388 95 % 474 99 % Results based on simulation of 10 6 games Yahtzee 29

Cumulative Distribution of Final Score Without Extra Yahtzee Bonus and Jokers Final score % Games f scoring <f 152 1% 180 5% 195 10 % 218 25 % 248 50 % 271 75 % 299 90 % 317 95 % 327 99 % Results based on simulation of 10 6 games Yahtzee 30

Earliest Scoring per Category for Optimal Strategy Earliest turn scoring Category Non-Zero Zero Aces 1 2 Twos 1 3 Threes 1 4 Fours 1 5 Fives 1 6 Sixes 1 9 Three of a Kind 1 7 Four of a Kind 2 2 Full House 1 5 Small Straight 1 10 Large Straight 1 7 Yahtzee 1 3 Chance 1 never Yahtzee 31

Last Turn Values per Category (w/o Extra Yahtzee Bonus) Category E SD % 0 Aces 2.11 1.10 6.49 Twos 4.21 2.21 6.49 Threes 6.32 3.31 6.49 Fours 8.43 4.42 6.49 Fives 10.53 5.52 6.49 Sixes 12.64 6.62 6.49 Three of a Kind 15.19 10.42 28.76 Four of a Kind 5.61 9.66 72.26 Full House 9.15 12.04 63.39 Small Straight 18.48 14.59 38.40 Large Straight 10.61 17.66 73.47 Yahtzee 2.30 10.48 95.40 Chance 23.33 3.16 0.00 Yahtzee 32

Game with Minimum Score of Optimal Strategy Turn Third Roll Score in Category 1 14455 1 Aces 2 12355 2 Twos 3 11226 0 Four of a Kind 4 12246 0 Yahtzee 5 11226 0 Threes 6 12233 0 Fours 7 12233 0 Fives 8 12233 0 Full House 9 12233 0 Sixes 10 11233 0 Large Straight 11 11223 9 Chance 12 45566 0 Three of a Kind 13 56666 0 Small Straight 12 GRAND TOTAL Yahtzee 33

Game of Optimal Strategy against Demonic Dice Turn Roll/Keep Score in Category 1 11236 123 5 6 12356 1 Aces 2 11236 1 1 1 26 11134 10 Three of a Kind 3 11236 11136 11356 0 Four of a Kind 4 11126 11126 12355 2 Twos 5 11226 12226 22246 0 Yahtzee 6 12222 12222 12226 0 Threes 7 23333 23333 22223 0 Fours Yahtzee 34

Game against Demonic Dice (cont d) Turn Roll/Keep Score in Category 8 12222 23333 22223 0 Fives 9 12222 12222 22234 0 Full House 10 22555 23333 22223 0 Sixes 11 22266 12222 22223 0 Large Straight 12 22266 12222 11112 6 Chance 13 56666 55666 56666 0 Small Straight 19 GRAND TOTAL Yahtzee 35

Remaining Challenges Best strategy to beat given High Score Approximation via normal distribution and computed mean & variance Optimal premature stopping Best strategy for Group Yahtzee Approximation Yahtzee 36

References Our website since 1999: joint work with Erik Scheffers Hans van Maanen. Ook Yahtzee bezwijkt, Het Parool, 9-Oct- 1999 Felix Holderied. German website since 1999 Olaf Vancura. Advantage Yahtzee. Huntington Press, 2001 Phil Woodward. Yahtzee: The Solution, Chance 16(1):17-20 (Winter 2003) Yahtzee 37