This document will elucidate the game of Baccarat at an online Casino.
setwd("C://Users//mammykins//Google Drive//R//bonus")
source("baccarat.R") # Baccarat simulation of one round
We use the open source software R to run a simulation of Baccarat by creating a function called bac()
following standard rules. We assume that the game starts with 8 decks of shuffled cards and ends when the number of cards is fewer than 52, we call this a round. Each game in a round is called a play. This is trivial as Baccarat is a game of chance where the gambler places a bet and the play unfolds following a simple set of decision-rules. See my Github for details. We can produce summary statistics for each round as shown below.
set.seed(1337)
#INPUT
Round <- bac() # we use caps as round() is a function
#OUTPUT
n <- nrow(Round) # number of plays in the round
xw <- sum(Round[, 1] > Round[, 2]) # number of Player wins
xl <- sum(Round[, 1] < Round[, 2]) # number of Player losses
xt <- sum(Round[, 1] == Round[, 2]) # number of ties
pw <- xw / n # prob Player wins
pl <- xl / n # prob Player loses
pt <- xt / n # prob of tie
We can simulate each round thousands of times and estimate the probability of the Player (a bet placed on the Player by the gambler) winning or losing with Tie plays omitted. The mean estimate and standard error are provided.
Player | p | se |
---|---|---|
Win | 0.492 | 0.0006 |
Lose | 0.507 | 0.0006 |
The paper by Zhu & Park, 2012, suggests that Baccarat follows a random walk and is a good example of an iid. Thus, as it is a game of chance with no strategy the Casino are likely to be in a strong position (due to the use of 8 decks and the reset value at 52, gone are the days of single deck Baccarat).