POV-Ray : Newsgroups : povray.off-topic : Project Euler : Re: Project Euler metadiscussion Server Time
11 Oct 2024 13:16:25 EDT (-0400)
  Re: Project Euler metadiscussion  
From: Invisible
Date: 30 Nov 2007 04:25:48
Message: <474fd71c$1@news.povray.org>
Mueen Nawaz wrote:
> Invisible wrote:
>> Well, for "find the millionth prime number" or something, there's not
>> much to check. But when the problem is "sum all the primes below 1
>> million", it might be nice to know, for example, how many primes there
>> are. (Or rather, be able to ask "are there 722 primes?" and get a yes/no
>> answer.)
> 
> 	That'd make it easier to solve, though.

Well yes - but do you have any idea how frustrating it is to spend hours 
trying to make your program work when you don't even know what part is 
broken? Knowing which part is broken doesn't tell you how to fix it, it 
just tells you which part needs fixing...

(Also, a number of questions give insufficient detail to figure out what 
the correct answer is.)


> 
> 	That's an interesting currency conversion you have there...


other...

> 	Unless you have a good reason to stick with them, simply dump them and
> ask around for recommendations of cheaper and better hosts.

I've asked many times. Nobody ever recommends anything.

My current host (1&1) charges quite a low price for serving just static 
HTML, which is mainly what I want. However, if you decide you want CGI, 
they suddenly want to charge a lot more.

(I hate Perl, and PHP would probably be the same. I'd probably want to 
do my CGI scripting in Haskell - and by the looks of it, the only way to 
do *that* is to go for a virtual server package rather than a simple web 
hosting package. That's A LOT of extra complexity, and it's expensive.)

[BTW, I find it interesting that all hosting packages offer MySQL or SQL 
Server, but none offer PostgreSQL...]

> I'm
> currently paying a bit less than you are (albeit that's because I paid
> in advance), and I get probably much more than what you want.
> 
> (I use Dreamhost - often maligned, but more than satisfies my needs and
> wants and I can't find similarly priced alternatives that do).

Well, I'll have a look...

>> I don't know - almost all of the problems seem to be a case of "write
>> this brute-force search algorithm so it doesn't take all day". Very few
>> problems appear to possess an elegant mathematical solution.
> 
> 	I'm assuming that these two are just prepping you up for more difficult
> (but related) problems later on. Certainly if someone has trouble
> generating 10001 primes, he won't get too far.

True, I guess.

>> - Find a number having some highly obscure property. Well you can
>> probably use elegant mathematics to elimatine a few classes of
>> possibilities, but it still comes down to a simple search in the end.
> 
> 	That's sort of the point. Take Problem 43:

Actually I didn't - mainly because I don't know what "pandigital" means.

> 	A REAL brute force solution is simple to write, but do you really want
> to check over a billion numbers? (I'm guessing anyone who got this far
> would not even realize the search space is that big - they'll
> automatically optimize).
> 
> 	Now with some thought you can bring that number down to something very
> manageable. You could then code it and be happy, or think more and try
> to reduce the search space even more. The more you do this, the more
> "painful" it is to code. So then you take on the challenge of writing
> the code in a "nicer" way so that it doesn't look like an ugly hack.

I did see one problem that was solved by a human with pen and paper in 
under 30 seconds. Just move some algebra around and it tells you the 
answer. But most seem to require a machine.

(Many involve prime numbers - and as we all know, it is impossible to 
know anything about prime numbers. You just gotta compute them all the 
long way...)

> 	The point of the problems is not to solve it _entirely_ mathematically
> (although if you can, that's wonderful). It's to use math to make the
> problem more tractable (even if it _can_ be done under a minute via
> brute force). And for me, it's also a challenge to write the code
> somewhat nicely.

Personally, I find that as you come up with better algorithms it gets 
*easier* to code, not harder. ;-) Maybe that's just because I use 
Haskell... The Mathematica solutions are similarly easy.

>> A few of the problems admit an elegant mathematical solution. The thing
>> with Pythagorean triples, or finding the sum of numbers or the number of
>> combinations or something. Slightly more involve some actual maths
>> somewhere. But most seem to just involve blindly searching as fast as
>> possible. It's not very interesting, but I like seeing my score
>> increase. :^)
> 
> 	I assume that it'll demand more math thought as you get higher. Many
> (most?) have not impressed me as much in that regard thus far. But heck,
> it was fun anyway!

Well, it's a challenge I guess. I doubt I'll ever reach 100% though...


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.