<p>I posed this question as a challenge to my students and I'm proud to report that they did not disappoint! Here's an argument based on ones developed by my students Kevin Tan and Max Arseneault, providing an intuition as to how the marking rule, applied to binomial trees, gives rise to the Fibonacci sequence. </p>

<p>Our goal will be to find a lower bound on the number of nodes that can be in a tree in a Fibonacci heap that has order <span class="math-container">$k$</span>. We'll say that a <strong><em>maximally damaged tree of order <span class="math-container">$k$</span></em></strong> is a binomial tree of order <span class="math-container">$k$</span> that has lost as many nodes as possible while obeying the Fibonacci heap marking rules, subject to the restriction that the root node still has <span class="math-container">$k$</span> children (and, thus, the tree has order <span class="math-container">$k$</span>). For example, here's the first few maximally damaged trees:</p>

<p><img src="https://i.sstatic.net/VFriZ.png" alt="pictures of the first five maximally damaged trees"></p>

<p>Notice that cutting any of the remaining nodes from their parents would trigger a cascading cut that removes a child from the root.</p>

<p>Our goal will be to show that if <span class="math-container">$MD[n]$</span> denotes the number of nodes in a maximally-damaged tree of order <span class="math-container">$k$</span>, then <span class="math-container">$MD[n]$</span> satisfies the recurrence relation</p>

<p><span class="math-container">$$MD[k+2] = MD[k] + MD[k+1],$$</span></p>

<p>at which point it's no longer surprising that we see the Fibonacci sequence popping up.</p>

<p>To do so, consider a binomial tree of order <span class="math-container">$k+2$</span>, like the one shown here:</p>

<p><img src="https://i.sstatic.net/pNlON.png" alt="a binomial tree of order k+2, where in this case k=3."></p>

<p>We'd like to remove as many nodes from this tree as we can without cutting any direct children of the root. To do so, we'll imagine partitioning the nodes in this tree into two binomial trees of order <span class="math-container">$k+1$</span> by separating out the order-<span class="math-container">$k+1$</span> child from the remaining children, as shown here:</p>

<p><img src="https://i.sstatic.net/7rWGy.png" alt="partitioning the tree into two trees of order k+1."></p>

<p>We haven't actually cut this link - that would remove a child of the root - and instead are just doing this for accounting purposes.</p>

<p>Now, think about the binomial tree of order <span class="math-container">$k+1$</span> containing the tree root. Focusing purely on this tree, we'd like to remove as many nodes as possible while still leaving the root with <span class="math-container">$k+1$</span> children. Stated differently, we have a binomial tree of order <span class="math-container">$k+1$</span> and want to remove as many nodes as possible without removing any children of the root, which is exactly what the maximally damaged trees represent. So let's restructure the root's binomial tree to look like a maximally-damaged tree of order <span class="math-container">$k+1$</span>, as shown here:</p>

<p><img src="https://i.sstatic.net/U1puf.png" alt="the top tree of order k+1 is now a maximally-damaged tree of order k+1"></p>

<p>Next, let's focus on the child subtree of order <span class="math-container">$k+1$</span>. We can cut away as many nodes from this tree as we'd like, provided that we don't trigger a cascading cut that would cut this subtree from the overall order-<span class="math-container">$k+2$</span> tree root. Since this tree is allowed to lose a child without being cut from its parent, it makes sense to remove its largest child subtree, which would be its child of order <span class="math-container">$k$</span>, since that would immediately eliminate the most nodes. Doing that gives us the following setup:</p>

<p><img src="https://i.sstatic.net/5MOQd.png" alt="the right subtree lost its k-order child, so it is now a marked tree shaped as a binomial tree of order k."></p>

<p>Notice that this tree is now a binomial tree of order k and that its root has been marked.</p>

<p>From here, we'd like to cut away as many nodes as we possibly can. However, since the root of this subtree is now marked, we cannot cut any direct children away from the root of this subtree. If we did, that would trigger a cascading cut that would cut the whole subtree away from the global tree root, which isn't allowed. And so we're left with a smaller copy of the same problem from earlier: we have a binomial tree of order <span class="math-container">$k$</span> and we want to cut away as many nodes as possible without cutting any direct children of the root. That means we want to form a maximally-damaged tree of order <span class="math-container">$k$</span>, as shown here:</p>

<p><img src="https://i.sstatic.net/rY7wQ.png" alt="the right subtree is a now a maximally damaged tree of order k">.</p>

<p>Putting everything together, we see that the shape of the overall tree can be partitioned into a maximally-damaged tree of order <span class="math-container">$k+1$</span> and a maximally-damaged tree of order <span class="math-container">$k$</span>:</p>

