0/70 completed
Core Statistical Model Interactive

Markov Chains

Model state transitions where the future depends only on the current state. Perfect for streaks, game flow, and user behavior modeling.

๐Ÿ“Š The Markov Property

P(X_n+1 | X_n, X_n-1, ...) = P(X_n+1 | X_n)

The next state depends only on the current state, not on history. "Memoryless" property simplifies many real-world models.

  • โ€ข Win/Lose streaks
  • โ€ข Game momentum
  • โ€ข User engagement states

Transition Matrix

To: WinTo: Lose
From: Win0.600.40
From: Lose0.450.55

Transition Probabilities

P(Win โ†’ Win) 0.6
0.3 0.9
P(Lose โ†’ Lose) 0.55
0.3 0.9

Higher P(Winโ†’Win) = stronger hot streaks

Higher P(Loseโ†’Lose) = harder to break slumps

๐Ÿ“Š Steady State

Long-run probabilities (infinite time):

52.9%
Win
47.1%
Lose

Simulated State Sequence

L
W
L
L
W
W
W
L
L
L
W
L
L
W
W
W
L
L
W
W
L
W
W
W
W
W
W
L
L
W
W
L
L
L
W
W
W
W
W
W
W
L
W
W
L
L
L
W
W
W
Observed Win Rate: 60.0% vs Steady State: 52.9%

Cumulative Wins Over Time

๐Ÿ€ Sports Betting Applications

Hot Streaks

Model probability of continuing winning/losing streak

Injury Status

Healthy โ†’ Injured โ†’ Out transition probabilities

Game Flow

Leading โ†’ Close โ†’ Trailing state transitions

User Activity

Active โ†’ Churned โ†’ Reactivated states

R Code Equivalent

# Markov chain simulation
library(markovchain)

# Define transition matrix
tm <- matrix(c(0.6, 0.4, 0.44999999999999996, 0.55), 
             nrow = 2, byrow = TRUE)
rownames(tm) <- colnames(tm) <- c("Win", "Lose")

# Create Markov chain
mc <- new("markovchain", transitionMatrix = tm)

# Steady state
steady <- steadyStates(mc)
cat(sprintf("Steady state: Win=%.1f%%, Lose=%.1f%%\n", 
            steady[1] * 100, steady[2] * 100))

# Simulate
sim <- rmarkovchain(n = 50, mc, t0 = "Win")
table(sim) / length(sim)

โœ… Key Takeaways

  • โ€ข Markov: next state depends only on current
  • โ€ข Transition matrix captures all probabilities
  • โ€ข Steady state = long-run distribution
  • โ€ข Model streaks, game flow, user states
  • โ€ข Estimate streak/slump probabilities
  • โ€ข Foundation for more complex models

Pricing Models & Frameworks Tutorial

Built for mastery ยท Interactive learning