VK Dice By: Kenny Gutierrez, Vyvy Pham Mentors: Sarah Eichhorn, Robert Campbell.

Slides:



Advertisements
Similar presentations
Beginning Probability
Advertisements

ICAMP: Game Simulation and Analysis Analysis of the Game “Poison” Sarah Eichhorn University of California Irvine iCAMP Overview Meeting, 5/5/10.
Todd W. Neller Gettysburg College
Chapter 5: Probability: What are the Chances?
Solve for x. 28 = 4(2x + 1) = 8x = 8x + 8 – 8 – 8 20 = 8x = x Distribute Combine Subtract Divide.
Activity 1: Where am I? Play in pairs Each player has a number line or bead string and a pack of number cards Each player takes turns to turn over a number.
The Binomial Distribution. In Statistics we often talk about trials. e.g. A seed is sown and the flower is either yellow or not yellow. We mean an experiment,
James Tam Loops In Python In this section of notes you will learn how to rerun parts of your program without having to duplicate the code.
Probability And Expected Value ————————————
Binomial Probability Distribution
Rapid Recall Activities. Retention of facts is key with the New Curriculum Rolling Dice: Rolling a 10-sided dice and making number bonds to 10 Adding.
Check it out! : Simple Random Sampling. Players of a dice game roll five dice and earn points according to the combinations of numbers they roll.
A multiple-choice test consists of 8 questions
Rules of Integers. Positive numbers are numbers that are above zero. Negative numbers are numbers below zero.
Application of Random Variables
The game of Craps Rules of play: 1. Played with two dice (six faces to a die – numbers 1-6 per face) 2. Sequence of betting rounds (or just rounds) 3.
Place value and ordering
Probabilities and Collecting Data. At a school carnival, there is a game in which students spin a large spinner. The spinner has 4 equal sections numbered.
The Binomial Distribution © Christine Crisp “Teach A Level Maths” Statistics 1.
MOM! Phineas and Ferb are … Aims:
Integer Numbers. An integer number is a whole number (not a fraction) that can be positive, negative or zero. Positive integers are all the whole numbers.
8.3 Measures of Dispersion  In this section, you will study measures of variability of data. In addition to being able to find measures of central tendency.
Integer Operations. 1) What’s the rule for adding integers? *If both addends are Positive: - Add together and the sum is positive (Ex = 12) *If.
Topic 11.  The material in this topic is tested any time you do a lab or calculation.  It is extremely important that you follow the rules explained.
DiceRoller DiceRoller (object class) and DiceRollerViewer client class: Write a DiceRoller class (similar to Yahtzee) to: Allow the person to initially.
Connect Four AI Robert Burns and Brett Crawford. Connect Four  A board with at least six rows and seven columns  Two players: one with red discs and.
Integers All whole numbers and their opposites including the number 0.
1.3 Simulations and Experimental Probability (Textbook Section 4.1)
Understanding Randomness
Chapter 16 Probability. Activity Rock-Paper-Scissors Shoot Tournament 1)Pair up and choose one person to be person A and the other person B. 2)Play 9.
Cookie Monster Game By Sailifale Tuiolosega and Johnny Mahu.
Petals Around the Rose. The name of the game is Petals Around the Rose. The name of the game is important. The computer will roll five dice and ask you.
Activity 1: Play Fours Play in pairs Each player has a 3 by 3 grid Take turns to roll 2 dice Calculate the total- each spot is worth 4 points Write your.
Discrete Distributions. Random Variable - A numerical variable whose value depends on the outcome of a chance experiment.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 13 Conditional.
QR 32 Section #6 November 03, 2008 TA: Victoria Liublinska
Chapter 8: Introduction to Probability. Probability measures the likelihood, or the chance, or the degree of certainty that some event will happen. The.
Multiplying and Dividing Signed Integers
Jeopardy Opening Sound: First Round Category 1 Intro Surveys Techniques Surveys Techniques.
Significant Figures SPH3U. Precision: How well a group of measurements made of the same object, under the same conditions, actually agree with one another.
GamblingGambling What are the odds? Jessica Judd.
A Balanced Introduction to Computer Science, 3/E David Reed, Creighton University ©2011 Pearson Prentice Hall ISBN Chapter 13 Conditional.
Goals Your organization has three metrics to measure mission effectiveness Count your successes in each category for each roll 1.Total of exactly thirteen.
Talk about the ethics of calculating probability. Probability – How likely something will occur Probability is usually expressed as a decimal number. A.
Significant Figures. Significant Figure Rules 1) ALL non-zero numbers (1,2,3,4,5,6,7,8,9) are ALWAYS significant. 1) ALL non-zero numbers (1,2,3,4,5,6,7,8,9)
Introduction Imagine the process for testing a new design for a propulsion system on the International Space Station. The project engineers wouldn’t perform.
Chapter 8 Probability Section 1 Sample Spaces, Events, and Probability.
OPERATIONS WITH INTEGERS, ADDING AND SUBTRACTING RATIONAL NUMBERS Objective: To add, subtract, multiply, and divide integers, to compare and order rational.
Uncertainty in Measurement How would you measure 9 ml most precisely? What is the volume being measured here? What is the uncertainty measurement? For.
ADDING AND SUBTRACTING MULTIPLYING AND DIVIDING REAL NUMBERS.
© 2009, Tom McKendree The Systems Engineering Game (Basic Game) 1.0 Introduction This is a game about the systems engineering process, as represented by.
Modelling and Simulating Social Systems with MATLAB
Optimal Play of the Farkle Dice Game
Rapid Recall Activities
Homework 3 (due:May 27th) Deadline : May 27th 11:59pm
Modelling and Simulating Social Systems with MATLAB
5.3 The Central Limit Theorem
Homework 3 (due:June 5th)
Student Activity 1: Fair trials with two dice
Object of the game Yahtzee Large straight Small straight Full house
The Fair Unfair Polarization
Probability And Expected Value ————————————
3rd/4th grade Family Math Night Games
Matthew Renner, Trish Beeksma, Patch Kenny
Object of the game Yahtzee Large straight Small straight Full house
Probability And Expected Value ————————————
Created by _____ & _____
5.3 The Central Limit Theorem
Object of the game Yahtzee Large straight Small straight Full house
Object of the game Yahtzee Large straight Small straight Full house
Presentation transcript:

