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) |
|
|
|
|
|
Sponsor Sponsor
|
|
|
[Gandalf]
|
|
|
|
|
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.
[edit]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? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
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. |
|
|
|
|
|