ITEC 2600 Introduction to Analytical Programming. Instructor: Prof. Z. Yang Office: DB3049

Similar documents
Statistical House Edge Analysis for Proposed Casino Game Jacks

CSC/MTH 231 Discrete Structures II Spring, Homework 5

Ex 1: A coin is flipped. Heads, you win $1. Tails, you lose $1. What is the expected value of this game?

6. a) Determine the probability distribution. b) Determine the expected sum of two dice. c) Repeat parts a) and b) for the sum of

Mini-Lecture 6.1 Discrete Random Variables

Basics of Probability

Stat 20: Intro to Probability and Statistics

Unit 1B-Modelling with Statistics. By: Niha, Julia, Jankhna, and Prerana

Probability. A Mathematical Model of Randomness

Random Variables. A Random Variable is a rule that assigns a number to each outcome of an experiment.


3.2 Measures of Central Tendency

Grade 8 Math Assignment: Probability

Random Variables. Outcome X (1, 1) 2 (2, 1) 3 (3, 1) 4 (4, 1) 5. (6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6) }

23 Applications of Probability to Combinatorics

Simulations. 1 The Concept

Make better decisions. Learn the rules of the game before you play.

Foundations of Probability Worksheet Pascal

Guide. Odds. Understanding. The THE HOUSE ADVANTAGE

The student will explain and evaluate the financial impact and consequences of gambling.

There is no class tomorrow! Have a good weekend! Scores will be posted in Compass early Friday morning J

4.2.4 What if both events happen?

OUTSIDE IOWA, CALL

Heads Up! A c t i v i t y 5. The Problem. Name Date

SIC BO ON THE MULTI TERMINALS

Probability. March 06, J. Boulton MDM 4U1. P(A) = n(a) n(s) Introductory Probability

METHOD FOR MAPPING POSSIBLE OUTCOMES OF A RANDOM EVENT TO CONCURRENT DISSIMILAR WAGERING GAMES OF CHANCE CROSS REFERENCE TO RELATED APPLICATIONS

November 11, Chapter 8: Probability: The Mathematics of Chance

Section 6.1 #16. Question: What is the probability that a five-card poker hand contains a flush, that is, five cards of the same suit?

Probability. Ms. Weinstein Probability & Statistics

Outcome X (1, 1) 2 (2, 1) 3 (3, 1) 4 (4, 1) 5 {(1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6) (6, 1) (6, 2) (6, 3) (6, 4) (6, 5) (6, 6)}

Math 1313 Section 6.2 Definition of Probability

The Teachers Circle Mar. 20, 2012 HOW TO GAMBLE IF YOU MUST (I ll bet you $5 that if you give me $10, I ll give you $20.)

What are the chances?

Junior Circle Meeting 5 Probability. May 2, ii. In an actual experiment, can one get a different number of heads when flipping a coin 100 times?

STReight Gambling game

EE 435/535: Error Correcting Codes Project 1, Fall 2009: Extended Hamming Code. 1 Introduction. 2 Extended Hamming Code: Encoding. 1.

characteristics; computerized random number generator (b) The layout for an Asia poker table shall contain, at a

Bernoulli Trials, Binomial and Hypergeometric Distrubutions

Algebra II Journal. Module 4: Inferences. Predicting the Future

Suppose Y is a random variable with probability distribution function f(y). The mathematical expectation, or expected value, E(Y) is defined as:

Random Experiments. Investigating Probability. Maximilian Gartner, Walther Unterleitner, Manfred Piok

This artwork is for presentation purposes only and does not depict the actual table.

Math 106 Lecture 3 Probability - Basic Terms Combinatorics and Probability - 1 Odds, Payoffs Rolling a die (virtually)

Name. Is the game fair or not? Prove your answer with math. If the game is fair, play it 36 times and record the results.

What Do You Expect? Concepts

Chapter 8: Probability: The Mathematics of Chance

STATION 1: ROULETTE. Name of Guesser Tally of Wins Tally of Losses # of Wins #1 #2

Introduction to (Networked) Game Theory. Networked Life NETS 112 Fall 2016 Prof. Michael Kearns

Dependence. Math Circle. October 15, 2016

Bellwork Write each fraction as a percent Evaluate P P C C 6