VK Dice By: Kenny Gutierrez, Vyvy Pham Mentors: Sarah Eichhorn, Robert Campbell

Rules Variation of the game Sequences On each turn, a player rolls 6 dice Player is given option to reroll once but all 1s must be kept Larger sequences are worth more points Three or more 1s = Restart Score Repeats of a certain number is counted once Winner is the first player to reach 100

Scoring 1 – 5 points 1,2 –10 points 1,2,3 –15 points 1,2,3,4 –20 points 1,2,3,4,5 –25 points 1,2,3,4,5,6 –35 points

Objective Optimal Strategy When to Reroll Which dice to keep/reroll Computer Adaptive Learning Program simulate one million rolls for each run. Programmed to run 5 times simultaneously Determined which actions repeated most frequently for all game states Repeated actions of the computer are compared to the Expected Values for each game state.

Description 6^6= 46,656 game states 462 don’t include repetition Different states are grouped into sections according to the same numbers, regardless of repetition [2, 4, 4, 5, 5, 6] [2, 4, 4, 5, 6, 6] [2, 2, 4, 4, 5, 6] [2, 2, 4, 5, 5, 6] [2, 2, 4, 5, 6, 6] [2, 4, 5, 5, 5, 6] [2, 4, 5, 5, 6, 6] [2, 4, 5, 6, 6, 6] [2, 4, 4, 4, 5, 6] [2, 2, 2, 4, 5, 6] [1, 2, 2, 2, 2, 6] [1, 2, 2, 2, 6, 6] [1, 2, 2, 6, 6, 6] [1, 2, 6, 6, 6, 6] [1, 2, 2, 2, 3, 4] [1, 2, 3, 3, 4, 4] [1, 2, 2, 3, 3, 4] [1, 2, 2, 3, 4, 4] [1, 2, 3, 3, 3, 4] [1, 2, 3, 4, 4, 4]

Probability for Game States Sections are further divided into: one 1, two 1s, no 1s The probability is the same within each section Probability is calculated for every reroll option. Game States without 1s (Reroll 1-6 Dice) Game States with one 1 (Reroll 1-5 Dice) Game States with two 1s (Reroll 1-4 Dice)

Cases For Each Reroll Reroll 6 Dice (No 1s) -Get 1,2,3,4,5,6, -Get 1, 2,3,4,5 not 6 -Get 1,2,3,4 not 5, not 1,1,1 -Get 1,2,3 not 4, not 1,1,1 -Get 1,2 not 3, not 1,1,1 -Get 1 not 2, not 1,1,1 Reroll 5 Dice (one 1) -Get 2,3,4,5,6 -Get 2,3,4,5 not 6 -Get 2,3,4 not 5, not 1,1,1 -Get 2,3 not 4, not 1,1,1 Get 2, not 3, not 1,1,1

