Midterm Exam 1 Solution

Similar documents
EECS 126 Probability and Random Processes University of California, Berkeley: Fall 2014 Kannan Ramchandran September 23, 2014.

Midterm Exam 1 (Solutions)

(Practice Version) Midterm Exam 2

EECS 126 Probability and Random Processes University of California, Berkeley: Fall 2014 Kannan Ramchandran November 13, 2014.

EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2017 Kannan Ramchandran March 21, 2017.

Midterm Exam 2 (Solutions)

EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2018 Kannan Ramchandran February 14, 2018.

EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2015 Abhay Parekh February 17, 2015.

2. Suppose (X, Y ) is a pair of random variables uniformly distributed over the triangle with vertices (0, 0), (2, 0), (2, 1).

1 Basic continuous random variable problems

1 Basic continuous random variable problems

EECS 126 Probability and Random Processes University of California, Berkeley: Spring 2018 Kannan Ramchandran February 14, 2018.

Raquel Prado. Name: Department of Applied Mathematics and Statistics AMS-131. Spring 2010

FINAL EXAM: Monday 8-10am

MAT 271E Probability and Statistics

Class 26: review for final exam 18.05, Spring 2014

MAT 271E Probability and Statistics

18.05 Exam 1. Table of normal probabilities: The last page of the exam contains a table of standard normal cdf values.

Math 151. Rumbos Fall Solutions to Review Problems for Exam 2. Pr(X = 1) = ) = Pr(X = 2) = Pr(X = 3) = p X. (k) =

Class 8 Review Problems 18.05, Spring 2014

STAT 414: Introduction to Probability Theory

CME 106: Review Probability theory

PRACTICE PROBLEMS FOR EXAM 2

ECE 302 Division 2 Exam 2 Solutions, 11/4/2009.

ECE 302, Final 3:20-5:20pm Mon. May 1, WTHR 160 or WTHR 172.

MATH 151, FINAL EXAM Winter Quarter, 21 March, 2014

Precept 4: Hypothesis Testing

MAT 271E Probability and Statistics

2. Variance and Covariance: We will now derive some classic properties of variance and covariance. Assume real-valued random variables X and Y.

STAT Chapter 5 Continuous Distributions

FINAL EXAM: 3:30-5:30pm

ECE302 Exam 2 Version A April 21, You must show ALL of your work for full credit. Please leave fractions as fractions, but simplify them, etc.

University of Illinois ECE 313: Final Exam Fall 2014

Closed book and notes. 60 minutes. Cover page and four pages of exam. No calculators.

MATH 3510: PROBABILITY AND STATS July 1, 2011 FINAL EXAM

STAT2201. Analysis of Engineering & Scientific Data. Unit 3

STAT 418: Probability and Stochastic Processes

1 Random Variable: Topics

EECS 70 Discrete Mathematics and Probability Theory Fall 2015 Walrand/Rao Final

STT 441 Final Exam Fall 2013

Course: ESO-209 Home Work: 1 Instructor: Debasis Kundu

Class 8 Review Problems solutions, 18.05, Spring 2014

18.440: Lecture 28 Lectures Review

ECE 302 Division 1 MWF 10:30-11:20 (Prof. Pollak) Final Exam Solutions, 5/3/2004. Please read the instructions carefully before proceeding.

Notes on Continuous Random Variables

Lecture 2: Repetition of probability theory and statistics

Lecture Notes 2 Random Variables. Discrete Random Variables: Probability mass function (pmf)

UC Berkeley Department of Electrical Engineering and Computer Science. EE 126: Probablity and Random Processes. Solutions 9 Spring 2006

MATH 407 FINAL EXAM May 6, 2011 Prof. Alexander

Midterm 2. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:

Data Analysis and Monte Carlo Methods

Basics on Probability. Jingrui He 09/11/2007

ECE 313: Conflict Final Exam Tuesday, May 13, 2014, 7:00 p.m. 10:00 p.m. Room 241 Everitt Lab

