We sometimes need a distribution from 0 to 1 where the probability density at x is proportional to xn. For example this picks a point on the boundary of an n dimensional unit sphere but to pick a random point within the ball we need to choose a random radius whose probability density function is rn−1/n. Note that the integral from 0 to 1 of this is 1.

To get a random sample from [0, 1], from the density distribution (n+1)xn compute v1/(n+1) where v is from the uniform distribution on [0, 1].

P(x<v1/(n+1)<x+dx)
= P(xn+1<v<(x+dx)n+1)
= P(xn+1<v<xn+1+(n+1)xn dx)
= (n+1)xnP(xn+1<v<xn+1+dx)
= (n+1)xndx.