Tag generating functions

The Average Number of Leaves in a Binary Tree of \(N\) Internal Nodes

Let’s use generating functions to count the average number of leaves in a binary tree with \(N\) internal nodes. Definitions Let \(P\)...

The Average Number of 1’s in a Binary String of Length \(N\)

Let’s use generating functions to count the average number of 1’s in a binary string of length \(N\). Definitions Let \(P\) be the set...

Counting With Generating Functions

Generating functions can be used for counting. Consider the problem of finding the number of trees with internal nodes. Let \(T\) be the...

Solving Recurrence Relations With Ordinary Generating Functions

Technique The basic technique is to multiply the equation with \(z^{N}\), sum over all \(N\), recast in terms of the generating function...

Ordinary Generating Functions

Definition An ordinary generating function of a sequence \(\left\{a_{k}\right\}\) is: \begin{equation*} A(z) = \sum_{k\ge 0}a_{k}z^{k}...

Number of Binary Trees of Size \(n\)

Problem How many bits are needed to represent a binary tree with \(n\) nodes? A lower bound is given by the fact that \(m\) bits can...