# gumbel max trick

## 1. goal

We have categorical random variable \(\{1,...,k\}\) with associated log-probabilities \(\{x_1,...,x_k\}\) that we want to sample from.

## 2. usual way

Usually, we would exponentiate and then normalize: \[ \pi_k = \frac{\exp(x_k)}{\sum_{j} \exp(x_j)} \] (Note that this is the same thing we do when we take the softmax)