Halcyon: I think that Mimer wants the gift of our time.Pablito: Right. He does, doesn’t he.Bong-sun: At least we are his students.Mimer: Harrumph.Dana: Cheer up, Mimer, it was not embarrassing at all.Mimer: Twas...Bong-sun: OK. Maybe a little bit.Anton: Er, guys? What happened?Alfrothul: Not much.The fourth wall: You had to be there.
Here is a declaration for ternary trees with payloads in the leaves:
Inductive ternary_tree (V : Type) : Type :=
Leaf3 : V -> ternary_tree V
| Node3 : ternary_tree V -> ternary_tree V -> ternary_tree V -> ternary_tree V.
These trees are ternary because each node has three subtrees.
Surely there must be a relation between the number of leaves in a given ternary tree and the number of nodes in this ternary tree? Figure out this relation and prove it, using the accompanying file.
N.B.: Since the trees are ternary, each node has three subtrees and each induction proof has three induction hypotheses.
Added Exercise 11.m and Exercise 11.n in the accompanying file [10 Feb 2025]
Added Exercise 00.d and the exercise about ternary trees [07 Feb 2025]
Added Exercise 11 from Week 02 [08 Feb 2025]
Added Exercise 00.d and the exercise about ternary trees [07 Feb 2025]
Created [07 Feb 2025]