Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I would do print 5050; ;-)
In response to the original post, you don't need to be a mathematician to know this. I heard about this formula in elementary school, with an anecdote supposedly involving Carl Friedrich Gauss and a nasty math teacher. Regarding the "programmer/mathematician" comparison, be careful, because sometimes you see naive "mathematicians" that:
The point that thinking is sometimes better than brute force is well taken, but sometimes the opposite is good enough or better. From the Jargon File: Ken Thompson, co-inventor of Unix, is reported to have uttered the epigram "When in doubt, use brute force". He probably intended this as a ha ha only serious, but the original Unix kernel's preference for simple, robust, and portable algorithms over brittle 'smart' ones does seem to have been a significant factor in the success of that OS. Like so many other tradeoffs in software design, the choice between brute force and complex, finely-tuned cleverness is often a difficult one that requires both engineering savvy and delicate esthetic judgment. In reply to Re^2: Problem Domains and Multiple Disciplines
by itub
|
|