Hi there...
I've just signed up, I've knocked off 14 of the easier ones so far. A lot of them were really easy though, mostly because I'm using PHP and it's built-in bc* functions.
BC is an arbitrary precision mathematics package that does math on strings of numbers, so problems like number 13 (first ten digits of the sum of one-hundred 50-digit numbers) is really no more difficult than if the numbers were all 6 or 7 digits long...
Thoughts? Am I cheating? How would everyone else approach a problem like that?
Cheers,
Matt
Is using BC (or similar) cheating?
- rayfil
- Administrator
- Posts: 1412
- Joined: Sun Mar 26, 2006 5:30 am
- Location: Quebec, Canada
- Contact:
Re: Is using BC (or similar) cheating?
Using whatever is available from your programming language is definitely NOT cheating. Some members may be familiar with several languages and would switch using one or another depending on the problem at hand and according to some of the programming features which may be more advantageous.
You could always read some of the postings in the forum for that problem to see how others may have proceeded.How would everyone else approach a problem like that?
When you assume something, you risk being wrong half the time.
- Lord_Farin
- Posts: 239
- Joined: Wed Jul 01, 2009 10:43 am
- Location: Netherlands
Re: Is using BC (or similar) cheating?
I remember solving Problem 13 in PHP, but I didn't know the bc* class at the time, so I wrote the method to add strings of numbers myself.mattparlane wrote:How would everyone else approach a problem like that?

- euler
- Administrator
- Posts: 5095
- Joined: Sun Mar 05, 2006 4:49 pm
- Location: Cheshire, England
- Contact:
Re: Is using BC (or similar) cheating?
Looking at the date of the problem (over 8 years ago) the reason I created it at the time was to get people to think about how you would go about arithmetic with really big numbers. Apart from anything else, in 2002 very few programming languages contained arbitrary precision libraries, so in order to prepare for future problems that I was planning to produce it was created as an introduction. However, both the power of computers and the requirements of programming languages have evolved. So unless you're interested in researching "how it is done" then it is perhaps as redundant as asking a student today to work out the value of the square root of 2, correct to 3 decimal places. If you have a calculator at hand then you're hardly going to spend time extracting roots manually. Swapping between a couple of programming languages, depending on the particular problem you're trying to solve, is good for experience. Who knows you might discover a language better suited to your general needs that you did not know existed before.

impudens simia et macrologus profundus fabulae