Monte Carlo Simulation of the Craps Dice Game Sencer Koç.

Slides:



Advertisements
Similar presentations
YOU DONT KNOW CRAPS!!. An Investigation Using Probability, the Geometric Distribution, and Expected Returns for the Game of Craps By Otto Magdanz and.
Advertisements

Sta220 - Statistics Mr. Smith Room 310 Class #14.
Random variables 1. Note  there is no chapter in the textbook that corresponds to this topic 2.
Simulation Operations -- Prof. Juran.
Session 7a. Decision Models -- Prof. Juran2 Overview Monte Carlo Simulation –Basic concepts and history Excel Tricks –RAND(), IF, Boolean Crystal Ball.
Statistics : Statistical Inference Krishna.V.Palem Kenneth and Audrey Kennedy Professor of Computing Department of Computer Science, Rice University 1.
Markov Chains Extra problems
Sampling Distributions (§ )
Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics Statistics & Econometrics.
The Geometric Distributions Section Starter Fred Funk hits his tee shots straight most of the time. In fact, last year he put 78% of his.
Computational statistics 2009 Random walk. Computational statistics 2009 Random walk with absorbing barrier.
Section 5.7 Suppose X 1, X 2, …, X n is a random sample from a Bernoulli distribution with success probability p. Then Y = X 1 + X 2 + … + X n has a distribution.
Chap 9-1 Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc. Chapter 9 Estimation: Additional Topics Statistics for Business and Economics.
Simulating Normal Random Variables Simulation can provide a great deal of information about the behavior of a random variable.
Using ranking and DCE data to value health states on the QALY scale using conventional and Bayesian methods Theresa Cain.
 The Law of Large Numbers – Read the preface to Chapter 7 on page 388 and be prepared to summarize the Law of Large Numbers.
