precept3

# precept3 - heads the ﬁrst time 2 rubles if it shows the...

This preview shows pages 1–2. Sign up to view the full content.

Computer Science 340 Reasoning About Computation Precept 3 Problem 1 a) Prove that if X 1 and X 2 are independent random variables then E [ X 1 · X 2 ] = E [ X 1 ] E [ X 2 ]. b) Does E [ X 1 · X 2 ] = E [ X 1 ] E [ X 2 ] imply that X 1 and X 2 are independent random vari- ables? Problem 2 Suppose you write the following C code to compute the maximum number stored in an array of size n : max = a[0]; for (int i = 1; i < n; i++) { if (max < a[i]) { max = a[i]; } } Assume that the array a is a permutation of the integers { 1 , 2 , . . . , n } and each per- mutation is equally likely. What is the expected number of times the line max = a[i]; is executed? Problem 3 We define conditional expectation E [ X | A ], of a random variable X , given A , to be: E [ X | A ] = k k · Pr( X = k | A ) If the sample space is a disjoint union of events A 1 , ..., A n prove that: E [ X ] = i E [ X | A i ] · Pr( A i ) Problem 4 The St. Petersburg Casino offers the following game: the gambler bets a fixed wager, and then the dealer flips a fair coin (dealers do not flip coins in US casinos, but they do

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: heads the ﬁrst time, 2 rubles if it shows the ﬁrst head at second toss, and in general 2 k-1 if the dealer tosses the coin k times to get the ﬁrst head. 1. Suppose the ﬁxed wager is 10 rubles. What is the expected amount of money that the gambler will win in this game? Suppose the ﬁxed wager is 10,000 rubles? 2. What is the probability that the gambler does not lose money in a game when the ﬁxed wager is 10 , 000 rubles ? 3. In reality, it would not be reasonable for the gambler to play the game with the ﬁxed wager at 10 , 000 rubles. Why? (Hint: Suppose the casino has a limit of a billion rubles.) Problem 5 If the random variable X takes values in non-negative integers, prove that: E [ X ] = ∞ X t =0 Pr( X > t )...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern