public static void main(String[] args) {
Random random =new Random();
double r= random.nextDouble();
System.out.println(r);
int N=10000;
int n=0;
for (int i = 1; i <N ; i++) {
double value=1000.0;
for (int j = 1; j <=100 ; j++) {
if(random.nextDouble()>0.5){
value*=1.1;
}
if(random.nextDouble()<0.5){
value*=0.9;
}
}
if(value>1000.0){n++;}
}
System.out.println(1.0*n/N);
}