Bits of entropy needed to choose a random element from a list? Suppose I want to choose a random element from a list of size $2^n$, for any integer $n$. (Here, random is to mean an equal probability of selecting every item.) My intuition says I'd need $n$ bits of entropy.  For example, for a list of size 64, I'd need 6 bits of entropy.
However, how many bits of entropy would I need to choose a random element from a list that's sized something other than $2^n$?  For example, for a list of size 3, or 10?
My intuition says that I'd need to find $n$ such that $2^n$ is a multiple of list size, to ensure equal probability of selecting every item.  (This is true for all lists sized $2^n$.)  However, that doesn't seem to work in practice: there does not appear to be any $n$ such that $2^n$ that divides evenly into 3 or 10.
One can achieve this with a technique called Knuth Yao sampling. It:

Allows you to sample from any distribution $X$ of finite support (say where the function $f(i, s) = \text{the }i\text{th bit of }\Pr_X[X = s]$ is efficiently computable)
Using on average $\leq H(X) + 2$ bits of entropy, where $H(X)$ is the entropy of the distribution under consideration.

One can then replace $X$ with your distribution (say uniform on $3^n$ elements) to get the result. I'll quickly describe how Knuth-Yao sampling works for the rest of the answer.
Knuth Yao sampling works by constructing a certain (usually infinite) binary tree, and executing an unbiased random walk on it. Leaf nodes of the tree are labelled by elements on the underlying probability distribution, and when you hit a leaf node you terminate the walk and output that that element as your sample.
Why should this work?
The basic idea is to put at leaf labelled $s$ at depth $i$ iff $f(i, s) = 1$.
Then the following facts can be combined to show that the distribution of outputs of the sampler is precisely $X$:

The probability of reaching any particular node during an unbiased walk of a binary tree is $1/2^i$, where $i$ is the depth of the node
Therefore, the probability the sampler ends in a leaf labelled by $s$ at depth $i$ is $f(i, s)/2^i$ (if $f(i, s) = 0$, there are no such leaves, otherwise there is precisely 1).
The sampler can enter at most one leaf (it terminates after), so they form a set of independent events.

Then one has that:
\begin{align*}
\Pr[\text{KY sampler outputs }s]&amp;= \sum_{i = 0}^\infty \Pr[\text{KY sampler outputs }s\text{ in depth }i]\\
&amp;=\sum_{i = 0}^\infty f(i, s) / 2^i\\
&amp;= \Pr[X = s]
\end{align*}
Showing that the average entropy usage is bounded by $H(X)+2$ requires a fairly careful argument, which you can find in Knuth and Yao's intial paper (which is actually quite hard to get ahold of, but can be found in one of Knuth's collections of selected papers (Selected Papers on Analysis of Algorithms, entry 34 The Complexity of Nonuniform Random Number Generation).