Description
The Zipf distribution is defined when the exponent is zero.
Zipf (Wikipedia)
Zipfian distribution (scipy)
Currently the RejectionInversionZipfSampler does not allow the exponent to be zero.
The PMF is:
pmf(x) = 1/x^s / Hn,s x in [1, n] n = number of elements s = exponent Hn,s is the Nth generalised harmonic number
In the case of a zero exponent the generalised harmonic number reduces to n and the PMF is:
pmf(x) = 1 / n
The distribution is a discrete uniform distribution.
I suggest extracting the sampling logic for the RejectionInversionZipfSampler into a nested class to be used as a delegate from the outer class's sample method. In the special case of a zero exponent the delegate can be replaced with a DiscreteUniformSampler.