Introduction

Blackjack is a casino card game where probability determines the outcome.

Players try to reach a hand value closest to 21 without going over.

Statistics aim to help us understand:

  • Probability of winning
  • Probability of busting (going over 21)
  • Expected value of a bet

Why Study Blackjack?

Blackjack is one of the most studied casino games in probability and statistics.

Casinos rely on a small statistical advantage called the house edge.

Understanding probability and expected value helps explain:

  • How casinos can consistently guarantee profit
  • why players often lose money over time
  • How probability influences decision making

What is Probability?

Probability measures how likely an event is to occur.

Example in blackjack:

  • Probability of drawing an Ace
  • Probability of drawing a 10-value card
  • Probability of busting when hitting

Probability ranges between 0 and 1.

Expected Value

Expected value tells us the average result of a game over many repetitions.

The formula for expected value is:

\[ E(X) = \sum x_i P(x_i) \]

Where:

  • \(x_i\) = possible outcomes
  • \(P(x_i)\) = probability of each outcome

Example of Expected Value

Suppose a player bets $10.

  • Win $10 with probability 0.4
  • Lose $10 with probability 0.6

Expected value:

\[ EV = (10)(0.4) + (-10)(0.6) = -2 \]

This means the player loses $2 on average per game.

Simulated Blackjack Outcomes

results <- sample(c(-10,10), 1000, replace=TRUE, prob=c(0.6,0.4))
df <- data.frame(results)

ggplot(df, aes(x = results)) +
  geom_histogram(binwidth = 5, fill = "steelblue", color = "black") +
  labs(title = "Distribution of Blackjack Outcomes",
       x = "Win / Loss",
       y = "Frequency")

Expected Value Over Time

ev <- cumsum(results)/(1:length(results))
df2 <- data.frame(hand = 1:1000, ev = ev)

ggplot(df2, aes(x = hand, y = ev)) +
  geom_line(color = "red") +
  labs(title = "Expected Value Convergence",
       x = "Number of Hands",
       y = "Average Outcome")

Interactive Plot (Plotly)

p <- ggplot(df2, aes(x = hand, y = ev)) +
  geom_line()

ggplotly(p)

Conclusion

Probability and expected value help explain why casinos make money.

Even small probability advantages, lead to profit over time for the casino.

Statistics allows us to understand long-term outcomes in gambling and many other real-world situations.