How can computers roll dice?

Some of the algorithms and math you can use to go from random bits to randomly selecting from a finite set.