Customers come into a café one by one, and each picks a table on their own: table i with chance popularity[i] (the window tables are favourites). Several can pick the same table. Write expected_empty(customers, popularity): how many tables nobody picks, on average over many nights. The puzzle’s nights go up to 40 customers at 12 tables.
A 12-table bistro on a 40-customer night: each customer picks a table, popular ones more often, and the empty ones get a ring. Subtracting customers from tables goes negative, and listing every seating means 12^40 of them. Over 100 nights the empty tables wobble round an average: the goal is that average, from popularity alone.
expected_empty(customers, popularity)| customers | how many customers come in tonight | e.g. 1 |
| popularity | popularity[i] is the chance a customer picks table i (they add up to 1) | e.g. [0.5, 0.5] |
| returns | how many tables nobody picks, on average | |