<p><img src="https://i.sstatic.net/9dHpC.png" alt="the overall tree, represented as a union of a maximally damaged tree of order k+1 and a maximally damaged tree of order k"></p>

<p>Overall, this shows that <span class="math-container">$MD[k+2] = MD[k] + MD[k+1]$</span>, which is where the Fibonacci recurrence comes in. All that's left to do is to check that the base cases satisfy <span class="math-container">$MD[0] = F_2$</span> and <span class="math-container">$MD[1] = F_3$</span> (they do) and we've got the bound of <span class="math-container">$MD[k] \ge F_{k+2}$</span>. Tada!</p>

CC BY-SA 4.0
2020-05-15T17:10:07.237Z
2020-05-15T17:20:53.893Z
2020-05-15T17:20:53.893Z
templatetypedef
<p>Fibonacci heaps have a simple rule that ensures its tree sizes grow exponentially with their ranks:</p>

<blockquote>
  <p>A node can lose at most one child. Once that child is lost, the node must be cut from its parent.</p>
</blockquote>

<p>I'm comfortable with the proof that a tree in a Fibonacci heap of rank <span class="math-container">$r$</span> has at least <span class="math-container">$F_{r+2}$</span> nodes, and can prove it cleanly use induction.</p>

<p>However, I don't have any intuitive understanding as to why the above rule would give rise to Fibonacci numbers this way. The "default" shape of the trees in a Fibonacci heap is given by the binomial trees, which have lots of nice mathematical properties but none that (immediately) seem like they'd translate into Fibonacci numbers after nodes are lost this way. The best guess I have is that this somehow relates to writing Fibonacci numbers as sums of diagonal binomial coefficients, but I don't see a way to connect that sum to the trees produced this way.</p>

<p>Is there a simple, intuitive, and, most importantly, non-inductive explanation as to why the marking rule in Fibonacci heaps would give rise to Fibonacci-sized trees?</p>

CC BY-SA 4.0
2020-05-08T14:01:55.817Z
Think about what happens to a Binomial tree if, from every internal node, you remove the maximum-degree child (and the subtree rooted at that child).  Per the proof that you refer to, doesn't this give you the maximum size Fibonacci tree (with root of a given degree)?  And isn't the number of nodes in the resulting tree the appropriate Fibonacci number?
Neal Young
CC BY-SA 4.0
2020-05-08T15:18:58.770Z
I understand that that’s how you’d make the tree with the fewest nodes, and I can use induction to formalize that this gives back the Fibonacci numbers. But I don’t have a deep intuition as to why starting with binomial trees (based on powers of two / binomial coefficients) and removing one child from each tree this way (feels like subtracting powers of two?) would give the Fibonacci sequence.
templatetypedef
CC BY-SA 4.0
2020-05-08T16:35:00.153Z
It just changes the recurrence... not sure there's any more to say..
Neal Young
<ds.data-structures>
Is there a simple, intuitive explanation for why trees in Fibonacci heaps have the sizes they do?
templatetypedef
# Is there a simple, intuitive explanation for why trees in Fibonacci heaps have the sizes they do?

(Asked by: username_0 on 2020-05-07)

Fibonacci heaps have a simple rule that ensures its tree sizes grow exponentially with their ranks:

> A node can lose at most one child. Once that child is lost, the node must be cut from its parent.

I'm comfortable with the proof that a tree in a Fibonacci heap of rank $r$ has at least $F\_{r+2}$ nodes, and can prove it cleanly use induction.

However, I don't have any intuitive understanding as to why the above rule would give rise to Fibonacci numbers this way. The "default" shape of the trees in a Fibonacci heap is given by the binomial trees, which have lots of nice mathematical properties but none that (immediately) seem like they'd translate into Fibonacci numbers after nodes are lost this way. The best guess I have is that this somehow relates to writing Fibonacci numbers as sums of diagonal binomial coefficients, but I don't see a way to connect that sum to the trees produced this way.

Is there a simple, intuitive, and, most importantly, non-inductive explanation as to why the marking rule in Fibonacci heaps would give rise to Fibonacci-sized trees?

**Tags:** ds.data-structures
> **Comments:**
> **username_1**: Think about what happens to a Binomial tree if, from every internal node, you remove the maximum-degree child (and the subtree rooted at that child).  Per the proof that you refer to, doesn't this give you the maximum size Fibonacci tree (with root of a given degree)?  And isn't the number of nodes in the resulting tree the appropriate Fibonacci number?  
> **username_0**: I understand that that’s how you’d make the tree with the fewest nodes, and I can use induction to formalize that this gives back the Fibonacci numbers. But I don’t have a deep intuition as to why starting with binomial trees (based on powers of two / binomial coefficients) and removing one child from each tree this way (feels like subtracting powers of two?) would give the Fibonacci sequence.  
> **username_1**: It just changes the recurrence... not sure there's any more to say..  

