# how do you calculate the number of combinations recursive partitioning uses in decision trees?

So I was wondering why random forests limit the levels of a variable to 32 levels, and I found an answer here :
R's randomForest can not handle more than 32 levels. What is workaround?

My question is why is the solution 2^N+2 ? I thought it would be the classic combination equation of N choose K, such that if I had 32 levels of data, choosing 2 at a time to partition would yield 32=N choose 2=K producing :

N! / K!(N-K)!
32! / 2!(30!)
=496

• There are $2^n$ proper subsets of any set of $n$ elements. Each subset corresponds to a distinct path through the tree. Drawing a smaller tree--even $n=3$ nodes will suffice--ought to convince you this is correct.
– whuber
Nov 9 '16 at 23:33
• In case anyone googles and lands on this page, I cross posted and got a very clear response here : stackoverflow.com/questions/40516770/… Nov 10 '16 at 18:31