返回题库

半个正面

Half Heads

专题
Probability / 概率
难度
L2

题目详情

设随机变量 XX 只取 0011,且各以 50%50\% 的概率发生(可理解为一次公平抛硬币:反面为 0,正面为 1)。

你需要用独立同分布的 XX(可多次调用)构造新随机变量 YY,使得 YY 只取 0012\frac{1}{2},且各以 50%50\% 的概率发生。

请给出 YY 关于 XX 的构造方式。

Let XX be a random variable that takes value 0 or 1 with 50% probability each. You need to define a new random variable YY as a function of XX, such that YY has the value 1 with 25% probability and 0 otherwise.

Hint

Use XX^\prime as an independent copy of XX.

解析

取两个独立样本 X1,X2X_1,X_2,令 + ++Y=121{X1X2}.++Y=\frac{1}{2}\cdot \mathbf{1}\{X_1\ne X_2\}. + + +因为 P(X1X2)=P(01)+P(10)=14+14=12P(X_1\ne X_2)=P(01)+P(10)=\frac{1}{4}+\frac{1}{4}=\frac{1}{2},所以 YY50%50\% 概率取 00,以 50%50\% 概率取 12\frac{1}{2}


Original Explanation

Y=XXY = X * X^\prime where XX^\prime is an independent copy of XX

Solution

Given XX is a random variable such that P(X=1)=P(X=0)=0.5P(X=1)=P(X=0)=0.5.

These mathematical entities typically represent a real world concept. For example, this XX can take value 0 or 1 based on the outcome of a coin toss, say Tails representing 0 and Heads represeting 1. But we can toss this coin again, and get another sample independent of the first outcome. Let XX^\prime take the value 0 or 1 based on this second toss, independent of the first toss. This is the concept of an independent copy.

Let XX^\prime be an independent copy of XX. It has the same probability distribution as XX but the value may or may not be the same.

Thus, P(X=1)=P(X=1)=0.5P(X=1) = P(X^\prime=1) = 0.5

Also, we can imagine if one coin-toss has probability of 1/2 for a heads, then the probability will be 1/4 for both coins to show up heads.

P(X=1,X=1)=P(X=1)P(X=1)=1/4P(X=1, X^\prime=1) = P(X=1) * P(X^\prime=1) = 1/4

Hence, we can define YY = 1 if both XX and XX^\prime are 1, and 0 otherwise.

We can also use product operator to simplify this relationship.

Y=XXY = X \cdot X ^\prime

This way, if both XX and XX^\prime are 1 then YY will be 1, otherwise zero.

This is not the same as Z=X2Z = X^2 because ZZ can take the value 0 or 1 with probability 50% each.


Programming Variant

Following is the programming version of this question:

Function f1() returns true or false with 50% probability each, define function f2() that can return true with 25% probability, and false otherwise. You may use the function f1.

This can be answered using the and gate.

def f2(): 
  return f1() and f1()