Skip to content

Problem 15

December 11, 2009

When I first saw problem 15 in the project Euler site, I immediately remembered my math classes at the University. So, I used pen and paper to specify the solution by means of combinations. So, since the grid is 20 by 20, we would have the following binomial coefficient:

C(n,k) = C(40,20) = 40! / ( 20! (40-20)! ) = 40! / (20! 20!)

Then it was a matter of using Haskell ghci to calculate the factorial of 40 and 20 and finish the calculations.

Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: