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
November 29, 20260
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
How to Approach This
- Define your hypotheses (H0 and H1) clearly before performing any test.
- Calculate required sample size BEFORE running an experiment, using power analysis.
- Remember the Central Limit Theorem: sample means become approximately normal with large n.
- Watch for Simpson's paradox. Always segment data by key dimensions.
- 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 QuestionsSample Answer
Clarify
Days are iid Bernoulli(). A streak is a maximal run of equal values. We want ....
Approach
Every streak except the first begins at a day where the status differs from the previous day. So the number of streaks is with if ....