Ex. Of Calculating Probability Reroll 5 for Initial Game States Without 1s Case A: Get 1,3,4,5,6 5! (1/6)5 Probability= 5/324= 1.54% Case B: Get 1,3,4,5 not 6 * (4) = 5! = 120 * (1 or 3 or 4 or 5) = 4(5!/2!) = 240 Probability= 350/6^5 = 5/108 = 4.63% Case C: Get 1,3,4 not 5, not 111 *1 3 4 (2,2) or (6,6) = 2(5!/2!) = 120 * (2 and 6) = 5! = 120 *1 3 4 (2 or 6) (1 or 3 or 4) = 6(5!/2) = 360 *1 3 4 (4,4) or (3,3) = 2(5!/3!) = 40 *1 3 4 (1,3) or (1,4) or (4,3) = 3(5!/(2! 2!)) = 90 Probability= 730/6^5 = 365/3888 = 9.39% Case D: Get 1, 3, not 4, not 1,1,1 *1 3 (2,2,2) or (5,5,5) or (6,6,6) = 3(5!/3!) = 60 *1 3 (2,5,6) = 5! = 120 *1 3 (2,2) or (5,5) or (6,6) (Different: 2 or 5 or 6) = 6(5!/2!) = 360 *1 3 (2,2) or (5,5) or (6,6) (1 or 3) = 6(5!/(2! 2!)) = 180 *1 3 (3,3,3) = 5!/4! = 5 *1 3 (3,3) (2 or 5 or 6) = 3(5!/3!) = 60 *1 3 (1,3) (2 or 5 or 6) = 3(5!/4) = 90 *1 3 (2,2) or (5,6) or (4,6) (1 or 3) = 6(5!/2!) = 360 *1 3 (1,3,3) = 5! (3! 2!) = 10 Probability = 1245/6^5 = 415/2592 = 16.0% Case E: Get 1, not 3, not 1,1,1 *1 (2,2,2,2) or (4,4,4,4) or (5,5,5,5) or (6,6,6,6) = 4(5!/(2! 2!)) = 20 *1 (2,2,2) or (4,4,4) or (5,5,5) or (6,6,6) (Different: 2,4,5,6) = 12(5/3!) = 240 *1 (2,4,5,6) = 5! = 120 *1 (4,4) or (5,5) or (6,6) or (2,2) Differ: (6,2)(6,4)(4,5)(4,2)(6,5)(5,2)) = 12(5!/2!) = 720 *1 (4,4) or (5,5) or (6,6) or (2,2) Differ: (4,4) (5,5) (6,6) (2,2) = 12(5!/(2! 2!)) = 360 *1 (1) (4,4,4) or (5,5,5) or (6,6,6) or (2,2,2) = 4(5!/(3! 2!)) = 40 *1 (1) (2,2) or (4,4) or (5,5) or (6,6) Differ(2,4,5,6)= 12(5!/ (2! 2!)) = 360 *1 (1) (2,4,5) or (2,4,6) or (4,5,6) = 3(5!/2!) = 180 Probability = 2040/65 = 85/324 = 26.23%

Finding Expected Values Sum of all possible values each multiplied by the probability of its occurrence Example: [1,2,3,4,4,5] Reroll Reroll 1 Keep:2,3,4, Reroll 2 Keep:2,3, Reroll 3 Keep:2, Reroll 4 Keep: Reroll 5 Reroll all Reroll 0 25 Reroll 1 ((5/6)*(25)+(1/6)*(35)) Reroll 2 ((1- (1/18+1/4+1/36))*(20)+(1/18)*(35)+(1/4 )*(25)) Reroll 3 ((1- (1/36+1/9+61/216+2/27))*(15)+(1/36)*( 35)+(1/9)*(25)+(61/216)*(20)) Reroll 4 ((1- (1/54+7/108+91/ / /144) )*(10)+ (1/54)*(35)+(7/108)*(25)+(91/648)*(20) +(311/1296)*(15)) Reroll 5 ((1- (5/324+5/108+25/324+95/648+29/ / 7776))*(5)+(5/324)*(35)+(5/108)*(25)+ (25/324)*(20)+(95/648)*(15)+(29/144)* (10)) Legend Pink: Probability of each cases multiplied by score Yellow: Probability of getting the same score and not 1,1,1

Inside the Program Runs five times Each Run 1,000,000 dice rolls Prints computer’s actions for all game states Learns based on result of each roll through reward and punish system

How Does It Work? Set of six numbers for each initial game state. Each number pertains to one of the six dice Initially, each number in the list contains 50 Program generates random number between for each number. In order to reroll a die, the random number must be between the range 1-(list of number) Ex Game State: [1, 2, 3, 5, 5, 6] List: [55, -10, 32, 87, 98, 103] Random #s: [60, 39, 47, 37, 12, 18] Action: [Keep, Keep, Keep, Reroll, Reroll, Reroll]

