nCr

public static double nCr(int n, int r)

This is a simple implementation of the choose function in math. It's equivalent to the number of ways you can choose r items from n total items, if only which items got picked and not the order of picking the items mattered.

Return

returns the result of the "n choose r" function.

Parameters

n

this is how many you want to choose from.

r

this is how many you want to choose.