## One tree, many possibilities

### Introduction

Given the finite set and the surjective function , Let be a complete -ary tree of depth n such that , . For example, Let and , . Pictured bellow is with omitting for brevity.

It should be evident from the example that the set of nodes at depth is the -ary Cartesian product of .

Now, if we change to now be , where , the set of all leaf nodes at depth is the set of permutations of . Extending the example above, .

Without changing the definition of , it is possible to produce all possible -permutations from by selecting all nodes at depth .

At this point, if we make a small change to , every node in now represents the power set of . Again, using the example from above, .

Finally, without any further changes to the definition of , it is possible to produce all possible -combinations from , by selecting all nodes at depth .

is a very elegant way of representing and enumerating some of the most rudimentary combinatorial operations of introductory mathematics. In this series of post we’ll explore each operation and look at implementations, time complexities and possible applications.

[…] my previous post, I wrote about how to construct a rule based tree that allows one to generate the outputs of a […]

One tree, many possibilities: Part 2 « Antimatroid, The2010-07-24 at 8:54 pm

[…] to enumerate the sets produced by different counting techniques. You can catch up on the idea in part one and the C# implementation in part two. In this post I’m going to cover how to take the […]

One tree many possibilities: Part 3 « Antimatroid, The2011-02-01 at 8:16 am