@@ -0,0 +1,1164 @@
+package Chapter01.Section01;%0A%0Apublic class Exercise27%0A%7B%0A    public static void main(String%5B%5D args)%0A    %7B%0A        int N = 100;%0A        int k = 50;%0A        double p = 0.25;%0A        double result = binomial(N, k, p);%0A        System.out.println(%0A            %22binomial(%22 %0A            + N %0A            + %22, %22 %0A            + k %0A            + %22, %22 %0A            + p %0A            + %22) = %22%0A            + result);%0A    %7D%0A%0A    public static double binomial(int N, int k, double p)%0A    %7B%0A        double%5B%5D%5B%5D results = new double%5BN+1%5D%5Bk+1%5D;%0A        for (int i = 0; i %3C results.length; i++)%0A            for (int j = 0; j %3C results%5Bi%5D.length; j++)%0A                results%5Bi%5D%5Bj%5D = -1;%0A        return binomial(N, k, p, results);%0A    %7D%0A%0A    public static double binomial(int N, int k, double p, double%5B%5D%5B%5D results)%0A    %7B%0A        System.out.println(%22N: %22 + N + %22; k: %22 + k);%0A        if (N == 0 && k == 0) return 1.0;%0A        if (N %3C 0 %7C%7C k %3C 0) return 0.0;%0A%0A        if (results%5BN%5D%5Bk%5D %3E= 0)%0A            return results%5BN%5D%5Bk%5D;%0A%0A        double result = (1.0 - p)*binomial(N-1, k, p, results) + p*binomial(N-1, k-1, p, results);%0A        results%5BN%5D%5Bk%5D = result;%0A        return result;%0A    %7D%0A%7D%0A

Solved 1.1.27