Question: Hello, can I have this question answered in a Python program? Problem 3. (Probability) The random variable X takes values in {1,2,,M} whereas the random

 Hello, can I have this question answered in a Python program?Problem 3. (Probability) The random variable X takes values in {1,2,,M} whereas

Hello, can I have this question answered in a Python program?

Problem 3. (Probability) The random variable X takes values in {1,2,,M} whereas the random variable Y takes values in {1,2,,N}. The joint distribution of these variables is given by the matrix P=p11p21pM1p12p22pM2p1Np2NpMN where pmn is the probability that X=m and Y=n. (a) Write the function marginal_x, which takes P as input and returns a vector pX=[p1,,pM] where pm is the probability that X=m. (b) Write the function expectation_y, which takes P as input and returns the expectation of Y. (c) Write the function conditional_X, which takes (P,n) as input and returns a vector pXY=n=[p~1,,p~M] where p~m is the probability that X=m given that Y=n. (d) Write the function conditional_expectation_x, which takes (P,n) as input and returns the expectation of X given that Y=n. - Throughout, measurement units are not specified when not necessary. The functions that you program may assume that the units of the input arguments are consistent with each other. - Due to limitations in finite-precision arithmetic, all equalities are checked up to a certain tolerance. Specifically, for a,bRN, the equality a=b is regarded as true if abN105. - The submission of this assignment implies that you abide by the honor code, which states that you do not receive help from anybody else. However, you can check as many books, papers, and websites as you wish. - Notation: R is the set of real numbers, RN is the set of column vectors with N real entries, and RMN is the set of MN matrices with real entries. Uppercase boldface letters (e.g. A ) denote matrices whereas lowercase boldface letters (e.g. a) denote column vectors. The (i,j)-th entry of a matrix A is denoted as (A)i,j, whereas the i-th entry of a vector v is (v)i. Transpose is indicated by v is the Euclidean norm of the vector v

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!