:rand.uniform(n) will give a random number from 1 <= x <= n

:rand.uniform(n)