The implementation that you copied ... has some issues. One could probably say that it is plainly wrong, because it is using random values, and when in a computation like rank = rnd.nextInt(size); friquency = (1.0d / Math.pow(rank, this.skew)) / this.bottom; the rank value is 0, then the frequency is...

python,anaconda,power-law,mpmath

You should use conda to install Python packages into anaconda, or pip if they are not available via conda. conda install mpmath should fix your issue.

The normalising constant is fairly easy to calculate. See the Clauset et al's powerlaw paper (in particular table 2.1). For the continuous case, C = (alpha-1) xmin^(alpha-1), the discrete case involves calculating the diagamma function. You can also examine the R code: Discrete Continuous ...