//double alfa = p.getAlpha();
//double k = p.getK();
double alfa = ((ParetoPar) p).getAlpha();
double k = ((ParetoPar) p).getK();
if (x <= alfa) {
throw new IncorrectDistributionParameterException("Error: x must be >alpha.");
}
return (alfa * Math.pow(k, alfa) / Math.pow(x, (alfa + 1)));
} else {
throw new IncorrectDistributionParameterException("Remember: parameter alpha and k must be gtz");
}
}