How Often Does Alice Actually Show Up?

A small Bayesian puzzle that started at board-game night.

May 2026 · 9 min read · interactive

A puzzle that started on the couch

Our board-game group meets once a week. Every week of the year. Fifty-two evenings of dice, hidden cards, and someone insisting the rules really do work that way.

I don't make it to every night: life, travel, the occasional cold. But I noticed something. Whenever I do show up, Alice is almost always there too. The first time I clocked it I assumed it was a coincidence. By the tenth time, it stopped being one.

So I started wondering. Out of the 52 nights this year, how many did Alice actually attend? I personally went to ten of them, and she was there in eight. Could I extrapolate from that?

Did Alice attend 40 game nights? 45? Almost every single one?

This could make a very interesting statistical exercise, but the nicer way into it is as a small puzzle. We know something concrete (eight out of ten), we have an honest question (how often does she go in total), and we want an answer with the right amount of confidence, neither overcommitted nor evasive.

Let me show you what I found.


The variables, written down once

To keep the page tidy, let me fix the notation:

The first three are observed. The last one is what we're hunting.

A small but important sanity check: $i$ can't be smaller than $k$ (Alice can't attend fewer nights than the number of times I already saw her), and $i$ can't be so large that it contradicts my misses either. Formally:

$$ k \le i \le M - (N - k) $$

Keep that range in mind. Every plot and slider in this article enforces it.


First instinct: just scale it up

If I went to 10 nights and Alice was at 8 of them, that's an 80% hit rate. Extrapolating to the full year:

$$ \hat i_{\text{naive}} = M \cdot \frac{k}{N} = 52 \cdot \frac{8}{10} = 41.6 $$

So, somewhere around 42 nights. That's not a bad first answer. It's the same move pollsters make: assume your sample looks like the population, multiply by the population size, done.

And honestly, for a quick estimate over coffee, this is fine. The trouble starts when you ask the next question.


Why a single number feels off

Pretend I'd told you a different version of the story.

"I went to 40 game nights and Alice was at 32 of them."

Same 80% ratio. Same naive estimate of 41.6.

But the two situations are not equally convincing. Eight-out-of-ten is the kind of thing that happens to me by sheer luck on a regular Tuesday. Thirty-two-out-of-forty is a regularity that would survive most reasonable doubts.

A single number (41.6, 42, "about 40") can't tell those apart. They both round to the same answer, and yet one is a guess and the other is a near-certainty.

What we actually want is a distribution. A picture of which values of $i$ are plausible, given what I saw.


Reframing the problem

Here is where the angle of attack changes, and it's worth slowing down for.

The 52 game nights of the year already exist. They are not a hypothetical population I'm sampling from forever. They're a finite, fixed set. Each one of them either had Alice in it or didn't, past tense. The unknown $i$ is the number of those specific 52 nights that included Alice.

I attended a subset of them: $N$ nights, drawn however my schedule worked out. Among those, I saw Alice $k$ times.

Stated this way, the structure should feel familiar to anyone who's ever heard of an urn problem. We have a population of 52 objects, $i$ of which are "Alice-attended" and $52 - i$ of which aren't. I drew $N$ of them without replacement and want to know how my sample relates to the urn.

That's the hypergeometric distribution.


The likelihood, written down

Here is the formula. The important thing is not its shape, but the question it is silently answering.

$$ P(k \mid i) = \frac{\binom{i}{k}\binom{M - i}{N - k}}{\binom{M}{N}} $$

In plain words, the formula computes the answer to a single, very specific question:

If Alice really attended $i$ of the 52 game nights this year, how likely was I to have seen her exactly $k$ times in the $N$ nights I personally showed up to?

That is the entire purpose of the likelihood. It takes a hypothesis about Alice's total attendance, $i$, and tells me how compatible that hypothesis is with what I actually observed. Plug in $i = 30$ and ask: would my "8 out of 10" sightings be surprising in a world where Alice came to 30 nights? Plug in $i = 50$ and ask the same question for a world where she came to 50.

If you want to peek inside the formula, the numerator counts the ways the observation could have happened: choose which $k$ of Alice's $i$ nights I happened to attend, and choose which $N - k$ of the remaining $M - i$ non-Alice nights I attended too. The denominator counts all the ways my $N$ nights could land on the calendar at all.

