// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.Random;

public class Prob {
    private static final int N = 10000;
    private static Random rng = new Random();
    public static int one() {
        int n = 0;
        do {
            n++;
        } while(rng.nextDouble() > 0.4);
        return n;
    }
    public static void main(String[] args) {
        int sum = 0;
        for(int i = 0; i < N; i++) {
            sum += one();
        }
        System.out.println(sum*1.0/N);
    }
}