18.05 Final Exam. Good luck! Name. No calculators. Number of problems 16 concept questions, 16 problems, 21 pages

This does not cover everything on the final. Look at the posted practice problems for other topics.

3 Multiple Discrete Random Variables

Machine Learning: Homework Assignment 2 Solutions

Review of Probability. CS1538: Introduction to Simulations

18.440: Lecture 28 Lectures Review

Math 426: Probability MWF 1pm, Gasson 310 Exam 3 SOLUTIONS

Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Note 15. Random Variables: Distributions, Independence, and Expectations

Math Spring Practice for the final Exam.

Chapter 2: Random Variables

Massachusetts Institute of Technology Department of Electrical Engineering & Computer Science 6.041/6.431: Probabilistic Systems Analysis

MATH 180A - INTRODUCTION TO PROBABILITY PRACTICE MIDTERM #2 FALL 2018

Final Exam. Math Su10. by Prof. Michael Cap Khoury

Part IA Probability. Definitions. Based on lectures by R. Weber Notes taken by Dexter Chua. Lent 2015

1. Let X be a random variable with probability density function. 1 x < f(x) = 0 otherwise

Things to remember when learning probability distributions:

SDS 321: Introduction to Probability and Statistics

Random Variables and Their Distributions

Final Exam # 3. Sta 230: Probability. December 16, 2012

CDA6530: Performance Models of Computers and Networks. Chapter 2: Review of Practical Random

STAT/MA 416 Midterm Exam 3 Monday, November 19, Circle the section you are enrolled in:

ENGG2430A-Homework 2

X = X X n, + X 2

Exercises in Probability Theory Paul Jung MA 485/585-1C Fall 2015 based on material of Nikolai Chernov

EE376A - Information Theory Final, Monday March 14th 2016 Solutions. Please start answering each question on a new page of the answer booklet.

Twelfth Problem Assignment

ECEn 370 Introduction to Probability

MAS108 Probability I

CDA6530: Performance Models of Computers and Networks. Chapter 2: Review of Practical Random Variables

4. Suppose that we roll two die and let X be equal to the maximum of the two rolls. Find P (X {1, 3, 5}) and draw the PMF for X.

Math Review Sheet, Fall 2008

HW5 Solutions. (a) (8 pts.) Show that if two random variables X and Y are independent, then E[XY ] = E[X]E[Y ] xy p X,Y (x, y)

Lecture Notes 2 Random Variables. Random Variable

Random Variables Example:

Practice Exam 1: Long List 18.05, Spring 2014

STAT/MA 416 Answers Homework 6 November 15, 2007 Solutions by Mark Daniel Ward PROBLEMS

ECE 302: Probabilistic Methods in Engineering

Practice Examination # 3

Tutorial 1 : Probabilities

Introduction to discrete probability. The rules Sample space (finite except for one example)

18.05 Practice Final Exam

CMPSCI 240: Reasoning Under Uncertainty

Discrete Mathematics and Probability Theory Fall 2017 Ramchandran and Rao Final Solutions

HW7 Solutions. f(x) = 0 otherwise. 0 otherwise. The density function looks like this: = 20 if x [10, 90) if x [90, 100]

M378K In-Class Assignment #1

Algorithms for Uncertainty Quantification

E X A M. Probability Theory and Stochastic Processes Date: December 13, 2016 Duration: 4 hours. Number of pages incl.

Transcription:

EECS 126 Probability and Random Processes University of California, Berkeley: Fall 2015 Kannan Ramchandran September 22, 2015 Midterm Exam 1 Solution Last name First name SID Name of student on your left: Name of student on your right: DO NOT open the exam until instructed to do so. The total number of points is 110, but a score of 100 is considered perfect. You have 10 minutes to read this exam without writing anything and 90 minutes to work on the problems. Box your final answers. Partial credit will not be given to answers that have no proper reasoning. Remember to write your name and SID on the top left corner of every sheet of paper. Do not write on the reverse sides of the pages. All eletronic devices must be turned off. Textbooks, computers, calculators, etc. are prohibited. No form of collaboration between students is allowed. If you are caught cheating, you may fail the course and face disciplinary consequences. You must include explanations to receive credit. Problem Part Max Points Problem Part Max Points 1 (a) 8 2 20 (b) 8 3 25 (c) 8 4 25 (d) 8 (e) 8 40 Total 110 1

Cheat sheet 1. Discrete Random Variables 1) Geometric with parameter p [0, 1]: P (X = n) = (1 p) n 1 p, n 1 E[X] = p 1 1 p, var(x) = p 2 2) Binomial with parameters N and p: P (X = n) = ( N n E[X] = Np, var(x) = Np(1 p) 3) Poission with parameter λ: P (X = n) = λn n! e λ, n 0 E[X] = λ, var(x) = λ ) p n (1 p) N n, n = 0,..., N, where ( N n 2. Continuous Random Variables 1) Uniformly distributed in [a, b], for some a < b: f X (x) = b a 1 1{a x b} E[X] = a+b (b a)2 2, var(x) = 12 2) Exponentially distributed with rate λ > 0: f X (x) = λe λx 1{x 0} E[X] = 1 λ, var(x) = 1 λ 2 3) Gaussian, or normal, with mean µ and variance σ 2 : f X (x) = 1 exp { (x µ)2 2πσ 2 2σ } 2 E[X] = µ, var(x) = σ 2 ) = N! (N n)!n! 2

Problem 1. Short questions: 8 points each. (a) Evaluate the following statements with True or False. Give one-line explanations to get credit. (i) If two random variables are independent, they are uncorrelated. Solution: True. If X and Y are independent, E[XY ] = E[X]E[Y ]. Then they are uncorrelated. (ii) Disjoint events are independent. Solution: False. If A and B are disjoint, P (A B) = 0 P (A)P (B). (iii) If events A and B are independent, then conditioned on any other event C, A and B are still independent. Solution: False. A, B : outcomes of two independent coin flips; C : there is only one Head in {A, B}. (iv) The variance of a sum of uncorrelated random variables is the sum of their variances. Solution: True. When finding the variance of the sum, cross terms are 0 for uncorrelated random variables. 3

(b) You and your friend have created a new language in order to text message with each other. The language consists of an alphabet of 7 letters: {A, B, C, D, E, F, G}. Unfortunately, your friend has very strict parents who cap the amount of data she receives over text messaging. You decide to use Huffman coding to compress your messages as much as possible. Assume that the frequency of letters in your language is according to the following table: P (X) X 0.15 A 0.05 B 0.2 C 0.05 D 0.05 E 0.15 F 0.35 G Now, instead of using binary codewords, we will use ternary codewords (e.g. {0, 1, 2} ). Construct a ternary Huffman code for this alphabet and find the expected length of a codeword. Solution: The Huffman tree is shown in Figure 1. The codewords are shown below: The expected length of a codeword is Figure 1: Huffman tree X codeword A 10 B 110 C 0 D 111 E 112 F 12 G 2 2 0.15 + 3 0.05 + 1 0.2 + 3 0.05 + 3 0.05 + 2 0.15 + 1 0.35 = 1.6 4

(c) Consider a regular hexagon whose side length is 1. Five points A, B, C, D and E are chosen on the perimeter of the hexagon randomly as follows. First, we pick one of the 6 sides of the hexagon uniformly at random. Then, the position of point A is chosen uniformly at random on the picked side. We then pick one of the remaining 5 sides of the hexagon and decide the position of point B uniformly at random on the chosen side. We repeat this procedure until we locate all five points. Then, we draw edges between (A, B), (B, C), (C, D), (D, E) and (E, A). The figure formed by the 5 edges can be a star as in Figure 2(a), or not a star as in Figure 2(b). What is the probability that the formed figure is a star? Figure 2: Examples. Solution: Fix the position of A, there are 4! possible permutations of the other points. Among these permutations, only 2 of them are stars, as shown in Figure 3. Therefore, the probability is 2 4! = 1 12. Figure 3: Stars. 5

(d) 8 couples enter a casino. After two hours, 8 of the original 16 people remain (the rest have left). Each person decides whether or not to leave independently of others decisions. Find the expected number of couples still in the casino at the end of two hours. Solution: Conditioned on the number of people remaining, all possible outcomes (of 1 which 8 people remain) have the same probability, i.e.,. Using this, the probability ( 16 8 ) of any particular couple remaining is obtained by counting the number of ways to choose 8 people from 16 people such that the particular couple is chosen: ( 14 ) 6 p c = ) = 8 7 16 15 = 7 30. ( 16 8 Now, consider a new random variable X i that takes value of 1 if the i th couple remains, and takes 0 otherwise. The expected value of this random variable E[X i ] = p c. Let X be the total number of couples remaining, then Using linearity of expectation, we conclude X = X 1 + X 2 + + X 8. E[X] = 8 7 30 = 28 15 1.87 6

(e) A fair hundred-sided die (with values 0, 1, 2,..., 99 ) is rolled independently 50 times, with outcomes X 1,..., X 50. Let Z be the empirical mean of the 50 rolls, i.e., Z = 1 50 50 i=1 X i, and Y be the maximum value attained over the 50 rolls, i.e. Y = max{x 1, X 2,..., X 50 }. Find E[Z Y ] as a function of Y. Solution: We know that there must exist j (1 j 50) such that X j = Y. For i j, conditioned on Y, X i s are i.i.d. uniformly distributed in the set {0,..., Y }, and E[X i Y ] = Y 2. Then we know E[Z Y ] = 1 50 [E[X j Y ] + i j E[X i Y ]] = 1 50 [Y + 49 2 Y ] = 51 100 Y. 7

Problem 2. (20 points) Consider two continuous random variables X and Y that are uniformly distributed with their joint probability density function (PDF) equal to A over the shaded region as shown below. Figure 4: Joint PDF of X and Y (a) What is A? Solution: The area of the shaded square is 2. In order that the PDF is valid, the integration of the PDF over the shaded square should be one. Therefore, A = 1/2. (b) Are X and Y independent? Are X and Y uncorrelated? Explain. Solution: X and Y are not independent. To see this, think about f X,Y (0.75, 0.75), f X (0.75), and f Y (0.75). According to the joint PDF, f X,Y (0.75, 0.75) = 0. However, as for the marginal distribution, we can see that f X (0.75) > 0 and f Y (0.75) > 0. Then we have f X,Y (0.75, 0.75) f X (0.75)f Y (0.75). Therefore, X and Y are not independent. Since the joint PDF is symmetrical with respect to the x -axis and y -axis, we know that E[XY ] = 0, E[X] = 0, and E[Y ] = 0. Then cov(x, Y ) = E[XY ] E[X]E[Y ] = 0. Therefore, X and Y are uncorrelated. 8

(c) Let Z = X + Y. Find the cumulative distribution function (CDF) of Z. Solution: We want to find F Z (z) = P (Z z). For z < 0, we have P (Z z) = 0 and for z > 1, we have P (Z z) = 1. Now consider 0 z 1. We have 1 P (Z z) = f X,Y (x, y)dxdy = 2 dxdy = z2. Z z X + Y z Therefore, the CDF of Z is 0, if z < 0 F Z (z) = P (Z z) = z 2, if 0 z 1 1, otherwise. 9

Problem 3. (25 points) In an EE126 office hour, students bring either a difficult-to-answer question with probability p = 0.2 or an easy-to-answer question with probability 1 p = 0.8. A GSI takes a random amount of time to answer a question, with this time duration being exponentially distributed with rate µ D = 1 (question per minute)-where D denotes difficult - if the problem is difficult, and µ E = 2 (questions per minute)-where E denotes easy -if the problem is easy. (a) Is the amount of time taken by the GSI to answer a random question exponentially distributed? Justify your answer. Solution: The amount of time taken by the GSI to answer a random question is a mixture of two exponential distributions. Therefore, the time is not exponentially distributed. One day, you visit an office hour and find the GSI answering the question of another student who came before you. You find out that the GSI has been busy with the other student s question for T = ln 4 1.3863 (minutes) before you come. Assume that you are the only student waiting in the room. (b) Conditioned on the fact that the GSI has been busy with the other student s question for T minutes, let q be the conditional probability that the problem is difficult. Find the value of q. Solution: Denote by X the random amount of time to answer a question and by Z the indicator of the event that the problem being answered is difficult. Then, for t 0. Thus, P (X > t Z = 0) = e µ Et P (X > t Z = 1) = e µ Dt P (X > t) = pe µ Dt + (1 p)e µ Et = 0.2e t + 0.8e 2t. As the GSI has been helping the other student for T time units, we know X > T. Thus, q = P (Z = 1 X > T ) = = P (Z = 1, X > T ) P (X > T ) 0.2e T 0.2e T + 0.8e 2T = 1 1 + 4e T = 1 1 + 1 = 1 2. = pe µ DT pe µ DT + (1 p)e µ ET 10

(c) Conditioned on the information above, you want to find the expected amount of time you have to wait from the time you arrive until the other student s question is answered. Express your answer in terms of q of part (b). Solution: Using the memoryless property of exponential random variables, E[X T X > T ] =P (Z = 0 X > T )E[X T X > T, Z = 0] + P (Z = 1 X > T )E[X T X > T, Z = 1] =(1 q) 1 + q 1 = 1 + q µ E µ D 2 (= 3 4 ). 11

The day before the final exam, two GSIs and the lecturer hold their office hours at the same time. The two GSIs share a room and the lecturer uses a different room. Both GSIs in the common room are busy helping one student each: both GSIs have been answering questions for T minutes, independently. There is no other student waiting in this room. The lecturer (in the other room) takes a random amount of time to answer a question, with this time duration being exponentially distributed with rate µ = 6 (questions per minute) regardless of the problem s difficulty. In the lecturer s room, there are two students including the one who is being helped. (d) You want to minimize the expected waiting time by choosing the right room between the two. Which room should you join? (Hint: your answer should depend on the value of T.) Solution: Let X 1 and X 2 be the amount of time that the two GSIs still need to take to answer their questions. The amount time to wait for the GSIs is min{x 1, X 2 }. Let X 3 be the amount of time that the lecturer need to take to finish the two students questions. Let a be the probability that a particular GSI is answering a difficult question, i.e., where Y = e T. Thus, a = 0.2e T 0.2e T + 0.8e 2T = 1 1 + 4Y, E[min{X 1, X 2 }] = a2 2a(1 a) (1 a)2 + + = 6a2 + 8a(1 a) + 3(1 a) 2, 2µ D µ D + µ E 2µ E 12 E[X 3 ] = 2 µ = 1 3. By equating two equations, 6a 2 + 8a(1 a) + 3(1 a) 2 = 4 a = 2 1 Y = 2 4. Thus, if T > ln (2 2), you have to choose the GSI s room, and choose the lecturer s room if T ln (2 2). 12

Problem 4. (25 points) There are N (N 2) bins and two colors of balls, black and white. In each experiment, d (1 d < N) bins are chosen uniformly at random from the N bins. In each chosen bin, we place either a black ball or a white ball in that bin. The probability that we place a black ball is p, and the probability that we place a white ball is 1 p. All placements are independent. This experiment is conducted K times independently. Let B i and W i be the number of black balls and white balls in the i th bin after the K experiments, respectively. An example of one experiment is shown in Figure 5. To clarify, N and d are constants. In part (a), (b), and (c), K is a constant. In part (d), K is a random variable. Figure 5: An example of one experiment with N = 7 bins and d = 3 balls. (a) For the i th bin, what is the probability mass function (PMF) of B i? Solution: Since there are K independent experiments and in each experiment, the probability that a black ball is placed in the i th bin is dp N. Then we know that B i Binomial(K, dp N ), and ( ) K P (B i = x) = ( dp x N )x (1 dp N )K x. (b) For the i th bin, what is the joint PMF of B i and W i, i.e., P (B i = x, W i = y)? Are B i and W i independent? Solution: We have P (B i = x, W i = y) = P (B i = x, B i + W i = x + y) = P (B i + W i = x + y)p (B i = x B i + W i = x + y). Since B i + W i is the total number of balls in a bin, we have B i + W i Binomial(K, d N ). Conditioned on B i + W i = x + y, the distribution of B i is also binomial, with parameters x + y and p. Therefore we have ( ) K P (B i = x, W i = y) = ( d x + y N )x+y (1 d ( ) x + y N )K (x+y) p x (1 p) y x K! = (K x y)!x!y! (dp d(1 p) N )x ( N )y (1 d N )K (x+y). B i and W i are not independent. According to part (a), B i Binomial(K, dp N ), and similarly, W i Binomial(K, d(1 p) N ). Then we can see that P (B i = x, W i = y) P (B i = x)p (W i = y). 13

(c) We call a bin a mixed bin if the bin contains both black and white balls. Suppose after K experiments, we find that the first bin is empty. Conditioned on this, what is the probability that the second bin is a mixed bin? Solution: Let E 1 be the event that the first bin is empty, and M 2 be the event that the second bin is a mixed bin. We want to find P (M 2 E 1 ). We have P (M 2 E 1 ) = P (B 2 1, W 2 1 E 1 ) = 1 P (B 2 = 0 or W 2 = 0 E 1 ) = 1 [P (B 2 = 0 E 1 ) + P (W 2 = 0 E 1 ) P (B 2 = 0, W 2 = 0 E 1 )]. Conditioned on the event that the first bin is empty, we know that in each experiment, the d balls are chosen uniformly at random from all the bins except the first bin. Therefore, we have Therefore, we know that P (M 2 E 1 ) = 1 (1 P (B 2 = 0 E 1 ) = (1 dp N 1 )K d(1 p) P (W 2 = 0 E 1 ) = (1 N 1 )K P (B 2 = 0, W 2 = 0 E 1 ) = (1 d N 1 )K dp d(1 p) N 1 )K (1 N 1 )K + (1 d N 1 )K. 14

(d) Now we consider a special case of our experiments where d = 1. This means that in each experiment we choose a single bin uniformly at random and put either a black ball in that bin with probability p, or a white ball with probability 1 p. We keep repeating the experiments until all the bins are mixed bins. We want to find the expected number of experiments that we need to do, i.e., E[K]. But here, we ask for something simpler. In order to find E[K], we define T n,m as the expected number of remaining experiments that we still need to do when the number of bins without black balls is n and the number of bins without white balls is m. Consequently, E[K] = T N,N. Find a recursive equation that describe the relationship between T n,m, T n 1,m, and T n,m 1 (n 2, m 2). Solution: When the number of bins without black balls is n and the number of bins without white balls is m, we do one experiment, and then, three events can happen: A : one bin among the n bins which do not contain black balls gets a black ball; B : one bin among the m bins which do not contain white balls gets a white ball; C : other cases. We can see that the three events happen with probabilities np respectively. Therefore, we know that T n,m = 1 + np N T n 1,m + m(1 p) T n,m 1 + (1 np N N N, m(1 p) N, and 1 np N m(1 p) N, m(1 p) )T n,m. N 15

END OF THE EXAM. Please check whether you have written your name and SID on every page. 16