How about a PDF for Euler031 (English coins)

Announcements, comments, ideas, feedback, and "How do I... ?" questions
Post Reply
Unz
Posts: 3
Joined: Thu Sep 23, 2010 6:59 pm

How about a PDF for Euler031 (English coins)

Post by Unz »

After completing Problem031 (brute force - nested loops - I've included it below to show just how inelegant it is), I then read the forum and many solutions used recursion. Although I have a basic understanding of recursion in general, I would greatly appreciate if a member with a far superior mathematical background could explain to me how recursion helps so massively in this occasion.

Code: Select all

snip
I really miss the PDFs that came with the earlier problems. They really help novice members such as myself who are using this forum to help with our programming skills and via the explanation PDFs also dramatically improve our mathematical knowledge. I am a C++ novice and an almost total Python3 beginner and while I can brute force many answers, without the necessary math background, it has been rare that my solutions were in any way elegant.

I know this would be time consuming but I can't stress enough just how helpful this would be for members such as myself. (I find it very difficult to believe that I am the only one who thinks this way).

Anyway, many congratulations on such an interesting site and I hope you will at least consider my request.

Thanks, Unz.

(My apologies if I have placed this in the wrong forum, please relocate if necessary if this post derails this forum.
Feel free to contact me, I'm sure everyone here bright enough to work out the correct eAddress - with the possible exception of myself!
[cr9783 ATT GoogMale DOT CCom]
I've completed 17 problems so far ( not in order) - mathematical/programming colossus that I am 8-).
But if I could improve my understanding of the maths behind the problems it would help my programming skills no end.
On a different point, I understand that many of your more capable members enjoy the more challenging problems, but how about throwing a bone occasionally to some of us beginners!)
User avatar
Lord_Farin
Posts: 239
Joined: Wed Jul 01, 2009 10:43 am
Location: Netherlands

Re: How about a PDF for Euler031 (English coins)

Post by Lord_Farin »

It is disallowed to publish any working code. Please remove your code. Also, in the future please refrain from posting your topic five (!?) times.
PDFs are written on voluntary basis. It is always allowed to give the PE team a PDF for a problem (which doesn't have one yet), which they eventually may or may not include on the main site.
Image
User avatar
rayfil
Administrator
Posts: 1412
Joined: Sun Mar 26, 2006 5:30 am
Location: Quebec, Canada
Contact:

Re: How about a PDF for Euler031 (English coins)

Post by rayfil »

@@Unz

I have deleted 4 out of your 5 posts since they were ALL IDENTICAL.

Furthermore, I have deleted the code you posted. This is an open forum available to everybody, even those who may not have yet solved the problems. NO CODE should thus be posted in any of the threads on this forum.
When you assume something, you risk being wrong half the time.
User avatar
euler
Administrator
Posts: 5095
Joined: Sun Mar 05, 2006 4:49 pm
Location: Cheshire, England
Contact:

Re: How about a PDF for Euler031 (English coins)

Post by euler »

I suspect that the multiple identical threads was possibly down to a temporarily slow response time from the server resulting in a couple of extra presses of the "Submit" button; I think the lesson there is to be a little more patient. Similarly, unless Unz has visited the "ProjectEuler Problems" area he/she will not be aware of the rule about not posting code. I am sure a lesson has been learned here too. However, I hope that the lesson isn't that we are an unfriendly crowd - we're not! And it is very nice to see you here.

Unz, I am sure that the team would love nothing more than see helpful "Overviews" accompanying each problem, but they work so hard on problem production that their time is severely limited. Remember they do this entirely voluntarily and have many other commitments outside of Project Euler.

There have been at least two similar enquiries:
viewtopic.php?f=5&t=1060
viewtopic.php?f=5&t=1985

The response is the same. If anyone is willing to write an overview and work with one of the team members in "getting it right", then I am certain that the development team would be most grateful. Obviously I am no suggesting that you need to write the very document you are requesting - that would be ridiculous - but I hope you appreciate why there seems to be a shortage of them.

So... if any other members feel up to the challenge of writing an overview then make contact with one of the admins: hk, Harry, rayfil, or niino, to tell them of your intentions. It'd be a shame to produce one only to discover that someone else was working on the same problem overview and had just beaten you to it.
Image
impudens simia et macrologus profundus fabulae
User avatar
hk
Administrator
Posts: 12832
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: How about a PDF for Euler031 (English coins)

Post by hk »

As far as problem 31 is concerned the main approaches can all be found on the first page of the forum:
Nested loops: the posts by grimbal and znrosnbrick. Both try to avoid unnecessary computations. Your (snipped) code led to many unnecessary computations.
Recursion: the posts by cdoumar and Exomo.
The two methods presented in those posts don't differ very much w.r.t. efficiency.
Finally: dynamic programming: the post by wizeman. This method is far superior than the two other methods w.r.t efficiency.
Image
War ruins the life and health of untold numbers of innocent children.
User avatar
Lord_Farin
Posts: 239
Joined: Wed Jul 01, 2009 10:43 am
Location: Netherlands

Re: How about a PDF for Euler031 (English coins)

Post by Lord_Farin »

hk wrote:As far as problem 31 is concerned the main approaches can all be found on the first page of the forum:
Nested loops: the posts by grimbal and znrosnbrick. Both try to avoid unnecessary computations. Your (snipped) code led to many unnecessary computations.
Recursion: the posts by cdoumar and Exomo.
The two methods presented in those posts don't differ very much w.r.t. efficiency.
Finally: dynamic programming: the post by wizeman. This method is far superior than the two other methods w.r.t efficiency.
Generating function approach (if written out completely) yields a closed expression for arbitrary coins and sum (constant set of coins), if one can factorize large polynomials. But I agree DP is easier to implement.
Image
Unz
Posts: 3
Joined: Thu Sep 23, 2010 6:59 pm

Re: How about a PDF for Euler031 (English coins)

Post by Unz »

I'll check the posts suggested. Sorry about posting working code, won't happen again. And as for posting 5 times, I'm deeply sorry. Not sure how it happened, but to atone for my sins, I will go outside in the snow and whip myself to wash away my sins. :shock:

Thanks for for the kind replies, (and not taking the piss out of a noob)

Unz.
Post Reply