Expected Number of Activity Streaks in a Thirty Day Log

Last updated: November 29, 2026

Quick Overview

A user opens Instagram on each of 30 days independently with probability p. A streak is a maximal block of consecutive days with the same status (active or inactive). What is the expected number of streaks, and what is it when p = 1/2?

Meta
Statistics & Math
Data Scientist
Meta
November 29, 2026
Data Scientist
Phone Screen
Statistics & Math
Easy

0

0

0 solved


A user opens Instagram on each of 30 days independently with probability p. A streak is a maximal block of consecutive days with the same status (active or inactive). What is the expected number of streaks, and what is it when p = 1/2?

Meta data science phone screens use quick linearity-of-expectation questions framed around engagement logs. The interviewer wants you to count streak boundaries with indicators instead of enumerating sequences, and to notice how the answer depends on p.

What the Interviewer Expects
  • Count streaks as 1 plus the number of status changes
  • Use indicators for each adjacent pair of days
  • Get $1 + 29 \cdot 2p(1-p)$
  • Evaluate 15.5 at p = 1/2
  • Explain why real logs show fewer streaks than this model
Key Topics to Cover
Linearity of expectation
Indicator variables
Runs
Bernoulli sequences
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • What p maximizes the expected number of streaks?
  • What is the expected number of active streaks only?
  • How would autocorrelation in real usage change the count?
  • Can you use the number of streaks to test independence?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Statistics Questions
Sample Answer
Clarify

Days X1,…,X30X_1, \dots, X_{30} are iid Bernoulli(pp). A streak is a maximal run of equal values. We want E[streaks]E[\text{streaks}]....

Approach

Every streak except the first begins at a day where the status differs from the previous day. So the number of streaks is 1+∑i=230Ii1 + \sum_{i=2}^{30} I_i with Ii=1I_i = 1 if Xi≠Xi−1X_i \ne X_{i-1}....


Submit Your Answer
Markdown supported