Write a program that takes an input such as:
which then computes:
and then prints the result.
A numerical example:
I'd like to see an answer that beats my python solution of 65 characters, but all languages are obviously welcome.
Here's my solution:
n,k=input();f=lambda x:+(x<2)or x*f(x-1);print f(n)/(f(k)*f(n-k))
I admit that this question is from the codegolf website mathematical combination puzzle. I know that my answer may look like not much progress can be made on it, but the leaders of this puzzle have solved it in nearly half as many characters.
The current lowest character counts by language are: