Derive expectation for two consecutive heads

Quick Overview

This question evaluates mastery of probability theory and stochastic processes, specifically expectation and variance calculations, Markov-chain or recurrence reasoning, and pattern waiting times in Bernoulli trials relevant for a Data Scientist role.

Derive expectation for two consecutive heads

Company: LinkedIn

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Technical Screen

Let T be the number of fair coin flips until the pattern HH (two consecutive heads) appears for the first time. (a) Derive E[T] using a state-based recursion or Markov-chain argument and give the exact numeric value. (b) Generalize E[T] for a biased coin with P(H) = p (0 < p < 1). (c) For the fair coin, derive Var(T). State all steps and justify your recurrence setup.

Quick Answer: This question evaluates mastery of probability theory and stochastic processes, specifically expectation and variance calculations, Markov-chain or recurrence reasoning, and pattern waiting times in Bernoulli trials relevant for a Data Scientist role.

|Home/Statistics & Math/LinkedIn
LinkedIn logo
LinkedIn
Oct 13, 2025, 9:49 PM
mediumData ScientistTechnical ScreenStatistics & Math
7
0

Waiting Time Until First HH (Two Consecutive Heads)

Setup

Let T be the number of coin flips required until the pattern HH (two consecutive heads) appears for the first time. Assume independent flips.

Tasks

(a) For a fair coin, derive E[T] using a state-based recursion (or an equivalent Markov-chain argument) and give the exact numeric value.

(b) Generalize E[T] for a biased coin where P(H) = p with 0 < p < 1.

(c) For the fair coin, derive Var(T). Show your recurrence setup and solution steps clearly.

Loading comments...