---

## 1 answers

### Answer by username_0 on 2020-05-15. Score: 4 | Accepted answer

I posed this question as a challenge to my students and I'm proud to report that they did not disappoint! Here's an argument based on ones developed by my students Kevin Tan and Max Arseneault, providing an intuition as to how the marking rule, applied to binomial trees, gives rise to the Fibonacci sequence.

Our goal will be to find a lower bound on the number of nodes that can be in a tree in a Fibonacci heap that has order $k$. We'll say that a ***maximally damaged tree of order $k$*** is a binomial tree of order $k$ that has lost as many nodes as possible while obeying the Fibonacci heap marking rules, subject to the restriction that the root node still has $k$ children (and, thus, the tree has order $k$). For example, here's the first few maximally damaged trees:

![pictures of the first five maximally damaged trees](https://i.sstatic.net/VFriZ.png)

Notice that cutting any of the remaining nodes from their parents would trigger a cascading cut that removes a child from the root.

Our goal will be to show that if $MD[n]$ denotes the number of nodes in a maximally-damaged tree of order $k$, then $MD[n]$ satisfies the recurrence relation

$$MD[k+2] = MD[k] + MD[k+1],$$

at which point it's no longer surprising that we see the Fibonacci sequence popping up.

To do so, consider a binomial tree of order $k+2$, like the one shown here:

![a binomial tree of order k+2, where in this case k=3.](https://i.sstatic.net/pNlON.png)

We'd like to remove as many nodes from this tree as we can without cutting any direct children of the root. To do so, we'll imagine partitioning the nodes in this tree into two binomial trees of order $k+1$ by separating out the order-$k+1$ child from the remaining children, as shown here:

![partitioning the tree into two trees of order k+1.](https://i.sstatic.net/7rWGy.png)

We haven't actually cut this link - that would remove a child of the root - and instead are just doing this for accounting purposes.

Now, think about the binomial tree of order $k+1$ containing the tree root. Focusing purely on this tree, we'd like to remove as many nodes as possible while still leaving the root with $k+1$ children. Stated differently, we have a binomial tree of order $k+1$ and want to remove as many nodes as possible without removing any children of the root, which is exactly what the maximally damaged trees represent. So let's restructure the root's binomial tree to look like a maximally-damaged tree of order $k+1$, as shown here:

![the top tree of order k+1 is now a maximally-damaged tree of order k+1](https://i.sstatic.net/U1puf.png)

Next, let's focus on the child subtree of order $k+1$. We can cut away as many nodes from this tree as we'd like, provided that we don't trigger a cascading cut that would cut this subtree from the overall order-$k+2$ tree root. Since this tree is allowed to lose a child without being cut from its parent, it makes sense to remove its largest child subtree, which would be its child of order $k$, since that would immediately eliminate the most nodes. Doing that gives us the following setup:

![the right subtree lost its k-order child, so it is now a marked tree shaped as a binomial tree of order k.](https://i.sstatic.net/5MOQd.png)

Notice that this tree is now a binomial tree of order k and that its root has been marked.

From here, we'd like to cut away as many nodes as we possibly can. However, since the root of this subtree is now marked, we cannot cut any direct children away from the root of this subtree. If we did, that would trigger a cascading cut that would cut the whole subtree away from the global tree root, which isn't allowed. And so we're left with a smaller copy of the same problem from earlier: we have a binomial tree of order $k$ and we want to cut away as many nodes as possible without cutting any direct children of the root. That means we want to form a maximally-damaged tree of order $k$, as shown here:

![the right subtree is a now a maximally damaged tree of order k](https://i.sstatic.net/rY7wQ.png).

Putting everything together, we see that the shape of the overall tree can be partitioned into a maximally-damaged tree of order $k+1$ and a maximally-damaged tree of order $k$:

![the overall tree, represented as a union of a maximally damaged tree of order k+1 and a maximally damaged tree of order k](https://i.sstatic.net/9dHpC.png)

Overall, this shows that $MD[k+2] = MD[k] + MD[k+1]$, which is where the Fibonacci recurrence comes in. All that's left to do is to check that the base cases satisfy $MD[0] = F\_2$ and $MD[1] = F\_3$ (they do) and we've got the bound of $MD[k] \ge F\_{k+2}$. Tada!


---

