I'm showing like this. The depth of a tree would be at least lgn. Let C be the number of leaves. Therefore, Omega(lgn). Please tell me, Am I right ?
2026-03-28 21:51:24.1774734684
Show that the average depth of a leaf in a binary tree with n vertices is Omega(lgn)
561 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in DISCRETE-MATHEMATICS
- What is (mathematically) minimal computer architecture to run any software
- What's $P(A_1\cap A_2\cap A_3\cap A_4) $?
- The function $f(x)=$ ${b^mx^m}\over(1-bx)^{m+1}$ is a generating function of the sequence $\{a_n\}$. Find the coefficient of $x^n$
- Given is $2$ dimensional random variable $(X,Y)$ with table. Determine the correlation between $X$ and $Y$
- Given a function, prove that it's injective
- Surjective function proof
- How to find image of a function
- Find the truth value of... empty set?
- Solving discrete recursion equations with min in the equation
- Determine the marginal distributions of $(T_1, T_2)$
Related Questions in TREES
- Explanation for the static degree sort algorithm of Deo et al.
- Finding height of a $k$-ary tree
- Clique-width of a tree
- count "informative" paths in tree
- If the weight of edge E $e$ of an MST is decreased by $\delta$. Could total weight of MST decrease by more than $\delta$.
- Probability of two randomly selected leaves of a tree to be connected only at the root
- Proof in graph theory: maximum degree and number of leaves.
- Graph Theory: Number of vertices in a tree.
- The number of, and an enumeration for, the set of full subtrees of the full complete binary tree
- Is the maximum link length function convex?
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
We start with the two functional equations
$$T(z) = z + z T^2(z)$$
and $$Q(z, u, v) = vz + z Q^2(z, u, uv)$$
where the first one is for binary trees and the second one for binary trees with the depth marked where we set the depth of the root to be zero. The variable $v$ marks leaves and $u$ counts the total depth. We need to extract coefficients from $T(z)$ for the probabilities. We will do this even though the answer is known, because we will re-use the computation later on.
We obtain
$$[z^n] T(z) = \frac{1}{2\pi i} \int_{|z|=\epsilon} \frac{1}{z^{n+1}} T(z) \; dz.$$
Using the functional equation we put $T(z) = w$ so that
$$z = \frac{w}{1+w^2} \quad\text{and}\quad dz = (1-w^2)/(1+w^2)^2 \; dw.$$
and we obtain
$$\frac{1}{2\pi i} \int_{|w|=\gamma} \frac{(1+w^2)^{n+1}}{w^{n+1}} w \frac{1-w^2}{(1+w^2)^2} \; dw \\ = \frac{1}{2\pi i} \int_{|w|=\gamma} \frac{(1+w^2)^{n-1}}{w^{n}} (1-w^2)\; dw.$$
Extracting coefficients we get zero for $n$ even, one for $n=1$ and for $n$ odd, $n\ge 3,$
$${n-1\choose (n-1)/2} - {n-1\choose (n-3)/2} \\ = {n-1\choose (n-1)/2} - {n-1\choose (n-1)/2} \frac{(n-1)/2}{(n+1)/2} = \frac{1}{(n+1)/2} {n-1\choose (n-1)/2}.$$
Now for the average depth we require (yes the derivative is with respect to $u$)
$$A(z) = \left.\frac{\partial}{\partial u} Q(z,u,v)\right|_{u=1, v=1}.$$
Therefore we require
$$B(z) = \left.\frac{\partial}{\partial v} Q(z,u,v)\right|_{u=1, v=1}.$$
We have from the functional equation
$$B(z) = z + 2z T(z) B(z)$$ so that
$$B(z) = \frac{z}{1 - 2 z T(z)}.$$
Returning to $A(z)$ the functional equation yields
$$A(z) = 2z T(z) (A(z) + B(z))$$
or
$$A(z) = \frac{2z T(z) B(z)}{1 - 2 z T(z)} = \frac{2z^2 T(z)}{(1 - 2 z T(z))^2}.$$
The coefficient extraction integral becomes
$$[z^n] A(z) = \frac{1}{2\pi i} \int_{|z|=\epsilon} \frac{1}{z^{n+1}} \frac{2z^2 T(z)}{(1 - 2 z T(z))^2} \; dz.$$
Using the same substitution as before we obtain
$$\frac{1}{2\pi i} \int_{|w|=\gamma} \frac{(1+w^2)^{n+1}}{w^{n+1}} \frac{2w^3/(1+w^2)^2}{(1 - 2 w^2/(1+w^2))^2} \frac{1-w^2}{(1+w^2)^2} \; dw \\ = \frac{1}{2\pi i} \int_{|w|=\gamma} \frac{(1+w^2)^{n-1}}{w^{n+1}} \frac{2w^3}{(1 - w^2)^2} (1-w^2) \; dw \\ = \frac{2}{2\pi i} \int_{|w|=\gamma} \frac{(1+w^2)^{n-1}}{w^{n-2}} \frac{1}{1 - w^2} \; dw.$$
This vanishes for $n=1$, is zero for $n$ even and for $n$ odd has the value
$$2\sum_{q=0}^{(n-3)/2} {n-1\choose q}.$$
Putting $n=2m+3$ we get
$$2\sum_{q=0}^{m} {2m+2\choose q} = 2\times \frac{1}{2} \times \left(2^{2m+2} - {2m+2\choose m+1}\right) = 2^{n-1} - {n-1\choose (n-1)/2}.$$
Recall that a binary tree on $n$ nodes with $n$ odd has $(n+1)/2$ leaves, as can be seen by a simple induction argument. This finally yields for the average depth
$$\frac{1}{(n+1)/2} \left(\frac{1}{(n+1)/2} {n-1\choose (n-1)/2}\right)^{-1} \times \left(2^{n-1} - {n-1\choose (n-1)/2}\right) \\ = {n-1\choose (n-1)/2}^{-1} \times \left(2^{n-1} - {n-1\choose (n-1)/2}\right) \\ = - 1 + 2^{n-1} \times {n-1\choose (n-1)/2}^{-1} .$$
We have from the asymptotic of the central binomial coefficient
$${n-1\choose (n-1)/2} = {2((n-1)/2)\choose (n-1)/2} \sim \frac{4^{(n-1)/2}}{\sqrt{\pi (n-1)/2}}$$
Therefore the average depth is
$$\bbox[5px,border:2px solid #00A000]{ -1+\sqrt{\pi (n-1)/2}.}$$
Remarks. The sequences for the total count (Catalan numbers) and the total depth can be found at OEIS A000108 and OEIS A068551. A Maple script to compute these from the functional equation goes like this:
CF := proc(k) option remember; if k = 0 then return 0 end if; if k = 1 then return v end if; expand(subs(v = u*v, add(CF(q)*CF(k - 1 - q), q = 1 .. k - 1))) end proc; AVG := n-> subs([u=1, v=1], diff(CF(n), u))/ subs([u=1, v=1], CF(n))/((n+1)/2); AVG2 := n -> -1 + sqrt(1/2 *Pi* (n - 1));There is also a Perl script to compute them by total enumeration.
#! /usr/bin/perl -w # my @trees = (-1, [[]]); sub btrees { my ($n) = @_; return $trees[$n] if $n < scalar(@trees); my @res; for(my $k=1; $k<$n-1; $k++){ foreach my $left (@{ btrees($k) }){ foreach my $right (@{ btrees($n-1-$k) }){ push @res, [$left, $right]; } } } $trees[$n] = \@res; return $trees[$n]; } sub treedepths { my ($tree, $tref, $depth) = @_; if(scalar(@$tree) == 0){ $$tref += $depth; return; } treedepths($tree->[0], $tref, $depth+1); treedepths($tree->[1], $tref, $depth+1); } sub alldepths { my ($n) = @_; my $res = 0; foreach my $tree (@{ btrees($n) }){ treedepths($tree, \$res, 0); } return $res; } MAIN: { my $mx = int(shift || 7); for(my $n=1; $n <= $mx; $n++){ my $count = scalar(@{ btrees($n) }); my $depths = alldepths($n); print "$n: $count $depths\n"; } 1; }The result is a table that runs as follows:
This can be extended to about $27$ nodes even though the script is not optimized.
This was also computed using a slightly different approach at the following MSE link.