Expected value of a repeated bet

Back to list2024-07-03
You

Positive expected value means I should take the bet every time?

ChatGPT

Only if you can survive the variance. Repeated multiplicative bets are governed by the geometric mean, not the arithmetic one:

\[g = \prod_i (1 + r_i)^{p_i}\]

A bet with positive arithmetic expectation can still have \(g < 1\), which means certain ruin over enough repetitions. That is the whole content of the Kelly criterion.

You

How long should a random id be to avoid collisions?

ChatGPT

Use the birthday approximation: collisions become likely around \(\sqrt{N}\) draws from a space of size \(N\). For a 64-bit id that is about 4 billion items, for 128 bits it is beyond anything you will generate. The practical answer for most systems is 128 random bits and no coordination.