1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Equation Evaluator

  1. Dec 1, 2009 #1
    Given a number of terms, n in an equation containing only addition as the only possible operator, find the different number of valid ways in which they can be evaluated. Order of evaluation is controlled by grouping the terms in brackets

    e.g. if n = 4
    it means that there are 4 terms in the equation – i.e. something like

    Now the valid ways in which it can be evaluated :
    (a + (b + (c+d)))
    (a + ((b+c) + d))
    ((a+b) + (c+d))
    (((a+b) + c) + d)
    ((a + (b+c)) + d)

    So the answer in this case is 5

    what`s the logic to add n numbers in different possible ways?
  2. jcsd
  3. Dec 1, 2009 #2
    Two possible answers, depending on whether you keep them in the same order or not...

    (a+b)+c, a+(b+c) two ways

    (a+b)+c, (a+c)+b, (b+c)+a three ways
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook