EECS 501__________________________PROBLEM SET #3__________________________Fall 2001

**ASSIGNED:** Sept. 21, 2001. Read Stark and Woods pp. 60-119 on various pdfs.

**DUE DATE:** Sept. 28, 2001. THIS WEEK: pdfs and PDFs and sample spaces.

- Stark and Woods #2.2. A simple PDF and pdf problem. Your sketches should be neat.

- Prove
**for n=3 only (not for general n)** the *principle of inclusion and exclusion*:

Use this result and some permutations/combinations to solve the following problem:
- An absent-minded professor (no one you know) wrote n letters and sealed them in

envelopes without writing the addresses on the envelopes. Having forgotten which letter he

had put into each envelope, he wrote the n addresses on the n envelopes entirely at random.

**Compute** Pr[at least one envelope was addressed correctly].

HINT: Let A_{i}=Pr[i^{th} envelope addressed correctly]. What happens as n goes to infinity?

- Random variables x,y,z,w have the joint pdf below. Compute the pdf f
_{x|w,y,z}(X|W,Y,Z).

- Let a,b,c > 0 be independent random variables, each with pdf f
_{x}(X) and PDF F_{x}(X).
Show:

- Two real numbers b and c are chosen at random and independently of each other.

Compute Pr[the quadratic equation t^{2}+bt+c=0 has two real roots] as follows:

Let b and c each be chosen from the interval [-n,n] and solve the problem for some finite n

(draw your picture carefully--it's tricky!). What happens as n goes to infinity?

- The
*rejection technique* is a procedure for generating random numbers with a desired
pdf f_{x}(X):

Let f_{x}(X) be nonzero only for 0 < X < 1, and have maximum value f_{m}. Do the following:
- Spin a wheel of fortune repeatedly; group the resulting numbers into pairs (X
_{i},Y_{i})
- Keep X
_{i} only if f_{x}(X_{i}) > f_{m}Y_{i}; otherwise discard it.

**The problem for you is to do the following:**
- Show that the accepted X
_{i} have pdf f_{x}(X). (This is a conditional marginal pdf problem.)
- Write a simple Matlab program that uses the rejection technique to generate

random numbers distributed with the parabolic pdf f_{x}(X)=3X², 0 < X < 1.

Use Matlab's **hist** to create a *histogram* (bar graph) of the number of accepted X_{i}.

**Turn in:** Matlab code and histogram. Use 20 bins and 4000 random number pairs.

"A chicken is an egg's way of making another egg"--anonymous.