Name: Final Exam May 7, 2014

Expected Value, continued

November 6, Chapter 8: Probability: The Mathematics of Chance

Introduction to (Networked) Game Theory. Networked Life NETS 112 Fall 2014 Prof. Michael Kearns

Statistics Laboratory 7

A prime number = Player X wins. An even number = Player X wins. A number not divisible by three = Player X wins RANDOM NUMBER GENERATOR

A Mathematical Analysis of Oregon Lottery Keno

What is Bet the Flop?

S = {(1, 1), (1, 2),, (6, 6)}

The topic for the third and final major portion of the course is Probability. We will aim to make sense of statements such as the following:

Discrete Random Variables Day 1

Tail. Tail. Head. Tail. Head. Head. Tree diagrams (foundation) 2 nd throw. 1 st throw. P (tail and tail) = P (head and tail) or a tail.

18.S34 (FALL, 2007) PROBLEMS ON PROBABILITY

EECS 203 Spring 2016 Lecture 15 Page 1 of 6

Math 146 Statistics for the Health Sciences Additional Exercises on Chapter 3

1. For which of the following sets does the mean equal the median?

GCSE MATHEMATICS Intermediate Tier, topic sheet. PROBABILITY

4.12 Practice problems

The $25,000 a Week Dominator Roulette Strategy Profit Plan!

Math 147 Lecture Notes: Lecture 21

Probability Rules. 2) The probability, P, of any event ranges from which of the following?

Section 11.4: Tree Diagrams, Tables, and Sample Spaces

Math Steven Noble. November 24th. Steven Noble Math 3790

Mini-Unit. Data & Statistics. Investigation 1: Correlations and Probability in Data

Midterm 2 Practice Problems

Probability. 13 February Math 210G 13 February /21

a) Getting 10 +/- 2 head in 20 tosses is the same probability as getting +/- heads in 320 tosses

Directions: Solve the following problems. Circle your answers. length = 7 cm. width = 4 cm. height = 3 cm

Chapter 7 Homework Problems. 1. If a carefully made die is rolled once, it is reasonable to assign probability 1/6 to each of the six faces.

10-7 Simulations. Do 20 trials and record the results in a frequency table. Divide the frequency by 20 to get the probabilities.

Unit 9: Probability Assignments

CS1802 Week 9: Probability, Expectation, Entropy

Section 7.1 Experiments, Sample Spaces, and Events

the gamedesigninitiative at cornell university Lecture 6 Uncertainty & Risk

When a number cube is rolled once, the possible numbers that could show face up are

Waiting Times. Lesson1. Unit UNIT 7 PATTERNS IN CHANCE

Table Games Rules. MargaritavilleBossierCity.com FIN CITY GAMBLING PROBLEM? CALL

Basic Probability Ideas. Experiment - a situation involving chance or probability that leads to results called outcomes.

######################################################################

Name: Class: Date: 6. An event occurs, on average, every 6 out of 17 times during a simulation. The experimental probability of this event is 11

Such a description is the basis for a probability model. Here is the basic vocabulary we use.

Module 5: Probability and Randomness Practice exercises

The next several lectures will be concerned with probability theory. We will aim to make sense of statements such as the following:

2 A fair coin is flipped 8 times. What is the probability of getting more heads than tails? A. 1 2 B E. NOTA

1. Five cards are drawn from a standard deck of 52 cards, without replacement. What is the probability that (a) all of the cards are spades?

Identifying Online Professional Poker Players: A Revealed and Stated Analysis Approach ABSTRACT INTRODUCTION

1. How many subsets are there for the set of cards in a standard playing card deck? How many subsets are there of size 8?

Lesson 4: Calculating Probabilities for Chance Experiments with Equally Likely Outcomes

Presentation by Toy Designers: Max Ashley

Transcription:

ITEC 2600 Introduction to Analytical Programming Instructor: Prof. Z. Yang Office: DB3049

Lecture Eleven Monte Carlo Simulation

Monte Carlo Simulation Monte Carlo simulation is a computerized mathematical technique. The main idea behind this method is that the results are computed based on repeated random sampling and statistical analysis. Monte Carlo simulations sample from a probability distribution for each variable to produce hundreds or thousands of possible outcomes. The results are analyzed to get probabilities of different outcomes occurring. 3