So for every candidate value of $i$, the formula gives a number: the probability of the data I actually observed, under the assumption that Alice's true attendance was $i$. That is the keyhole through which we will look at every possible $i$ in the next section.

In code, it's a single line:

from scipy.stats import hypergeom
likelihood = hypergeom.pmf(k, M, i, N)

The Bayesian update

Now we play the Bayesian move. We had a question ("what is $i$?") and we have a likelihood telling us how compatible each candidate value of $i$ is with the data.

Bayes' rule:

$$ P(i \mid k) \;\propto\; P(k \mid i)\,P(i) $$

The pieces:

Because the prior is flat, the posterior is just the likelihood, renormalized so it sums to one. In code:

import numpy as np
import pandas as pd
from scipy.stats import hypergeom

M, N, k = 52, 30, 28
posterior = pd.Series([hypergeom.pmf(k, M, i, N) for i in range(M + 1)])
posterior /= posterior.sum()

That's the whole inference. Three lines.

Figure 1. Posterior distribution over Alice's total attendance, for the canonical case $M=52$, $N=30$, $k=28$. The red dashed line marks the posterior expected value, $E[i \mid k] \approx 47.9$; the dark blue dotted line marks the naive extrapolation $Mk/N \approx 48.5$. Shaded bars cover the 90% credible interval $[45, 50]$.

A single number, if you really need one

After staring at the bars for a while, you'll probably notice yourself doing the thing the picture was supposed to prevent: collapsing it to a single number.

That's fine. We just want to do it deliberately.

The posterior gives us a full distribution; the natural one-number summary is the posterior mean:

$$ E[i \mid k] \;=\; \sum_{i=0}^{M} i \cdot P(i \mid k) $$

For the notebook example ($N = 30$, $k = 28$):

$$ E[i \mid k] \approx 47.94 $$

Compare that to the naive estimate, $M \cdot k / N = 52 \cdot 28/30 \approx 48.53$. They agree to within a fraction of a night.

That's not a coincidence. When the sample is large relative to $M$ and the observed proportion is moderate, the posterior mean is very close to the simple extrapolation. The naive answer wasn't wrong; it was just missing the uncertainty.

The Bayesian framing pays off when the sample is small, when the proportion is extreme, or when you want a credible interval to hand back along with the point estimate.


What changes when the sample shrinks

This is the experiment I find most clarifying. Take a fixed ratio, say 80%, and shrink $N$ from 40 down to 5. The naive estimate stays pinned at 41.6 the whole time. The posterior tells a different story.

$N$$k$naive $Mk/N$$E[i \mid k]$90% interval
5441.637.6[23, 49]
10841.639.5[29, 48]
201641.640.7[34, 46]
403241.641.4[39, 44]

Table 1. Same observed proportion (80%), four different sample sizes. The point estimate barely moves; the interval collapses.

Two things to notice.

First, the posterior mean drifts slightly downward as $N$ shrinks. That's the prior leaning back toward the middle when the data gets thin, a soft and automatic skepticism of extreme ratios from tiny samples.

Second, and this is the headline, the 90% interval at $N=5$ spans 27 nights of the year. At $N=40$, it's down to six. The naive estimator can't see that difference. The posterior can.

Figure 2. Four posteriors for the same observed ratio $k/N = 0.8$, at $N = 5, 10, 20, 40$. Same peak location; very different confidence.

Interactive exploration

The rest is for you to play with. Move the sliders below and watch the posterior reshape itself in real time. The constraint $M > N \ge k$ is enforced automatically, so you can't ask an impossible question.

Widget 1: the full posterior

52 10 8

90% credible interval   outside interval   $E[i \mid k]$   naive $Mk/N$

Try the experiments the brief asked for:

Widget 2: same ratio, different sample sizes

Hold the ratio fixed and look at the four posteriors at $N = 5, 10, 20, 40$ side by side. This is Table 1, made interactive: drag the ratio slider and watch all four curves slide together while their widths stay characteristically different.

52 0.80

Each curve is a posterior at fixed $k/N$. Narrow curves = small samples translating into wide uncertainty.


What I want to remember from this

A few things, in roughly the order I'd argue them at the next game night:

Three lines of code. One reframing. A more honest answer to a question that turns out to be a lot like counting grizzly bears, or estimating how many bugs are still hiding in a piece of software you thought you'd finished testing.

Alice, for the record, came to 48 of the 52 nights. I asked her.