public class Euler205 {
    public static void main(String[] args) {
        double[] pete = distribution(9, 4);
        double[] colin = distribution(6, 6);
        double wins = 0, total = 0;
        for (int p = 0; p < pete.length; p++) {
            if (pete[p] == 0)
                continue;
            for (int c = 0; c < colin.length; c++) {
                if (colin[c] == 0)
                    continue;
                double ways = pete[p] * colin[c];
                total += ways;
                if (p > c)
                    wins += ways;
            }
        }
        System.out.printf("%.7f%n", wins / total);
    }

    static double[] distribution(int dice, int sides) {
        double[] dp = new double[dice * sides + 1];
        dp[0] = 1;
        for (int i = 0; i < dice; i++) {
            double[] nxt = new double[dp.length];
            for (int s = 0; s < dp.length; s++) {
                if (dp[s] == 0)
                    continue;
                for (int f = 1; f <= sides; f++)
                    if (s + f < nxt.length)
                        nxt[s + f] += dp[s];
            }
            dp = nxt;
        }
        return dp;
    }
}
