2. Let T be the set of all rooted, ordered, possibly empty, binary trees. Rooted means...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
2. Let T be the set of all rooted, ordered, possibly empty, binary trees. Rooted means that we are not considering trees as special cases of graphs (where any connected graph without cycles specifies a single tree, regardless of how it's laid out). Ordered means that the mirror image of a tree is considered a distinct tree, unless the original tree is symmetrical. Including the empty tree allows us to say that each node has exactly two sub-trees, which can help avoid dividing into cases. And then it's convenient to define the height of a tree to be its number of levels, so that the height of a tree is always a natural number. In particular, the height of an empty tree is zero. And the height of any non-empty tree is one more than the maximum of the heights of its root's two sub-trees. If you have any trouble with this question, do the following first. In particular, before asking about this question on the bulletin board or in office hours, make sure you have done this "warmup" first and feel free to ask about it: • Draw the set of trees for each of the heights 0, 1, 2, and 3. As usual, try to combine previous trees (in particular, avoid thinking about it as adding leaves). Try to be systematic. If there are more trees of height 3 than you want to draw, try to describe a partition of the set of them into sub-sets collecting elements you could construct in "similar" ways. • Describe how you could generate the set of trees of height 4 now, or if the specialness of small trees is hiding a general approach then describe how you could generate the set of trees of height 236 from the sets of trees of all previous heights. • If you use Σ or II notation, check the initial and final indices of each use by instantiating the term formula with the initial and the final indices. And instantiate your recurrence and proof with small heights. You may use "..." notation, but you still have to pay attention to whether you are assuming that there are at least as many terms as you write out explicitly and whether that assumption is correct. Even if you use Σ or II notation it is worth writing them out with "..." notation as a check (in particular, that requires instantiating the terms with at least the initial and final index), and it often visually reveals the algebra you want to perform on them. ● Try instances of the Inductive Step. (a) For each he N, let by be the number of elements of T of height h. State, and justify, a recurrence for b. (b) Define a sequence by ao = 0, and an+1 = a + 1 for each n € N. Prove, by Complete Induction, that bh+1 = ah+1 - a for each he N. 2. Let T be the set of all rooted, ordered, possibly empty, binary trees. Rooted means that we are not considering trees as special cases of graphs (where any connected graph without cycles specifies a single tree, regardless of how it's laid out). Ordered means that the mirror image of a tree is considered a distinct tree, unless the original tree is symmetrical. Including the empty tree allows us to say that each node has exactly two sub-trees, which can help avoid dividing into cases. And then it's convenient to define the height of a tree to be its number of levels, so that the height of a tree is always a natural number. In particular, the height of an empty tree is zero. And the height of any non-empty tree is one more than the maximum of the heights of its root's two sub-trees. If you have any trouble with this question, do the following first. In particular, before asking about this question on the bulletin board or in office hours, make sure you have done this "warmup" first and feel free to ask about it: • Draw the set of trees for each of the heights 0, 1, 2, and 3. As usual, try to combine previous trees (in particular, avoid thinking about it as adding leaves). Try to be systematic. If there are more trees of height 3 than you want to draw, try to describe a partition of the set of them into sub-sets collecting elements you could construct in "similar" ways. • Describe how you could generate the set of trees of height 4 now, or if the specialness of small trees is hiding a general approach then describe how you could generate the set of trees of height 236 from the sets of trees of all previous heights. • If you use Σ or II notation, check the initial and final indices of each use by instantiating the term formula with the initial and the final indices. And instantiate your recurrence and proof with small heights. You may use "..." notation, but you still have to pay attention to whether you are assuming that there are at least as many terms as you write out explicitly and whether that assumption is correct. Even if you use Σ or II notation it is worth writing them out with "..." notation as a check (in particular, that requires instantiating the terms with at least the initial and final index), and it often visually reveals the algebra you want to perform on them. ● Try instances of the Inductive Step. (a) For each he N, let by be the number of elements of T of height h. State, and justify, a recurrence for b. (b) Define a sequence by ao = 0, and an+1 = a + 1 for each n € N. Prove, by Complete Induction, that bh+1 = ah+1 - a for each he N.
Expert Answer:
Answer rating: 100% (QA)
This question is asking to analyze rooted ordered binary trees and to establish a relationship between the number of binary trees of a certain height ... View the full answer
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date:
Students also viewed these programming questions
-
Will the Canadian Galaxy Digital Holdings stock reach $2000 per share in the future? How many years will it take to reach $2000 per share in the future? Explain why you as a course hero tutor...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Please write an summary according to the article. Please don't copy from others and write full view of article in the summary. Value creation. Wealth creation. These are really powerful words. Maybe...
-
Describe some practical examples of the single-resource sequencing problem.
-
What is the difference between strong and weak semaphores?
-
Typically, at the completion of a device I/O, a single interrupt is raised and appropriately handled by the host processor. In certain settings, 96 Chapter 13 I/O Systems however, the code that is to...
-
A technician has just taken their first set of readings on an alignment job. The solution calls for the removal of 0.100 inch from the back feet of the motor. There are no shims under the motor back...
-
Assume that you are considering selecting assets from among the following four candidates: Assume that there is no relationship between the amount of rainfall and the condition of the stock market....
-
Do you think that people under the age of 18 should be required to wear protective helmets when skateboarding, in-line, bicycling, snowboarding, or skiing? Why or why not.
-
When faced with a clearly erroneous precedent, my rule is simple, writes Supreme Court Justice Clarence Thomas. We should not follow it. How do these words offer a cautionary tale for managers...
-
Smitty Nursing Homes Ltd is cash rich because of several consecutive good years. One of the alternative uses for the excess funds is an acquisition. Linda Wade, Smitty's treasurer, has been asked to...
-
What extent do power dynamics influence the labeling of behaviors as deviant within institutional structures ?
-
You have done an investigation and worked out that if employees were to buy access to these streaming services on their own, the cost would be around $1,200 per year. Assuming that (1) employees live...
-
In regards to S.D. Taylor Jewellers there are a few comments to be made during the analysis. S.D. has been purchasing jewelry products from Gardiner for the last 25 years, this allows for a long and...
-
When the Covid-19 pandemic began some people were struggling more than others. For example, Candice had lost her job and was struggling to keep her elderly mother healthy, trying to keep food on the...
-
The largest land mammal is the African Elephant. The average adult has a mass of 5,400 kilograms. Express this mass in grams.
-
Use a ruler and a protractor to construct a triangle that has two angles with the indicated measures. Record your results in the table. 1. 30,50 2. 40,50 5. 110. 70 4. 60, 60 Problem 2 32 A 10 Sum of...
-
Do animals have rights? If so, what are they? What duties do human beings have toward animals? Does KFC protect animal welfare at an acceptable level?
-
We say that a bipartite graph G = (V, E), where V = L R, is d-regular if every vertex V has degree exactly d. Every d-regular bipartite graph has |L| = |R|. Prove that every d-regular bipartite...
-
A compare-exchange operation on two array elements A[i] and A[j], where i < j, has the form COMPARE-EXCHANGE (A, i, j) 1 If A[i] > A[j] 2 exchange A[i] with A[j] After the compare-exchange operation,...
-
Prove the generalization of DeMorgan?s laws to any finite collection of sets: A1 N A2 N n An A1 U A2 U U An AjU A, UU An , AN A2 N n An .
-
Why is macroeconomic forecasting so difficult? Does this difficulty mean economics is a worthless field of study?
-
Which of the following statements are positive in nature and which are normative? a. A tax cut will raise interest rates. b. A reduction in the payroll tax would primarily benefit poor and...
-
a. Calculate the total percentage growth in average labor productivity in the U.S. economy for the 1950s, 1960s, 1970s, 1980s, 1990s, and 2000s. Define average labor productivity for any year as real...
Study smarter with the SolutionInn App