randomized
Class BiasedDie
java.lang.Object
randomized.BiasedDie
public class BiasedDie
- extends Object
This class contains an implementation of a biased die by
means of a biased coin. The implementation is based
on the paper
Donald E. Knuth and Andrew C. Yao.
The Complexity of Nonuniform Random Number Generation.
In, J.F. Traub, editor,
Proceedings of a Symposium on New Directions and Recent
Results in Algorithms and Complexity,
pages 375-428, Pittsburgh, PA, USA, April 1976.
Academic Press.
The authors show how a die can be implemented by means of a coin.
- Author:
- Xin Zhang, Franck van Breugel
Constructor Summary |
BiasedDie()
Initializes this biased die. |
Method Summary |
int |
roll()
Returns the result of the roll of this biased die. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BiasedDie
public BiasedDie()
- Initializes this biased die.
roll
public int roll()
- Returns the result of the roll of this biased die.
- Returns:
- the result of the roll of this biased die.