Docsity

Formidable Tool - Discrete Math - Lecture Slides, Slides of Discrete Mathematics

Partial preview of the text

Download Formidable Tool - Discrete Math - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

Introduction to Discrete

Mathematics

CPS 102 Classics

If I randomly put 100 letters into 100 addressed envelopes, on average how many letters will end up in their correct envelopes?

= ∑k k (…aargh!!…)

Hmm…

∑k k Pr(k letters end up in correct envelopes)

On average, in class of size m, how many pairs of people will have the same birthday?

∑k k Pr(exactly k collisions)

= ∑k k (…aargh!!!!…)

Random Variable

To use this new tool, we will also need to understand the concept of a Random Variable

Today’s lecture: not too much material, but need to understand it well

Random Variable

A Random Variable is a real-valued function on S

Examples:

X = value of white die in a two-dice roll X(3,4) = 3, X(1,6) = 1 Y = sum of values of the two dice Y(3,4) = 7, Y(1,6) = 7 W = (value of white die) value of black die W(3,4) = 3 4 , Y(1,6) = 1 6

Let S be sample space in a probability distribution

Notational Conventions

Use letters like A, B, E for events

Use letters like X, Y, f, g for R.V.’s

R.V. = random variable

Two Views of Random Variables

Input to the function is random

Randomness is “pushed” to the values of the function

Think of a R.V. as

A function from S to the reals ℜ

Or think of the induced distribution on ℜ

It’s a Floor Wax And a Dessert Topping

It’s a function on the sample space S

It’s a variable with a probability distribution on its values

You should be comfortable with both views

From Random Variables to Events

For any random variable X and value a, we can define the event A that X = a

Pr(A) = Pr(X=a) = Pr({x ∈ S| X(x)=a})

0.3 (^) 0.2 0.

0.05^ 0. 0

1

0

From Events to Random Variables

For any event A, can define the indicator random variable for A:

XA(x) =

1 if x ∈ A 0 if x ∉ A

X has a distribution on its values

X is a function on the sample space S

Definition: Expectation

The expectation, or expected value of a random variable X is written as E[X], and is

Σ Pr(x) X(x) = Σ k Pr[X = k]

x ∈ S k

E[X] =

Type Checking

A Random Variable is the type of thing you might want to know an expected value of

If you are computing an expectation, the thing whose expectation you are computing is a random variable

E[X (^) A] = 1 × Pr(X (^) A = 1) = Pr(A)

Indicator R.V.s: E[XA ] = Pr(A)

For any event A, can define the indicator random variable for A:

XA(x) =

1 if x ∈ A 0 if x ∉ A