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.

and hence<br />

dist 2 (X 1 , X 2 ) = ‖X 1 ‖ 2 F − ∥ ∥<br />

∥X 2 X2 T X 1 2<br />

. F<br />

Intuitively, the distance between X 1 and X 2 is the Frobenius norm <strong>of</strong> the component <strong>of</strong><br />

X 1 not in the space spanned by the columns <strong>of</strong> X 2 .<br />

If X 1 and X 2 are 1-dimensional unit length vectors, dist 2 (X 1 , X 2 ) is the sin squared<br />

<strong>of</strong> the angle between the spaces.<br />

Example: Consider two subspaces in four dimensions<br />

⎛ ⎞<br />

√1<br />

⎛<br />

2<br />

0<br />

1<br />

0 √3 ⎟<br />

X 1 = ⎜<br />

⎝<br />

1 √<br />

2<br />

1 √3<br />

0<br />

1 √3<br />

⎟<br />

⎠<br />

Here<br />

⎛ ⎞<br />

1 ⎛<br />

√ 2<br />

0<br />

dist 2 0 √3 1<br />

(X 1 , X 2 ) =<br />

⎜ 1<br />

⎝ √ √3 1 ⎟<br />

2<br />

⎠ − ⎜<br />

⎝<br />

∥<br />

1<br />

0 √3<br />

⎛ ⎞<br />

2<br />

0 0<br />

0 0<br />

=<br />

⎜<br />

⎝ √1<br />

√3 1<br />

⎟<br />

2<br />

⎠<br />

= 7 6<br />

∥<br />

∥<br />

0<br />

1 √3<br />

F<br />

1 0<br />

0 1<br />

0 0<br />

0 0<br />

X 2 =<br />

⎞<br />

⎟<br />

⎠<br />

⎜<br />

⎝<br />

1 0<br />

0 1<br />

0 0<br />

0 0<br />

⎞<br />

⎟<br />

⎠<br />

( 1 0 0 0<br />

0 1 0 0<br />

⎛<br />

)<br />

⎜<br />

⎝<br />

√1<br />

2<br />

0<br />

1<br />

0 √3<br />

√1<br />

√3 1<br />

2<br />

0<br />

1 √3<br />

In essence, we projected each column vector <strong>of</strong> X 1 onto X 2 and computed the Frobenius<br />

norm <strong>of</strong> X 1 minus the projection. The Frobenius norm <strong>of</strong> each column is the sin squared<br />

<strong>of</strong> the angle between the original column <strong>of</strong> X 1 and the space spanned by the columns <strong>of</strong><br />

X 2 .<br />

12.8 Generating Functions<br />

∑<br />

A sequence a 0 , a 1 , . . ., can be represented by a generating function g(x) = ∞ a i x i . The<br />

advantage <strong>of</strong> the generating function is that it captures the entire sequence in a closed<br />

form that can be manipulated as an entity. For example, if g(x) is the generating function<br />

for the sequence a 0 , a 1 , . . ., then x d g(x) is the generating function for the sequence<br />

dx<br />

0, a 1 , 2a 2, 3a 3 , . . . and x 2 g ′′ (x) + xg ′ (x) is the generating function for the sequence for<br />

0, a 1 , 4a 2 , 9a 3 , . . .<br />

Example: The generating function for the sequence 1, 1, . . . is ∞ ∑<br />

x i = 1 . The gener-<br />

1−x<br />

ating function for the sequence 0, 1, 2, 3, . . . is<br />

418<br />

i=0<br />

⎞<br />

⎟<br />

⎠<br />

∥<br />

i=0<br />

2<br />

F

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

Saved successfully!

Ooh no, something went wrong!