rec 0918

Upload: eugene-choi

Post on 03-Jun-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/12/2019 Rec 0918

    1/2

    RECITATION NOTES

    - hand back hwk- go over mini #2- go over practice quiz- other problems=======================================================================1. hand back hwk. If you want, you can go over questions people have.

    2. go over mini #2 (these were both old quiz questions)

    3. go over practice quiz if people want, except for Problem 3 which ison material we didn't do yet [if you want to make more hard copies, itis in the private directory. I prefer not to have electronic copiesfloating around though].

    4. Talk about universal and perfect hashing. Give the analysis ofperfect hashing using O(N) space from lecture notes 7.5.2. [Even if Ifinish it in lecture, it will probably be too fast, so students willappreciate seeing it again. Plus it's related to hwk 2]

    5. As an alternative to (4) if people need are rusty on probabilisticanalysis, you could do a basic intro to probability and discussion oflinearity of expectation, like this:

    A probabilistic setting is defined by a sample space (e.g., if wethrow two dice, then the sample space consists of all 36 outcomes thatthe pair of dice can have) and a probability distribution over thissample space (if these are fair dice, then each outcome hasprobability 1/36). Note: we are only talking discrete probabilitiesso no measure theory or integrals. An *event* is a subset of thesample space. E.g., "the event that the dice sum to 3". A *randomvariable* is a function over the elements in the sample space. E.g.,"the sum of the two dice". Events either happen or don't; randomvariables are *functions* over what happens. The points in the samplespace are often called "elementary events" (because they are elementsof the sample space and they are events).

    The expected value of a random variable X is just itsprobability-weighted average:E[X] = \sum_e Pr(e)*X(e)

    where the sum is over all elementary events e.You can also rearrange to write this as: E[X] = \sum_a Pr(X = a)*awhere we have grouped all elementary events e in which X(e)=a togetherinto a single event "X=a".

    Linearity of expectation says that for any two random variables X andY, E[X+Y] = E[X] + E[Y]. This is an extremely useful fact. It's alsoeasy to prove from our definitions, like this:

    Let Z = X+Y. Remember that Z is a *function* over elementary events,defined as Z(e) = X(e)+Y(e). So we have:E[Z] = \sum_e Pr(e)*Z(e) = \sum_e Pr(e)*(X(e) + Y(e)) = \sum_e Pr(e)*X(e) + \sum_e Pr(e)*Y(e) = E[X] + E[Y].

    Notice that all we really did here was apply the distributive law.But this simple-to-prove statement is surprisingly powerful.

  • 8/12/2019 Rec 0918

    2/2