MHB Maximize Expression Result: Algorithm & Tips

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Operations
Click For Summary
The discussion centers on developing a polynomial-time algorithm to optimize the placement of parentheses in a mathematical expression to maximize the result of operations involving real numbers and binary operators (addition and subtraction). The input format consists of a sequence of numbers and operators. The problem is likened to the Matrix Chain Multiplication problem, suggesting that dynamic programming techniques may be applicable. Participants are encouraged to explore strategies for determining the optimal order of operations to achieve the maximum result.
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)
 
Technology news on Phys.org
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 27 ·
Replies
27
Views
6K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
5K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
Replies
1
Views
1K