It's a little embarrassing asking for help because I'm a pretty good programmer but unfortunately, I'm not that great at math, and so here's what I came up with. I know it's not the most efficient code so I would like to know if there's some other kind of alternative. :/
Code
public static void main(String[] args) {
Random random = new Random();
int numerator = 5, denominator = 100;
boolean succeed = false;
for(int i = 0; i < numerator; i++) {
int chance = random.nextInt(denominator);
if(chance == 0) {
succeed = true;
break;
}
}
//do something if succeeded
}