Flip a coin We consider an example: flip a coin. We get either H or T by flipping a coin. We know the chance for either H or T is 0.5 (50%). We can do experiments by simulations. 4

MATLAB Random Number X = rand returns a single uniformly distributed random number in the interval (0,1). X = rand(1, n) returns an 1-by-n vector of random numbers in the interval (0,1). Example: X = rand(1, 10) returns an 1-by-10 vector. X = rand(n) returns an n-by-n matrix of random numbers in the interval (0,1). Example: X = rand(10) returns an 10-by-10 matrix. 5

Sign Function Y = sign(x) returns an array Y the same size as x, where each element of Y is: 1 if the corresponding element of x is greater than 0. 0 if the corresponding element of x equals 0. -1 if the corresponding element of x is less than 0. 6

Sum Function S = sum(a) returns the sum of the elements of A along the first array dimension whose size does not equal 1. If A is a vector, then sum(a) returns the sum of the elements. If A is a matrix, then sum(a) returns a row vector containing the sum of each column. Examples 7

Experiment - Flip a Coin Flip a coin once{1 H ; -1 T } A = sign(0.5 - rand) Flip a coin five times A = sign(0.5 - rand(1,5)) We can count how many times we get H B = sum(sign(0.5 - rand(1,5))>0) How to count how many times we get T 8

Probability Flip Coins Let s flip a coin N times (i.e. 1,000) Count how many times to have H Calculate the probability to have H How to use MATLAB to implement it In the program, the users are prompted to input N 9

Function Ceil Y = ceil(x) rounds each element of X to the nearest integer greater than or equal to that element. Y = ceil(5.37) Y = ceil(-5.37) Y = ceil([0.1 1.2 2.3 3.4 4.5 5.6]) Using the function ceil, we can simulate rolling a dice. 10

Floor Other Similar Functions Y = floor(x) rounds each element of X to the nearest integer less than or equal to that element. Fix Y = fix(x) rounds each element of X to the nearest integer toward zero. For positive X, the behavior of fix is the same as floor. For negative X, the behavior of fix is the same as ceil. Round 11

How to Generate Random Integers How to randomly generate a number among{1, 2, 3, 4, 5, 6} X = (6 * rand) generates a random number and 0<X<6. X = ceil(6 * rand) generates a random integer between 1 and 6, i.e, 1, 2, 3, 4, 5, or 6. How to use floor to do it. 12

Rolling a Dice The outcome of rolling a dice is a number among {1, 2, 3, 4, 5, 6} What is the probability of getting a particular number when rolling a dice? probability = # of favorable outcomes # of total possible outcomes Roll a dice N times (i.e. 1000) 13

CASINO 14

CASINO Casinos make a profit by offering games of chance where the average payouts are lower than the income produced by the overall wagers. The statistical advantage that the casino has on each game, and each bet, is called the house edge. Because the outcome is unknown, and regardless of who holds the edge, either party may win at any one time. 15

Casino Revenue (a Single Game) We construct an expression that computes the net revenue for a single game based on a random number chosen between 0 and 1. If the random number 0.51, the casino wins one betting unit; If the random number > 0.51, the casino loses one betting unit. 16

Casino Revenue (a Single Game) (Cont d) The following Matlab command will return simulated casino win (+1) or loss (- 1): Revenue = sign(0.51 rand) The win or loss is unknown until the game is completed. The result (+1 or -1) is random. 17

Casino Revenue (10 Games) To simulate 10 games, we use Revenue = sign(0.51 rand(1, 10)) Revenue is a vector of 10 elements. Each element represents a win or a loss (+1 or -1). How many wins are unknown until all games are completed. 18

Simulation Results (One Trial) 19

Questions If the game is run10,000 times, can the casino know which game it will win? What is the probability of the casino s total winning? After10,000 games completed, how many games would the casino win? 20

Casino Profit If the casino runs 100 games per day. If the house wins a game, the casino earns $1; otherwise loses $1. Can we calculate the casino s daily profit approximately? What if the casino runs 1000 games per day? 21

More Questions We know how to compute the casino s daily approximate profit, can we compute its weekly profit? How about monthly? If the casino wants to increase its profit, what can it do? 22