There is a discrete distribution where integers, $k$, from $1$ to $n$ occur with probability $p_{k}$, all $p_{k}$ are unknown.

Rather than having access to the distribution we have access to $n$ coins, with the $k$th coin having probability $p_{k}$ of giving a result of heads.

Can we sample *exactly* from the distribution by flipping the coins finitely many times?

We can sample approximately by flipping each coin $M$ times and then randomly selecting one of the results of heads and outputting the value of $k$ for the coin that produced it. Unfortunately we require exact sampling.

I'm sure this must have been studied somewhere but I really can't find it.