taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 2.3-10

Exercise 2.3-10

not stated yet in Lean solution written

RatingM20
MarkersM (mathematical)
KindK2, decide: say whether a claim holds from the written solution
SectionSection 2.3 of Volume 1

The task

A collection of nonempty sets is nested if any two members are disjoint or one contains the other. Does each finite nested collection correspond to a tree?

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Order the members by inclusion. Find the parent of a member.

Hint 2

Try the collection {1},{2}\{1\}, \{2\}.

Solution

Show the solution

Answer: no. A finite nested collection of distinct sets corresponds to a forest. It corresponds to a tree exactly when one member contains all the others.

The collection {{1},{2}}\{\{1\}, \{2\}\} is nested. It has two maximal members and no member that contains both, so it has two roots. It is a forest of two trees, not a tree.

Proof that the collection is a forest. Let CC be finite and nested. For a member YY, the members that contain YY form a chain under inclusion. Indeed, two of them share the elements of YY, which is nonempty, so they are not disjoint, so one contains the other. The chain is finite, so it has a smallest member when it is not empty. Define this smallest member as the parent of YY. A member with no proper superset in CC has no parent, and it is a root.

With this parent relation each member has at most one parent, and a member XX is an ancestor of YY exactly when X⊃YX \supset Y. The members below any root form a tree, by induction on their number. So CC is a forest. It is a tree if and only if it has one root, that is, one member that contains all the others.

If the union of all members is added, the collection stays nested and becomes a tree.

Check

A python3 program enumerated all nested families of distinct nonempty subsets of {1,2,3}\{1, 2, 3\}. There are 27−1=1272^7 - 1 = 127 nonempty families of the 7 nonempty subsets, and found 63 nested families. Of these, 47 have exactly one maximal member (a tree) and 16 have two or more (a forest of several trees). For example, {{1},{2}}\{\{1\}, \{2\}\} has two roots and {{1,2},{1},{2}}\{\{1, 2\}, \{1\}, \{2\}\} has one.

Remarks

The same argument is the one of exercise 2.3-12: nested sets are one of the ways to describe a forest.

This solution is drafted, and a person has not reviewed it yet. The source.

In Lean

not stated yet The exercise is not stated in Lean yet.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.