The Central Limit Theorem For simple random samples from any population with finite mean and variance, as n becomes increasingly large, the sampling distribution.
Normal and Sampling Distributions A normal distribution is uniquely determined by its mean, , and variance,  2 The random variable Z = (X-  /  is.
Standard error of estimate & Confidence interval.
PROBABILITY WITH APPLICATION Random outcome  Example of rolling a die Repeating an experiment  Simulation using StatCrunch Software Probability in Real.
Simulation.
Computer Simulation A Laboratory to Evaluate “What-if” Questions.
1 Terminating Statistical Analysis By Dr. Jason Merrick.
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.
Simulation Output Analysis
Simulation of Random Walk How do we investigate this numerically? Choose the step length to be a=1 Use a computer to generate random numbers r i uniformly.
1 Sampling and Sampling Distributions Dr. Jerrell T. Stracener, SAE Fellow Leadership in Engineering EMIS 7370/5370 STAT 5340 : PROBABILITY AND STATISTICS.
MA3264 Mathematical Modelling Lecture 6 Monte Carlo Simulation.
Monte Carlo Simulation and Personal Finance Jacob Foley.
Monte Carlo Simulation CWR 6536 Stochastic Subsurface Hydrology.
1 Theoretical Physics Experimental Physics Equipment, Observation Gambling: Cards, Dice Fast PCs Random- number generators Monte- Carlo methods Experimental.
Montecarlo Simulation LAB NOV ECON Montecarlo Simulations Monte Carlo simulation is a method of analysis based on artificially recreating.
Section 8.1 Estimating  When  is Known In this section, we develop techniques for estimating the population mean μ using sample data. We assume that.
Monte Carlo Methods Versatile methods for analyzing the behavior of some activity, plan or process that involves uncertainty.
Hit-and-Miss (or Rejection) Monte Carlo Method:
CIS 2033 based on Dekking et al. A Modern Introduction to Probability and Statistics Michael Baron. Probability and Statistics for Computer Scientists,
1.3 Simulations and Experimental Probability (Textbook Section 4.1)
Advance Waiting Line Theory and Simulation Modeling.
Lecture 2 Basics of probability in statistical simulation and stochastic programming Leonidas Sakalauskas Institute of Mathematics and Informatics Vilnius,
Sampling Error SAMPLING ERROR-SINGLE MEAN The difference between a value (a statistic) computed from a sample and the corresponding value (a parameter)
Random Sampling Approximations of E(X), p.m.f, and p.d.f.
Loops Wrap Up 10/21/13. Topics *Sentinel Loops *Nested Loops *Random Numbers.
CDA6530: Performance Models of Computers and Networks Chapter 8: Statistical Simulation --- Discrete-Time Simulation TexPoint fonts used in EMF. Read the.
M ONTE C ARLO SIMULATION Modeling and Simulation CS
1 OUTPUT ANALYSIS FOR SIMULATIONS. 2 Introduction Analysis of One System Terminating vs. Steady-State Simulations Analysis of Terminating Simulations.
The final exam solutions. Part I, #1, Central limit theorem Let X1,X2, …, Xn be a sequence of i.i.d. random variables each having mean μ and variance.
Review Normal Distributions –Draw a picture. –Convert to standard normal (if necessary) –Use the binomial tables to look up the value. –In the case of.
Binomial Probability Section Starter Here’s a game you will like: Let’s bet a dollar on this proposition: I will roll a fair die once. If.
Binomial Distributions Chapter 5.3 – Probability Distributions and Predictions Mathematics of Data Management (Nelson) MDM 4U.
Simulation Chapter 16 of Quantitative Methods for Business, by Anderson, Sweeney and Williams Read sections 16.1, 16.2, 16.3, 16.4, and Appendix 16.1.
Sampling Theory and Some Important Sampling Distributions.
From Wikipedia: “Parametric statistics is a branch of statistics that assumes (that) data come from a type of probability distribution and makes inferences.
MAT 4830 Mathematical Modeling 04 Monte Carlo Integrations
Stat 35b: Introduction to Probability with Applications to Poker Outline for the day: 1.HW4 notes. 2.Law of Large Numbers (LLN). 3.Central Limit Theorem.
Gil McVean, Department of Statistics Thursday February 12 th 2009 Monte Carlo simulation.
Simulations with Binomials Mean and S.D. of Binomials Section
The accuracy of averages We learned how to make inference from the sample to the population: Counting the percentages. Here we begin to learn how to make.
The normal approximation for probability histograms.
The Law of Averages. What does the law of average say? We know that, from the definition of probability, in the long run the frequency of some event will.
Copyright © Cengage Learning. All rights reserved. 8 PROBABILITY DISTRIBUTIONS AND STATISTICS.
Computer Simulation Henry C. Co Technology and Operations Management,
Monte Carlo simulation
Modelling and Simulating Social Systems with MATLAB
Sampling Distributions and The Central Limit Theorem
CS005 Introduction to Programming
Suppose you roll two dice, and let X be sum of the dice. Then X is
Homework #5 — Monte Carlo Simulation
Lecture 2 Binomial and Poisson Probability Distributions
Sampling Distributions (§ )
Sampling Distributions and The Central Limit Theorem
Presentation transcript:

Monte Carlo Simulation of the Craps Dice Game Sencer Koç

Basics The player rolling the dice is the "shooter". Shooters first throw in a round of Craps is called the Come Out roll. If you roll a 7 or 11, you win and the round is over before it started. If you roll a 2, 3, or 12 that's a Craps and you lose: again, it's over before it started. Any other number becomes the Point. The purpose of the Come Out roll is to set the Point, which can be any of 4, 5, 6, 8, 9 or 10.

Objective The basic objective in Craps is for the shooter to win by tossing the Point again before he tosses a 7. That 7 is called Out 7 to differentiate it from the 7 on the Come Out roll. If the Point is tossed, the shooter and his fellow bettors win and the round is over. If the shooter tosses Out 7, they lose and the round is over. If the toss is neither the Point nor Out 7, the round continues and the dice keep rolling.

Craps Game Win if PointLose if 7 (Out 7)Continue otherwise Win if PointLose if 7 (Out 7) Win if 7, 11Lose if 2, 3, 12Set Point Come Out Roll

Questions What is the probability that the roller wins? –Note that this is not a simple problem. The probability of win at later rolls depends on the point value, e.g., if the point is 8, P(8)=5/36 ({2,6},{3,5},{4,4},{5,3},{6,2}) and if the point is 10, P(10)=1/36 ({5,5}). How many rolls (on the average) will the game last?

Simulation and MATLAB We will simulate the craps game on a computer using MATLAB. The command rand(1) –Uniformly distributed between 0 and 1 –round(rand(1,2)*6+0.5) simulates a single roll of a pair of dice. The following MATLAB code simulates M games.

MATLAB Code M = 10; % Number of simulations lost = 0; win = 0; gamelength = zeros(1,M); disp(' win loss gamelength') data = zeros(10000,3); for k=1:M stop = 0; curr_gamelength = 1; x = sum(round(rand(1,2)*6+0.5)); if (x==7) | (x==11) win = win+1; stop = 1; elseif (x==2) | (x==3) | (x==12) lost = lost+1; stop = 1; else point = x; end

MATLAB Code (Continued) while ~stop curr_gamelength = curr_gamelength+1; x = sum(round(rand(1,2)*6+0.5)); if (x==7) lost=lost+1; stop = 1; elseif (x==point) win = win+1; stop = 1; end gamelength(k) = curr_gamelength; disp(sprintf('%8.0f %8.0f %8.0f '...,win, lost, curr_gamelength)) data(k,:) = [win lost curr_gamelength]; end

Sample Simulation Trial win loss gamelength Program Output Total over 10 simulations win loss gamelength Summary Data

Generation of Useful Data Remember we are using a random number generator! We also need a larger sample size. We will run the problem for many more games! Let us now try 1000 games and divide #wins and #loss by M to determine the probabilities (comment out the disp commands to suppress output of data). Also evaluate the mean of gamelengths. Our point estimators are –P(win) = data(1000,1)/1000 –P(loss) = data(1000,2)/1000 –L = mean(data(:,3))

Sample Simulations (M=1000) Trial P(win) P(loss) L

Now make N=1000 such trials! This will take some time (about 5 minutes) since the MATLAB code is written for readability and not for speed! You may use the following command line: –res=zeros(1000,3);for ii=1:1000; mcscraps; res(ii,:)=[win/1000 lost/1000 mean(gamelength)];end;

Histograms Histogram of P(win) for 1000 trials. Histogram of L for 1000 trials.

Confidence Intervals

Exact The exact value of probability of win can be calculated by using the theory of Markov Chains

Final Note The game length is an exponentially distributed random variable, however its mean over N=1000 trials (as shown before) is approximately normally distributed (Central Limit Theorem)