Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: List all different equations for a given one

by jess195 (Novice)
on Sep 24, 2013 at 18:25 UTC ( #1055522=note: print w/ replies, xml ) Need Help??


in reply to Re: List all different equations for a given one
in thread List all different equations for a given one

actually I was using shunting yard algorithm to do me one thing: break down the equation into parts so I can swtich tings around. For example if I have a * b + c, then the algorithm should return: a b * c +, and then from here I would list different things, like add b a * c +, or c b a * + to the list of accepted equations, yet there are a lot to consider. But that's really difficult to do, as you will end up brute forcing everything. I believe the same goes to your way of solving it. I'm sure there is a smarter way to solve and take into consideration performance.


Comment on Re^2: List all different equations for a given one
Re^3: List all different equations for a given one
by LanX (Canon) on Sep 24, 2013 at 19:30 UTC
    If the only operations allowed are + - / * and ** plus parens then read my answer again for a "smart" solution.

    update

    or specify which operations are allowed... e.g. polynom devisions might a challenge for you.

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2015-07-06 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls