08.10.2016 Views

Foundations of Data Science

2dLYwbK

2dLYwbK

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

∞∑ ∑<br />

ix i = ∞<br />

i=0<br />

i=0<br />

x d<br />

dx xi = x d<br />

dx<br />

∞∑<br />

x i = x d<br />

i=0<br />

1<br />

=<br />

dx 1−x<br />

x .<br />

(1−x) 2<br />

Example: If A can be selected 0 or 1 times and B can be selected 0, 1, or 2 times and C<br />

can be selected 0, 1, 2, or 3 times, in how many ways can five objects be selected. Consider<br />

the generating function for the number <strong>of</strong> ways to select objects. The generating function<br />

for the number <strong>of</strong> ways <strong>of</strong> selecting objects, selecting only A’s is 1+x, only B’s is 1+x+x 2 ,<br />

and only C’s is 1 + x + x 2 + x 3 . The generating function when selecting A’s, B’s, and C’s<br />

is the product.<br />

(1 + x)(1 + x + x 2 )(1 + x + x 2 + x 3 ) = 1 + 3x + 5x 2 + 6x 3 + 5x 4 + 3x 5 + x 6<br />

The coefficient <strong>of</strong> x 5 is 3 and hence we can select five objects in three ways: ABBCC,<br />

ABCCC, or BBCCC.<br />

The generating functions for the sum <strong>of</strong> random variables<br />

∑<br />

Let f(x) = ∞ p i x i be the generating function for an integer valued random variable<br />

i=0<br />

∑<br />

where p i is the probability that the random variable takes on value i. Let g(x) = ∞ q i x i<br />

be the generating function <strong>of</strong> an independent integer valued random variable where q i<br />

is the probability that the random variable takes on the value i. The sum <strong>of</strong> these two<br />

random variables has the generating function f(x)g(x). This is because the coefficient <strong>of</strong><br />

x i in the product f(x)g(x) is ∑ i<br />

k=0 p kq k−i and this is also the probability that the sum <strong>of</strong><br />

the random variables is i. Repeating this, the generating function <strong>of</strong> a sum <strong>of</strong> independent<br />

nonnegative integer valued random variables is the product <strong>of</strong> their generating functions.<br />

12.8.1 Generating Functions for Sequences Defined by Recurrence Relationships<br />

Consider the Fibonacci sequence<br />

defined by the recurrence relationship<br />

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, . . .<br />

f 0 = 0 f 1 = 1 f i = f i−1 + f i−2 i ≥ 2<br />

Multiply each side <strong>of</strong> the recurrence by x i and sum from i equals two to infinity.<br />

∞∑<br />

f i x i =<br />

i=2<br />

∞∑<br />

f i−1 x i +<br />

i=2<br />

∞∑<br />

f i−2 x i<br />

f 2 x 2 + f 3 x 3 + · · · = f 1 x 2 + f 2 x 3 + · · · + f 0 x 2 + f 1 x 3 + · · ·<br />

i=2<br />

= x ( f 1 x + f 2 x 2 + · · ·) + x 2 (f 0 + f 1 x + · · ·) (12.1)<br />

i=0<br />

419

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!