160 likes | 281 Views
Ch. 10 Trees. 10.1 Intro. 4 Examples – trees or not?. Example of ___. Rooted tree. Definitions. Def .: Tree - a connected undirected graph with no simple circuits Forest -
E N D
Ch. 10 Trees 10.1 Intro
Definitions Def.: • Tree- a connected undirected graph with no simple circuits • Forest- • Rooted tree- tree with a root --i.e. a tree where one vertex is designated as the root and every other edge is directed away from it (ex: descendents, ancestors,…) • Leaf- vertex of tree with no children • Internal vertex-vertex with children
More Def: • m-arytree: a rooted tree where every internal vertex has no more than m children • Special case: m=2 is a binary tree • full m-ary tree: an m-ary tree where every internal vertex has exactly m children.
Uses of trees • Geneology • Organizational chart • Chain letters • Sales organizations- pyramids • Computer science -- searching, sorting, coding • Chemistry • Counting
Theorem 1 Theorem 1: An undirected graph is a tree iff there is a unique simple path between any of the vertices. Proof: Assume that there is a unique simple path between any two vertices. Therefore, the graph is ____ To show that it is a tree, show that ____________ To see this, suppose T has a simple circuit containing x and y. There, there would be ________ This is a contradiction. So, we conclude that ___________ …
…proof Theorem 1: An undirected graph is a tree iff there is a unique simple path between any of the vertices. …proof: Assume T is a tree. So T is connected and there exists a path between ________ Let x and y be vertices. To see that there exists a unique simple path, assume not. So, assume that there are 2 paths. Therefore, there is a ________. Thm. 1 from 9.4 says that it is simple. So it is not a tree, and we have a contradiction. In conclusion, ___________
Thm. 2, 3 Theorem 2: A tree with n vertices has n-1 edges Theorem 3: A full m-ary tree with i internal vertices contains n=mi+1 vertices Note: full m-ary tree: n=mi+1, n=l+i
Thm. 4 Theorem 4: A full m-ary tree with n vertices has i=(n-1)/m and l=n – i i internal vertices has n=mi+1 and l=n - i l leaves has i=(l-1)/(m-1) and n=l+i Pf:
Ex Ex: A chain starts when a person sends it to 5 others. These either ignore it or send it to 5 more. If 21 people receive it, how many sent it? Did not? N=21, i= ? l = 17? Ex: 5-ary 2001 see it=n Number who sent it=? Number who didn’t=?
…Ex Ex: 5-ary chain letter 10,000 send it Number who receive it= ? Number who don’t send it = ?