Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Reverse engineering a formula...

by Gilimanjaro (Hermit)
on Jun 13, 2006 at 12:27 UTC ( #555016=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Reverse engineering a formula...
in thread Reverse engineering a formula...

Well, look at it this way:

  • You have 19 floats
  • Each float may:
    • Need to be added (multiply by 1)
    • Need to be subtracted (multiply by -1)
    • Need to be ignored (multiply by 0)

This means there are 3 to the power 19 different ways to combine these numbers... That's a lot of possible combinations to try, but it can be done I suppose... You'd probably want to write a recursive algorithm to try all these permutations, and see if the rounded total matches the number you specified...

Update: Possible solution code posted below


Comment on Re^3: Reverse engineering a formula...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://555016]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (14)
As of 2014-07-14 13:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (260 votes), past polls