July 2018 little math problem
|
07-26-2018, 06:16 PM
(This post was last modified: 07-26-2018 07:21 PM by Albert Chan.)
Post: #13
|
|||
|
|||
RE: July 2018 little math problem
(07-26-2018 03:42 AM)Thomas Klemm Wrote:(07-26-2018 12:16 AM)Albert Chan Wrote: If using computer is allowed, I would use Picat Programming LanguageInteresting. Never heard of that language. Picat is a declarative language, based on B-Prolog. All you need is to describe the problem, and it take care of the rest. Using symmetry, sum constraint, the program now run much faster. Picat solved a 9-sided zigzag under 2 minutes: 33452 * 8 = 267616 solutions. If result saved to file, Picat only take 51 seconds. My computer pre-dated Win-XP, so is not fast (I later upgraded Win-XP on it) My guess is Picat does not go brute force by visiting all permutations ... Code: import cp. % zigzag9.pi, all 9 sides sum to same S Edit: Re-reading Thomas last post. My code had exactly the same idea. Symmetry reduce the problem to one eighth its size ... |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)