Computer Science Canada Programming C, C++, Java, PHP, Ruby, Turing, VB   Username:   Password: Wiki   Blog   Search   Turing   Chat Room  Members
ProjectEuler Problem 15
Author Message
QuantumPhysics

Posted: Sun Dec 23, 2012 5:10 am   Post subject: ProjectEuler Problem 15

I was reading the forums of question 15, and apparently someone solved it with a language called 'R'. I was amazed that the code for answering the question was as simple as:

choose(40,20)

[Gandalf]

Posted: Sun Dec 23, 2012 5:59 am   Post subject: RE:ProjectEuler Problem 15

This is nothing specific to R, in fact you can do this using Google:

http://en.wikipedia.org/wiki/Binomial_coefficient
A.J

Posted: Tue Dec 25, 2012 3:32 am   Post subject: RE:ProjectEuler Problem 15

The idea comes from the fact that the number of paths from (0, 0) to (n, m) moving only up and right is '(n + m) choose n' or equivalently '(n + m) choose m'.
QuantumPhysics

Posted: Tue Dec 25, 2012 5:26 am   Post subject: RE:ProjectEuler Problem 15

Oohhh, well I didn't think it like that. Thanks, before this I was very confused. Mainly because my solution was so much more difficult, I was just surprised at the time I could have saved.
QuantumPhysics

Posted: Tue Dec 25, 2012 5:51 am   Post subject: RE:ProjectEuler Problem 15

I am viewing other peoples answers for question 354 - Someone completed it in Coffee? Never heard of that language. Its apparently a scripting language.

snip[/edit]

That was his source code. Pretty easy. Mine was so much more difficult. Took some thought and well -> Mine is always difficult I can never find the easy way out.
Panphobia

Posted: Tue Dec 25, 2012 2:48 pm   Post subject: RE:ProjectEuler Problem 15

in data management I think we were taught to use the pascals triangle for this type of question, like flip the square to be a diamond and you can label each point with how the pascals triangle is set up like a point is equal to the sum of the two points above it, and that would give you the amount of paths to a certain point
Insectoid

Posted: Wed Dec 26, 2012 11:34 am   Post subject: RE:ProjectEuler Problem 15

Since Pascal's Triangle is a big table of N choose R, that makes sense.
A.J

Posted: Wed Dec 26, 2012 5:35 pm   Post subject: RE:ProjectEuler Problem 15

I believe that code was referring to PE354. You shouldn't post code from the solution thread here. For some reason I am not able to edit your post. Could another mod remove the code please?

Tony

Posted: Thu Dec 27, 2012 3:30 pm   Post subject: RE:ProjectEuler Problem 15

Removed posted code.

P.S. You might be thinking of CoffeeScript. In which case it's a hip new syntax to JavaScript.
Tony's programming blog. DWITE - a programming contest.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

Page 1 of 1  [ 9 Posts ]
 Jump to:  Select a forum  CompSci.ca ------------ - Network News - General Discussion     General Forums   -----------------   - Hello World   - Featured Poll   - Contests     Contest Forums   -----------------   - DWITE   - [FP] Contest 2006/2008   - [FP] 2005/2006 Archive   - [FP] 2004/2005 Archive   - Off Topic     Lounges   ---------   - User Lounge   - VIP Lounge     Programming -------------- - General Programming     General Programming Forums   --------------------------------   - Functional Programming   - Logical Programming   - C     C   --   - C Help   - C Tutorials   - C Submissions   - C++     C++   ----   - C++ Help   - C++ Tutorials   - C++ Submissions   - Java     Java   -----   - Java Help   - Java Tutorials   - Java Submissions   - Ruby     Ruby   -----   - Ruby Help   - Ruby Tutorials   - Ruby Submissions   - Turing     Turing   --------   - Turing Help   - Turing Tutorials   - Turing Submissions   - PHP     PHP   ----   - PHP Help   - PHP Tutorials   - PHP Submissions   - Python     Python   --------   - Python Help   - Python Tutorials   - Python Submissions   - Visual Basic and Other Basics     VB   ---   - Visual Basic Help   - Visual Basic Tutorials   - Visual Basic Submissions     Education ----------- - Student Life   Graphics and Design ----------------------- - Web Design     Web Design Forums   ---------------------   - (X)HTML Help   - (X)HTML Tutorials   - Flash MX Help   - Flash MX Tutorials   - Graphics     Graphics Forums   ------------------   - Photoshop Tutorials   - The Showroom   - 2D Graphics   - 3D Graphics     Teams ------ - dTeam Public

 Style: Appalachia blueSilver eMJay subAppalachia subBlue subCanvas subEmjay subGrey subSilver subVereor Search: