Maximize Expression Result: Algorithm & Tips

  • Context:
  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Operations
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
evinda
Gold Member
MHB
Messages
3,741
Reaction score
0
Hello! (Wave)

I want to write an algorithm that runs in polynomial time and finds the best way to put parenthesis at a given expression so that the result of the operations is maximized.
The input of the algorithm should be a sequence $a_0, b_0, a_1, b_1, \dots, a_{m-1}, b_{m-1}, a_m$, where $a_0, a_1, \dots, a_m$ are real numbers and $b_0, b_1, \dots, b_{m-1}$ are operators and could be either plus or minus.

Could you give me a hint what we could do in order to find the right order of the parenthesis so that the result of operations of the given expression is maximized? (Thinking)
 
Physics news on Phys.org