Note: You are looking at a static copy of the former PineWiki site, used for class notes by James Aspnes from 2003 to 2012. Many mathematical formulas are broken, and there are likely to be other bugs as well. These will most likely not be fixed. You may be able to find more up-to-date versions of some of these notes at http://www.cs.yale.edu/homes/aspnes/#classes.

# 1. At the ice cream store

The Baskin-Baskin ice cream store has the unusual slogan "exactly 4n flavor combinations." By this they mean that if you are willing to spend n dollars for ice cream (plus a small fee for the cone), you can choose exactly 4n combinations of ice cream scoops on a two-scoop cone, where different orders are considered to be different combinations. This is a great improvement on the Robbins-Robbins store down the street, where they provide only vanilla scoops for $0 and chocolate scoops for$1, giving exactly one $0 cone (vanilla-vanilla), two$1 cones (vanilla-chocolate and chocolate-vanilla) and one $2 cone (chocolate-chocolate). Deduce from Baskin-Baskin's slogan a closed-form expression for exactly how many different scoops of ice cream cost$n, for each value of n.

## 1.1. Solution

Let G = 1/(1-4z) be the generating function for the sequence { 4n }. We are looking for a sequence an whose generating function F satisfies F² = G. We can easily solve for F, obtaining F = 1/√(1-4z) = (1-4z)-1/2. And now our troubles begin.

From the Binomial Theorem, we have

Here the only tricky part is computing the binomial coefficient. Expand it as

Plugging this back in to the F sum gives

This gives the suspiciously pleasant solution

## 3.1. Solution

This is an example of a problem that is probably easier to solve without generating functions. First we'll figure out how many ways there are to make $2n using just 1 and ①. Here we can choose anywhere from 0 to 2n 1's, giving 2n+1 possibilities. If we are now allowed 2's, we have n+1 choices of how many 2's to use, leaving 0, 2, 4, ..., 2n dollars left to divide between 1's and ①'s. So the total number of ways to do this is If one must solve the problem using generating functions, the trick is to make one unit of weight equal$2. Then the generating function for $2 bills is just our old friend 1/(1-z) and the generating function for the$1 objects is

Taking the product gives

If we are very lucky we might recognize this as d/dz (z d/dz 1/(1-z)) = d/dz (z/(1-z)²) = 2z/(1-z)³ + 1/(1-z)², the generating function for (n+1)2. But more likely we have to expand it out using, say, the Binomial Theorem to get the coefficients of (1-z)3 and (1-z)2. We leave this pleasant and enjoyable task as an exercise for the reader.

# 4. Independence

Let and A and B be independent events on some probability space. Prove or disprove: their complements -A and -B are also independent.

## 4.1. Solution

Let Pr[A] = p and Pr[B] = q. From independence of A and B we have Pr[AB] = pq. Since A is a disjoint union of A∩B and A∩-B, we have Pr[A] = Pr[AB] + Pr[A∩-B] so Pr[A∩-B] = p - pq. Similarly we have that -B is a disjoint union of -A∩-B and A∩-B; it follows that Pr[-B] = 1-q = Pr[-A∩-B] + Pr[A∩-B] and thus that Pr[-A∩-B] = 1-q-Pr[A∩-B] = 1-q-(p-pq) = 1-p-q+pq = (1-p)(1-q) = Pr[-A]Pr[-B]. But then we have Pr[-A∩-B] = Pr[-A]Pr[-B], so -A and -B are independent.

2014-06-17 11:57