Hello all!
I am generating a random int between 0 and 75:
public static int rand(){
int num = (int) (Math.random()*75);
return num;
}
How would I generate the same range of numbers but with a 70% bias for the lower half of possible numbers?
I thought I might be able to use:
Math.abs(r.nextInt()) %
but it seems this has a fatal flaw (sometimes generates negative numbers).
Any ideas? Thanks a lot!