Post Reply 
Mini-challenge: digits by half
03-31-2022, 11:07 AM
Post: #12
RE: Mini-challenge: digits by half
(03-30-2022 04:25 PM)Albert Chan Wrote:  If the goal is efficiency, even with brute force, I would reduce search space more.
Instead of 7! = 5040 cases, split between n and d. Why not just do n ?
...
(lots of possible optimizations)
...

My goal wasn't computation efficiency, but rather my efficiency. I wanted to get the answer(s) in as little of my time as was needed.

True confession: I only ran my code on a real 50g out of curiosity to see how long it would take. In actuality, the above RPL code was written using an emulator running on my laptop, and the final answer was produced in slightly over 14 seconds. It would definitely take me longer than 14 seconds to start altering the approach to limit the search using optimizations. I suspect you (and most everyone else here) would come up with shortcuts much faster than I could, though, so I don't mean to imply that my limitations apply to everyone else.

My point is simply that this particular problem can easily be solved using our calculators in a reasonable amount of time, even with the non-optimized brute force approach. I'm not suggesting that it is wrong to optimize the approach, just that I had no particular need or inclination to do so once the problem was already solved. The available tools allowed me to do this quite easily, which was enough to satisfy my curiosity.

The fun of this kind of puzzle is in the analysis and seeking out those optimizations that you and others have found, which is exactly the kind of thing I look forward to doing when I can find the time. Perhaps if I can ever retire! Smile
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Mini-challenge: digits by half - Allen - 03-28-2022, 10:34 PM
RE: Mini-challenge: digits by half - DavidM - 03-31-2022 11:07 AM



User(s) browsing this thread: 1 Guest(s)