Math.random()*t 1, , Math.log(Math.random()*t) . , , Math.log(2), 0,69314718055994530941723212145818. , . . maxN - = maxN + - , n maxN. Math.random() * t int 1:
int n = maxN -
((int) (Math.log((int)((Math.random() * t)+1))
/ Math.log(2)));
1.
, 0. 0. , 1 maxN , Math.random() 1. , 1 , 2, , 3 , 0. 0, , 1 , 2 ..