Rewarding & Punishing Reward: Certain number of points based on score after re-roll IF final score > initial score Increase probability of repeating that action by either adding or subtracting Adds when the computer rerolled, subtracts when it kept dice Punish: Only when the re-rolls end with at least three 1s Decrease probability to avoid that action by either adding or subtracting Adds when the computer kept dice, subtracts when it rerolled. TABLE FOR PUNISH & REWARD Reward & Punish 5 - ± ± ± ± ± ±7 1,1,1 - ±5

Rewarding & Punishing Computer will never reroll 1, regardless of the number in the list After subtracting and adding to each list, the numbers will eventually go into the negatives or above 100 Negatives= Always Keep (N) Over 100= Always Reroll (Y) Between Undetermined (U)

Best Move Mechanic Mechanism implemented to help computer learn the optimal strategy Before keeping a die, the computer checks if there is a better option Ex. [ 1, 2, 3, 5, 6, 6] If it wants to keep two 6s, it will change to keep 2 and 3.

Comparing Program with Theoretical Probability Examples of each Initial Game States: Without any 1s With one 1 With two 1s Adaptive learning program- used the actions of the dice most common out of the five runs

Initial State without 1s Theoretical Expected Values Optimal Move: Reroll 3 dice; Keeping 2,3,4 Adaptive Learning Program After 5 runs: Most Common Move: Reroll 3 dice; Keeping 2,3,4 Example: [2, 3, 4, 4, 6, 6] Reroll 0 0 Reroll 1 Keep: 2,3, Reroll 2 Keep:2,3,4,6 7.5 Reroll 3 Keep: 2,3, Reroll 4 Keep:2, Reroll 5 Keep: Reroll 6 Reroll All Conclusion: Expected Values matched EXACTLY to the Adaptive Learning Program [2, 3, 4, 4, 6, 6] [N, N, Y, N, Y, Y] [2, 3, 4, 4, 6, 6] [N, N, N, Y, Y, Y] [2, 3, 4, 4, 6, 6] [N, N, N, Y, Y, Y] [2, 3, 4, 4, 6, 6] [N, N, N, Y, Y, Y] [2, 3, 4, 4, 6, 6] [N, N, N, Y, Y, Y]

Initial State With one 1 Theoretical Expected Values Optimal Move: Reroll 1 Dice; Keep 1,2,3,4,6 Adaptive Learning Program 5 Sample Runs: Most Common Move: Reroll 2 Dice; Keeping 1,2,3,4 Example: [1, 2, 3, 3, 4, 6] Conclusion: The expected values and the results from the program were similar. The computer chose the 2 nd best action Reroll 0 20 Reroll 1 Keep:2,3,4, Reroll 2 Keep:2,3, Reroll 3 Keep:2, Reroll 4 Keep: Reroll 5 Reroll all [1, 2, 3, 3, 4, 6] [N, N, N, Y, N,Y] [1, 2, 3, 3, 4, 6] [N, N, Y, N, N, Y] [1, 2, 3, 3, 4, 6] [N, N, Y, N, N, Y] [1, 2, 3, 3, 4, 6] [N, N, N, Y, N, N] [1, 2, 3, 3, 4, 6] [N, N, N, Y, N, Y]

Initial State With two 1s Theoretical Expected Values Optimal Move: Reroll 1 Die; Keeping 1,1,2,4,5 Adaptive Learning Program After 5 runs: Most Common Move: Uncertain Example: [1, 1, 2, 4, 5, 5] Conclusion: There is a high probability of rerolling a 1 so the move is undetermined and needs more runs Reroll Reroll 1 Keep:2, 4, Reroll 2 Keep:2, Reroll 3 Keep: Reroll 4 Reroll All 5 [1, 1, 2, 3, 5, 5] [Y, Y, N, N, Y, N] [1, 1, 2, 3, 5, 5] [Y, Y, U, U, U, U] [1, 1, 2, 3, 5, 5] [Y, Y, U, U, U, U] [1, 1, 2, 3, 5, 5] [U, U, N, N, Y, N] [1, 1, 2, 3, 5, 5] [Y, Y, N, N, U, U]

Conclusion Expected Values were found for ALL game states Adaptive Learning Program with 5 runs and created a list of actions for the 6 dice for every game state. Most common move from the program were compared to the expected values for each game state Program’s common moves were either the best or 2 nd best action indicated by the expected values Game states with double 1s

Acknowledgements Sarah Eichhorn: Helping with the probabilities of the different game states Answering questions every step of the way Robert Campbell: Helping with the computer Program Teaching us how to calculate expected values