Evaluating n Terms in Equations with Addition

  • Context: Undergrad 
  • Thread starter Thread starter suditi.saini
  • Start date Start date
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
suditi.saini
Messages
1
Reaction score
0
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
a+b+c+d

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?
 
Mathematics news on Phys.org
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