Post Reply 
July 2018 little math problem
07-26-2018, 03:38 PM (This post was last modified: 07-26-2018 04:14 PM by DavidM.)
Post: #11
RE: July 2018 little math problem
(07-26-2018 01:03 PM)John Keith Wrote:  Actually not brute force as it uses analysis of the problem.

Well, I was thinking that any method based on visiting every permutation would be considered "brute force", though I see your point.

Here's another method that doesn't visit every permutation. It only permutes the remaining variables if the currently selected branches qualify. You might say that it's a wee bit faster.

This one I would definitely not call "brute force". Smile

edit: I just ran this on a real 50g, and it found the same 96 solutions in about 27 minutes. I'm sure this isn't the fastest possible approach on this platform, but it's certainly much better than my first attempt! The Prime (or a newRPL 50g) should be able to do something like this much faster.
Code:
Spoiler alert...











\<<
  0. 8. NDUPN \-> a b c d e f g h i
  \<<
    9. LSEQ
    4.
    \<<
      { a b d e } STO
      a b + d e + SAME
      \<<
        CRMNT
        3.
        \<<
          { c f g } STO
          c d + f g + SAME
          \<<
            CRMNT
            2.
            \<<
              { h i } STO
              e f + h i + SAME
              \<<
                { a b c d e f g h i } LRCL R\->I
              \>>
              IFT
            \>>
            DOPERM EVAL
          \>>
          IFT
        \>>
        DOPERM EVAL
      \>>
      IFT
    \>>
    DOPERM
  \>>
\>>
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
July 2018 little math problem - pier4r - 07-25-2018, 08:52 PM
RE: July 2018 little math problem - DavidM - 07-26-2018, 04:03 AM
RE: July 2018 little math problem - DavidM - 07-26-2018 03:38 PM
RE: July 2018 little math problem - pier4r - 07-26-2018, 12:36 PM
RE: July 2018 little math problem - pier4r - 07-27-2018, 10:03 AM
RE: July 2018 little math problem - DavidM - 07-28-2018, 04:22 PM
RE: July 2018 little math problem - pier4r - 08-01-2018, 02:13 PM



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