Skip to content

Commit 5aa97a9

Browse files
committed
2025-10-21 13:09:55: add post abt polya urn model
1 parent d8f42f5 commit 5aa97a9

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

content/posts/polya-urn.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: The Pólya urn
3+
tags:
4+
- combinatorics
5+
- probability
6+
---
7+
8+
The model is as follows ([Wikipedia](https://en.wikipedia.org/wiki/P%C3%B3lya_urn_model)): you have $n$ groups, each of which starts initially with 1 person. Every second, a new person joins a random group, where their probability of joining a given group is directly proportional to that group's size. For instance, if $n = 2$ and the groups currently have sizes $2$ and $1$ respectively, a new person will join the first group with probability $2/3$ and the second with probability $1/3$. Essentially, all the people are sheep and tend to follow the crowd. Now, the problem is the following: after $t$ seconds, what is the distribution of possible group sizes (i.e. what's the chance the $i$th group contains $a_i$ members)?
9+
10+
> [!note]- Solution
11+
> It turns out that all possible group sizes are equally likely!
12+
>
13+
> To see why, consider reframing the problem in the following way: there are initially $n$ people _in a line_ and $1$ divider between each of them, for $n - 1$ total. Then, every second, each new person randomly inserts themselves in front of a person already in line. Do you see how this model is equivalent?
14+
15+

content/thoughts/edits.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Edits
3+
---
4+
Ideas:
5+
- Heaven Can Wait/Timebomb
6+
- my heart so cold I think I'm down with ice
7+
8+
[SUPERPOWERS|ITSV](https://www.youtube.com/watch?v=sXJRiDsUyF8)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Inverse Minimum Partition
3+
---
4+
#dp #segment-tree #partition
5+
https://codeforces.com/contest/2159/problem/D2
6+
7+
A very cool problem that relies on two clever observations
8+
9+
Main lesson: it's always good to run/reason through a few test cases by hand and get a reasonable idea of what upper bounds are
10+
11+
Also, when you make an observation, simplify it!
12+
- i.e. consider only suffix minimums => can assume array is strictly increasing

0 commit comments

Comments
 (0)