Problem 208

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
LarryC

Problem 208

Post by LarryC »

I think I have the right algorithm but I get more than 4 times what is shown for 25 arcs. I think there may be some rules regarding repeating paths but I am not sure of them so I would ask you to clarify!

For 25 arcs would an acceptable path be going round in a circle 5 times? That features twenty five arcs but is that counted as a path?

Thanks,
Lster
User avatar
stijn263
Posts: 1505
Joined: Sat Sep 15, 2007 11:57 pm
Location: Netherlands

Re: Problem 208 Clarification

Post by stijn263 »

Yes, that is counted as a path.

It's quite a difficult problem imo. I found a correct algorithm after about 50 minutes, but unfortunately it only works for up to 40 arcs. 45 arcs would take over an hour..
User avatar
ed_r
Posts: 1009
Joined: Sun Jul 29, 2007 10:57 am

Re: Problem 208 Clarification

Post by ed_r »

It is supposed to be a tricky problem, so I was astonished when Doraki solved it within nine minutes!
!647 = &8FDF4C
LarryC

Re: Problem 208 Clarification

Post by LarryC »

I'll keep looking. Thanks for the confirmation guys!
LarryC

Re: Problem 208 Clarification

Post by LarryC »

Done! That was hard...
User avatar
stijn263
Posts: 1505
Joined: Sat Sep 15, 2007 11:57 pm
Location: Netherlands

Re: Problem 208 Clarification

Post by stijn263 »

Still working on it. Trying to find a closed form formula now, since I can't get my head around my algorithm any more..
quilan
Posts: 182
Joined: Fri Aug 03, 2007 11:08 pm

Re: Problem 208 Clarification

Post by quilan »

ed_r wrote:It is supposed to be a tricky problem, so I was astonished when Doraki solved it within nine minutes!
Perhaps. It looked extremely difficult when I first saw it, but once the light-bulb blinked, even making an extremely naive & non-analytical method I was able to bang out an algorithm for it in about 10 minutes. I just started late in the day.
ex ~100%'er... until the gf came along.
Image
LarryC

Re: Problem 208 Clarification

Post by LarryC »

I had the same experience as you then, I think. I had a lesson at my college that ended shortly after 1:35pm and so before walking home I had a quick look at the problem on a school computer. I couldn't really get my head round it until I started coding a naive algorithm (which was wrong). I realized it must be almost right so I recoded it to not be so naive... And then I noticed my error. It only took 15 more minutes... :)
Zoinks
Posts: 1
Joined: Tue Sep 16, 2008 5:09 am

Re: Problem 208 Clarification

Post by Zoinks »

Another clarification request..

Can you confirm whether the phrase "starting position" refers only to the location of the robot, or does it also include the orientation -- i.e. must be facing North.

I clearly haven't burned enough brain cells on this yet... PC is currently brute-forcing it, just wanted to confirm the rules for my result-checking program.
User avatar
hk
Administrator
Posts: 12831
Joined: Sun Mar 26, 2006 10:34 am
Location: Haren, Netherlands

Re: Problem 208 Clarification

Post by hk »

A position is a position and says nothing about a heading.
Image
War ruins the life and health of untold numbers of innocent children.
koenvdd
Posts: 2
Joined: Tue Oct 14, 2008 4:04 pm

Re: Problem 208 Clarification

Post by koenvdd »

I've almost got this program nicked, I've already got the right results for 25 and 5 arc, and I think correct for 10 arcs, but project Euler doesn't want to accept my answer for 70 arcs. Finding the answer takes only a few seconds, but big fat squat does that help me if the answer isn't correct. Could someone who's algorithm works give the answers for every multiple of 5 upto but EXCLUDING 70 (ofcourse you shouldn't give the answer away). Pleaaaase, I'm asking this with the biggest puppy eyes, because I actually should be studying but I know my mind won't lay it to rest until it is solved.
I am partly in a run before you can walk situation because I currently only solved the first 10 problems as well as problem 202 (that was my first), but I'm now so close to the solution, so please, be compassionate with my grades and give the examples so I can try and find where my algorithm goes wrong, it just compute but wrongly.
User avatar
Georg
Posts: 157
Joined: Mon Jan 21, 2008 7:00 am
Location: Mannheim, Germany
Contact:

Re: Problem 208 Clarification

Post by Georg »

koenvdd wrote:Could someone who's algorithm works give the answers for every multiple of 5 upto but EXCLUDING 70 (ofcourse you shouldn't give the answer away)
No, but you could send your results to me via PM.
User avatar
Georg
Posts: 157
Joined: Mon Jan 21, 2008 7:00 am
Location: Mannheim, Germany
Contact:

Re: Problem 208 Clarification

Post by Georg »

Your 1st incorrect result is for 40 arcs.
koenvdd
Posts: 2
Joined: Tue Oct 14, 2008 4:04 pm

Re: Problem 208 Clarification

Post by koenvdd »

Thanks, also, am I to high or to low?
User avatar
Georg
Posts: 157
Joined: Mon Jan 21, 2008 7:00 am
Location: Mannheim, Germany
Contact:

Re: Problem 208 Clarification

Post by Georg »

You are to high.
Mike
Posts: 10
Joined: Wed Mar 29, 2006 8:03 am
Location: London, England

Re: Problem 208 Clarification

Post by Mike »

I thought I'd solved this at last but evidently my answer for 70 arcs is wrong,
though correct for 25.

So - are identical-looking paths sometimes distinct or not? For instance,
for 10 arcs, is a clockwise circle (CW) followed by an anti-clockwise (AC)
circle, with the Northerly starting point in common, distinct from an
AC circle followed by a CW circle?

It would help if the statement of the problem included numbers of paths
for 5 and 10 arcs as well as 25 .
harryh
Posts: 2091
Joined: Tue Aug 22, 2006 9:33 pm
Location: Thessaloniki, Greece

Re: Problem 208 Clarification

Post by harryh »

When you obtained the correct solution for 25 arcs, did you assume that
[3 CW circles followed by 2 AC circles] and [2 AC circles followed by 3 CW circles]
count as different solutions ?
That should give you the answer to what you ask...
Mike
Posts: 10
Joined: Wed Mar 29, 2006 8:03 am
Location: London, England

Re: Problem 208 Clarification

Post by Mike »

Thanks. No surprises when it turned out my problem was with precision
and rounding errors, and not with logic after all.
Mannion
Posts: 2
Joined: Wed Sep 08, 2010 4:24 pm

Re: Problem 208

Post by Mannion »

Hi I am having trouble finding the correct answer like previous posters. I got the algorithm producing the correct results for 25 arcs fairly easily and then managed to speed up the calculation for 70 arcs from several minutes ??? down to less than a second. Now I realise that my answer for 70 is not correct. I am assuming that any unique set of turns is a unique route. ie

LLLLLRRRRRLLLLLRRRRR is different from
RRRRRLLLLLRRRRRLLLLL

Any help would be greatly appreciated.
Mannion
Posts: 2
Joined: Wed Sep 08, 2010 4:24 pm

Re: Problem 208

Post by Mannion »

OK I've nailed it. The clue was in the earlier posts. Don't worry about orientation. I think it was slightly ambiguous though. Fantastic problem nonetheless, I've learned a few new tricks deriving it all from scratch. I think I will go back to the easy problems on page 1 for a while now.
Post Reply