CS174 Spring 99 Lecture 1 Summary

Handouts:

Course description

Description of the course, grading, policy on late HWs.

The web page is www-inst.eecs.berkeley.edu/~cs174 and contains lecture summaries and an active course syllabus.

Course Content, three parts:

Basic counting and probabilistic methods
Applications in string processing, distributed computing and paging
Applications in information management, cryptography, information sharing, secure transactions
 

An example problem. The birthday problem (with a twist for added privacy)

From the table below, copy the number under the month of your birthday onto a piece of paper.

Jan Feb Mar Apr May Jun July Aug Sept Oct Nov Dec
323 106 261 13 75 137 354 292 230 168 44 199

 

Now from one of the tables below, copy the number under your birth date onto the same piece of paper.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
104 137 168 200 232 264 296 328 112 144 176 208 240 272 304 336

 

17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
120 152 184 216 248 280 312 344 128 160 192 224 256 288 320

 

Now add the two numbers. If the answer is bigger than 372, subtract 372 from it. You should now have a number between 1 and 372.

The next step is a survey of how many people came up with numbers in the following ranges

1-31 32-62 63-93 94-124 125-155 156-186
187-217 218-248 249-279 280-310 311-341 342-372

 

The goal is to find a group with 8 or more people in it. Such a group will almost certainly have two people with the same number. Those people share a common birthday. People in this group will say their number, until we catch two with the same number. The rest of us will know that they share a birthday, but not what the birthday is.

We can even protect the identities of the individuals with the same birthday, even though they themselves can find out who the person with the same birthday is. How could we do that? Hint: everyone in class would have to read out their number.

This example illustrates several points:

Probability implies that its very likely certain things happen (two people in class have the same birthday).
We can use probability analysis to design a good algorithm for the problem (finding the people).
This algorithm is usually fast, even though a "worst case" algorithm would be slow.
We can use encryption to hide information from onlookers.
We can use randomization to selectively share information.

 

Random Variables

Normally, variables are symbols that hold values from some domain, like the integers. A random variable is a variable which has a probability distribution on its domain. e.g.

X Î {1,…,6} is a variable, and if we specify in addition

Pr[X=i] = 1/6 for i Î 1,…,6 then X is a random variable. The probability distribution in this case is the uniform distribution.

We can also have an exponential distribution on an infinite domain Pr[X=i] = 1/2i for i = 1, 2, 3,… but of course the sum

å Pr[X=i] = 1 always

Independence

A very important concept for this course is independence of RV's. X1 and X2 are independent random variables if Pr[X1=u, X2=v] = Pr[X1=u] Pr[X2=v] for all u and v in the domains.

Expected Values

Associated with a random variable is its expected value E[X], defined by

E[X] = å i Pr[X=i]

Linearity

Another important idea for this course: Expected value satisfies E[X1 + X2] = E[X1] + E[X2] (linearity). Note: Linearity of expectation doesnt require independence.

Proof:

E[X1 + X2] = åi   åj   (i + j) Pr[X1=i, X2=j]

= åi åj i Pr[X1=i, X2=j]  +  åi åj j Pr[X1=i, X2=j]

= åi i åj   Pr[X1=i, X2=j]  +  åj j åi  Pr[X1=i, X2=j]    move constants outside the sums.

= åi i  Pr[X1=i]  +  åj j Pr[X2=j] collapse sums over all possible values of the other random variable.

= E[X1] + E[X2]     QED and nowhere did we use the independence property

Products

The rule for products of RV's is what you might expect. However, it does require independence.

Theorem: If X1 and X2 are independent, then E[X1 X2] = E[X1] E[X2]

Proof:

E[X1 X2] = åi   åj  i  j Pr[X1=i, X2=j]

= åi i åj   j Pr[X1=i, X2=j]    we can move i, but we get stuck here unless we use independence.

= åi i åj   j Pr[X1=i] Pr[X2=j]  applying the independence rule gives us a constant (Pr[X1=i]) to move outside the sum.

= åi i Pr[X1=i]  åj  j Pr[X2=j]

= åi i Pr[X1=i]  E[X2]

= E[X1]  E[X2]    QED