Problem 185

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.
User avatar
GenePeer
Posts: 112
Joined: Sat Apr 03, 2010 1:14 pm
Contact:

Re: Problem 185

Post by GenePeer »

I just solved it but continued to play around with it to see if I could reduce the runtime. Against my own intuition (or logic? because it must have been intuition that made me try), I arranged the attempts in descending order of correct digits. This reduced the runtime by a factor of (almost) 10! From 2.67s to 275ms.

It would seem to me that 3 attempts with one correct digit each give you more information that helps reduce search space than one attempt with 3 correct digits. Can someone PM me and help me understand this 'paradox'? I'll use the discussion to write a detailed post on the Problem's Forum.
Image
enigmaticcam
Posts: 16
Joined: Wed Sep 30, 2015 12:07 am

Re: Problem 185

Post by enigmaticcam »

Gene, if you're still looking at this problem 6 years later :lol:, I think the reason is that if there is just one correct digit, then there are only 16 possibilities. However, if there are three correct digits, then there are 560 possibilities. So by starting your tree at the top with the minimal amount of branches, your depth search is much lower. That's my guess anyways.
Post Reply