A random variable X is generated as follows. We flip a coin. With probability p , the result is Heads, and then X is generated according to a PDF fX|H which is uniform on [0,1] . With probability 1−p the result is Tails, and then X is generated according to a PDF fX|T of the form

fX|T(x)=2x,if x∈[0,1].

(The PDF is zero everywhere else.)

What is the (unconditional) PDF fX(x) of X ?

For 0≤x≤1 :

fX(x)=

Calculate E[X] =

Find P(Tails∣X=1/4) .

The MAP rule decides in favor of Heads if X<a and in favor of Tails if X>a. What is a?

a=

fX(x) = pfX|H(x) + (1-p)fX|T(x) = p + (1-p)2x

E[X] = p + (1-p)2/2 = p + (1-p)/2

P(Tails∣X=1/4) = (1-p)

a = p/(p+(1-p)2)

To find the unconditional PDF fX(x) of X, we need to use the law of total probability. The unconditional PDF is given by:

fX(x) = p * fX|H(x) + (1 - p) * fX|T(x)

Since the PDF fX|H(x) is uniform on [0,1], we have:

fX|H(x) = 1, if x ∈ [0,1]

For fX|T(x), we have:

fX|T(x) = 2x, if x ∈ [0,1]

Therefore, the unconditional PDF fX(x) is:

fX(x) = p * 1 + (1 - p) * 2x, if x ∈ [0,1]

For 0 ≤ x ≤ 1:

fX(x) = p + (1 - p) * 2x

To calculate E[X], we need to find the expected value of X. The formula for E[X] is:

E[X] = ∫[0,1] x * fX(x) dx

Evaluating the integral, we get:

E[X] = ∫[0,1] x * (p + (1 - p) * 2x) dx
= p * ∫[0,1] x dx + (1 - p) * 2 * ∫[0,1] x^2 dx
= p * [x^2/2] from 0 to 1 + (1 - p) * 2 * [x^3/3] from 0 to 1
= p * (1/2) + (1 - p) * (2/3)
= p/2 + 2/3 - (2/3) * p
= (2 - p)/3

So, E[X] = (2 - p)/3.

To find P(Tails|X=1/4), we need to use Bayes' theorem. The formula for conditional probability is:

P(Tails|X=1/4) = P(Tails and X=1/4) / P(X=1/4)

P(X=1/4) = p * fX|H(1/4) + (1 - p) * fX|T(1/4)
= p * 1 + (1 - p) * 2 * (1/4)
= p + (1 - p)/2
= (2p + 1 - p)/2
= (p + 1)/2

P(Tails and X=1/4) = (1 - p) * fX|T(1/4)
= (1 - p) * 2 * (1/4)
= (1 - p)/2

Therefore,

P(Tails|X=1/4) = (1 - p)/2 / (p + 1)/2
= 1 - p

Finally, to determine the value of a in the MAP rule, we need to find the threshold value such that it decides in favor of Heads if X < a and in favor of Tails if X > a. Since Heads is favored when X < a, this means that the probability of Tails given X < a should be less than the probability of Heads given X < a.

Therefore,

P(Tails|X < a) < P(Heads|X < a)

Using the conditional probability formula and substituting in the PDFs, we get:

(1 - p) * ∫[0,a] 2x dx < p * ∫[0,a] 1 dx

Simplifying the integrals and solving for a, we get:

(1 - p) * x^2|0 to a < p * x|0 to a

(1 - p) * a^2 < p * a

a^2 - p * a^2 < p * a

a^2 * (1 - p) < p * a

a * (1 - p) < p

a < p / (1 - p)

Therefore, a = p / (1 - p).

To find the unconditional PDF fX(x) of X, we need to consider the probabilities of obtaining Heads or Tails and the corresponding PDFs.

Since the coin is flipped with probability p and Tails is obtained with probability 1-p, we can write the unconditional PDF as a combination of the PDFs for Heads and Tails:

fX(x) = p * fX|H(x) + (1-p) * fX|T(x)

For 0 ≤ x ≤ 1, the PDF fX|H(x) is uniform on [0,1], so fX|H(x) = 1. Therefore, we can simplify the expression for fX(x) as:

fX(x) = p * 1 + (1-p) * fX|T(x)

Now, let's evaluate fX(x) for 0 ≤ x ≤ 1:

For 0 ≤ x ≤ 1, we know that fX|T(x) = 2x. Substituting this value in the equation above, we get:

fX(x) = p + (1-p) * 2x

So, for 0 ≤ x ≤ 1, fX(x) = p + (1-p) * 2x.

To calculate E[X] (the expected value of X), we integrate x * fX(x) over the range [0,1]:

E[X] = ∫(0 to 1) x * [ p + (1-p) * 2x ] dx

Solving this integral will give us the expected value E[X].

To find P(Tails|X=1/4) (the probability of Tails given X=1/4), we can use Bayes' theorem:

P(Tails|X=1/4) = P(X=1/4|Tails) * P(Tails) / P(X=1/4)

Using the PDF fX|T(x) = 2x for 0 ≤ x ≤ 1, we can find P(X=1/4|Tails). Since the PDF fX(x) is a combination of fX|H(x) and fX|T(x), we can calculate P(X=1/4) by evaluating fX(x) at x=1/4 and normalizing it:

P(X=1/4) = fX(1/4) / ( ∫(0 to 1) fX(x) dx )

Calculating these probabilities will give us P(Tails|X=1/4).

Finally, to determine the value of a for the MAP rule, we need to find the threshold that separates the decision in favor of Heads or Tails. The MAP rule decides in favor of Heads if X < a and in favor of Tails if X > a. We need to find the value of a that satisfies this condition.