taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Exercise · Volume 1 · 1.2.10-2

Exercise 1.2.10-2

not stated yet in Lean solution written

RatingHM16
MarkersHM (needs higher mathematics)
KindK1, prove: show that a stated fact is true from the written solution
SectionSection 1.2.10 of Volume 1. Companion chapter: Analysis of an algorithm

The task

Derive the formula (13) for the variance from the definition (10).

The exact wording is in your copy of the book.

Hints

Open one hint at a time. Try the exercise again after each.

Hint 1

Differentiate the series G(z)=∑pkzkG(z)=\sum p_kz^k twice and put z=1z=1.

Hint 2

Write k2=k(k−1)+kk^2=k(k-1)+k.

Solution

Show the solution

Assume the derivatives of GG at 11 exist (this is the case when GG is a polynomial, as in the main example, and it holds in general when the moments are finite, with G′(1)G'(1) taken as a one-sided limit). From G′(z)=∑kkpkzk−1G'(z)=\sum_kkp_kz^{k-1} and G′′(z)=∑kk(k−1)pkzk−2G''(z)=\sum_kk(k-1)p_kz^{k-2} we get G′(1)=∑kkpkG'(1)=\sum_kkp_k and G′′(1)=∑kk(k−1)pk=∑kk2pk−∑kkpkG''(1)=\sum_kk(k-1)p_k=\sum_kk^2p_k-\sum_kkp_k. Therefore ∑kk2pk=G′′(1)+G′(1)\sum_kk^2p_k=G''(1)+G'(1). By (10), var⁡(G)=∑kk2pk−mean⁡(G)2=G′′(1)+G′(1)−G′(1)2\operatorname{var}(G)=\sum_kk^2p_k-\operatorname{mean}(G)^2=G''(1)+G'(1)-G'(1)^2.

Check

For the coin series G=(q+pz)2G=(q+pz)^2 with p=q=12p=q=\frac12: G′(1)=1G'(1)=1, G′′(1)=2p2=12G''(1)=2p^2=\frac12. The variance is 12+1−1=12\frac12+1-1=\frac12, and the direct sum gives 14⋅1+12⋅0+14⋅1=12\frac14\cdot1+\frac12\cdot0+\frac14\cdot1=\frac12.

Remarks

The proof of (13) in the text by semi-invariants gives the same formula again. The derivatives of GG at 11 are the factorial moments.

This solution is drafted, and a person has not reviewed it yet. The source.

In Lean

not stated yet The exercise is not stated in Lean yet.

The status is computed from the Lean build. The node of the map.

Something is wrong? Report it.