Tag Archive: dynamic programming

Josephus problem

Josephus problem statement can be found here. We will try to solve this problem using dynamic programming. Other choice is to use queues or circular buffers to hold the participants. Let’s try an… Continue reading

Binomial distribution

Starting from the following implementation of binomial distribution, public static double binomial(final int n, final int k, final double p) { if (n == 0 && k == 0) { return 1; }… Continue reading