Expected colour runs in a shuffled deck
Question
A run is a maximal stretch of consecutive cards of the same colour; for instance BBRRBBB contains three runs.
(a) For a well-shuffled standard deck ( red, black), find the expected number of runs.
(b) Describe a program that, for a deck of cards divided equally among colours and shuffled at random, returns the mean number of runs.
Short answer
(a) . (b) , computed in . Runs equal plus the number of adjacent pairs whose colours differ. A given adjacent pair differs with probability , and linearity over the pairs gives ; for cards and colours this is . A Monte Carlo shuffle can be used to check it.
Adapted from OpenQuant; question and answer rewritten by SelfMadeQuant.com.
See the hint and the full worked solution in the question bank (free account).
Open the worked solutionLessons behind this question
- Expectation, Mean, and Variance
- Conditional Expectation and Variance Revisited
- Populations, Samples, and Sampling Distributions
Start with a free lesson: Expectation, Variance and Covariance is part of a free topic. Create a free account, no card needed, to read it in full with worked solutions.
Read it free