# GATE2015-3-37

4.1k views
Suppose $X_i$ for $i=1, 2, 3$ are independent and identically distributed random variables whose probability mass functions are $Pr[X_i = 0] = Pr[X_i = 1] = \frac{1} {2} \text{ for } i = 1, 2, 3$. Define another random variable $Y = X_1X_2 \oplus X_3$, where $\oplus$ denotes XOR. Then $Pr[Y=0 \mid X_3 = 0] =$______.
0
pls explain bayes method.
1
Notice -> $X_i$'s are independent But X and Y are not independent.

Answer is $0.75$

As $X_3 = 0$ is given, to have Y = 0, $X_1X_2$ should be $0$, meaning $\left(X_1, X_2 \right)$ should be one of $\left\{(0,0) (0,1) (1,0)\right\}$

So, required probability $= 3 \times \dfrac{1}{2} \times \dfrac{1}{2} = 0.75 \because$ we can choose any of the $3$ possibilities in $3$ ways and then probability of each set of two combination is $\dfrac{1}{2} \times \dfrac{1}{2}$.

We can also do like follows:

There are totally $4$ possibilities -  $\left\{(0,0) (0,1) (1,0), (1,1)\right\}$, out of which $3$ are favourable cases.

So, required probability $= \dfrac{3}{4} = 0.75$.

edited
0
@gate-2016 Is it fine now?
1
yes . tnk u sir
0
I understood this approach, but is it possible to get this ans using bayes theorem. I could not calculate it.
3
@Shashank - Obviously it should work. You should get $\frac{.75 \times 0.5}{0.5} = 0.75$
3
sir, the formula for bayes theorm says,

P(Y=0|X3=0) = P(Y=0) * P(X3 = 0) / P(X3 = 0).

0.75 in your above explanation is not P(Y=0), it is P(Y=0|X3=0) as shown in correct answer above.

I think the probability of (Y = 0), be calculated as:

P(X1 X2 = 0) * P(X3 = 0) + P(X1 X2 = 1) * P(X3 = 1) = 3/4 * 1/2 + 1/4 * 1/2 = 1/2

this is because Y can be zero if X1X2 = 0 and X3 = 0, or if both are 1.

In this case applying bayes theorem will give 0.5.

what is going wrong in this approach?
0
@Arjun Sir

plz chk the range of this ans

I too think 0.5 should be ans
1

$Pr[Y=0 \mid X_3 = 0] =$

We know the formula $Pr[A \mid B] =\frac{Pr\left ( A\cap B \right )}{Pr\left ( B \right )}$

That means here $$Pr[X_{1}X_{2}\oplus X_{3}=0 \mid X_3 = 0] =$$

$$\frac{Pr[\left \{ X_{1}X_{2}X_{3}' +\left ( X_{1}X_{2} \right )'X_{3}\right \}=0\cap X_3 = 0]}{Pr\left ( X_{3} =0\right )}$$

Now value of $X_{1}X_{2}=\frac{3}{4}$

So, putting it in above equation

$\frac{ 3/4 * 1/2 + 1/4 * 1/2}{1/2}=1/2$
0
@srestha the numerator part of Bayes theorem formula -- can you explain it in words? If you do so you'll get the answer. For A conditional B, the numerator part gives the probability of both the events A and B happening together.
1

@Arjun Sir

We shouldnot consider only numerator part

They are asking about $Pr[Y=0 \mid X_3 = 0]$ ,right?(Not only numerator part)...........(i)

Now, we recall the formula $Pr[A \mid B] =\frac{Pr\left ( A\cap B \right )}{Pr\left ( B \right )}$

Put this formula in (i)

We get,$\frac{Pr[Y=0 \cap X_3 = 0]}{Pr[X_{3}=0]}$.......................(ii)

Now putting the value of $Y=X_{1}X_{2}\oplus X_{3}=\left \{ X_{1}X_{2}X_{3}' +\left ( X_{1}X_{2} \right )'X_{3}\right \}$ in the equation ii we get

$$\frac{Pr[\left ( \left \{ X_{1}X_{2}X_{3}' +\left ( X_{1}X_{2} \right )'X_{3}\right \}=0 \right )\cap \left ( X_3 = 0 \right )]}{Pr\left ( X_{3} =0\right )}$$ .........................iii

Now, as As $X_3 = 0$ is given, to have Y = 0, $X_1X_2$ should be $0$, meaning $\left(X_1, X_2 \right)$ should be one of $\left\{(0,0) (0,1) (1,0)\right\}$

So, There are totally 4 possibilities -  $\left\{(0,0) (0,1) (1,0), (1,1)\right\}$, out of which 3 are favourable cases.

So, X1X2 =3/4 and ( X1X2)'=1/4

and X3=1/2 and X3'=1/2

Now, putting it in above equation (iii)

$\frac{ 3/4 * 1/2 + 1/4 * 1/2}{1/2}=1/2$

1
I just pointed out the part where you did wrong. When you write $P_r [ Y = 0 \wedge X_3 = 0]$ what does this mean? It gives the probability of $Y=0$ and $X_3=0$. Both of these are not independent events and hence we cannot use the product of probabilities here -- you did not do this. But you considered the probabilities for $X_3$ and $X_3'$ which is wrong -- $X_3$ must be 0 because of the "AND" condition.
0
hey if u want  u can apply baye's theorem in the following way :

Pr(y=0|x3=0) = Pr(y=0).Pr(x3=0|y=0)/Pr(x3=0)

Now Pr(y=0) = 0.75*0.5+0.5*0.25(as x3=1&(x1x2)=1 OR x3=0&x1x2=0) = 0.5

Pr(x3=0|y=0) = 0.75(as we need to find how many ways x1x2 = 0 since y =0 is given and we have to find for x3=0)

Pr(x3=0) = 0.5

You will get 0.75 as answer.Let me know if u need more details.
0

@Sayan

my point is " They are asking about $Pr[Y=0 \mid X_3 = 0]$ "

not only $X1X2$

Putting this $Pr[Y=0 \mid X_3 = 0]$ , if u get 0.75

then go for details

0

@Arjun Sir

it is not just for independent event that is for every event

https://en.wikipedia.org/wiki/Conditional_probability

https://math.stackexchange.com/questions/44054/how-to-easily-describe-the-meaning-of-pa-b-pabpb-pbapa

0

@Arjun sir ...is this right ? 0

@Arjun Sir in P[Y=0|X=0], how to know whether "|" means "OR" (union) or "/" (bayes theorem). I have always seen
"/"

We have to find $P\left ( \frac{Y=0}{X_{3}=0} \right ) = ?$

 $X_{1}$ $X_{2}$ $X_{3}$ $Y$ 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 1 1 1 1 0

$P\left ( Y=0 \cap X_{3}=0\right ) = \frac{3}{8}$ and $P\left ( X_{3} = 0 \right ) = \frac{4}{8}$

So $P\left ( \frac{Y=0}{X_{3}=0} \right ) = \frac{P\left ( Y=0 \cap X_{3}=0\right )}{P\left ( X_{3} = 0 \right )} = \frac{3}{4}$

0
but

$Y = X_1X_2 \oplus X_3$

have u considered that?

Given,Y = 0 and X3 = 0

Y = X1.X2 $\bigoplus$ X3

0 = 1.0 $\bigoplus$ 0

0 = 0.1 $\bigoplus$ 0

0 = 0.0 $\bigoplus$ 0

there is only three possibility out of 4

P(E) = Favorable Outcomes / Total Outcomes

P(E) = 3 / 4

P(E) = 0.75

0
$P(y=0| x3=0)=P(x1 x2=0)= 3/4$

There are 3 different random variables = X1,X2, and X3 and each have a 1/2 probability of being either 0 or 1.

Y = X1 . X2 ⊕ X3     [. = AND, ⊕ = XOR]

Since each value (0,1) is equally possible for each variable (X1,X2,X3), we can create a truth table.

 X1 X2 X3 X1.X2 Y = X1 . X2 ⊕ X3 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 1 1 0 1 1 0 0 0 0 1 0 1 0 1 1 1 0 1 1 1 1 1 1 0

Now,

$P(Y=0 | X_{}3=0) = \frac{P(Y=0 \bigcap X_{}3=0)}{P(X_{}3=0)} = \frac{\frac{3}{8}}{\frac{4}{8}} = \frac{3}{4}$

## Related questions

1
4.5k views
Consider the following C program: #include<stdio.h> int f1(void); int f2(void); int f3(void); int x=10; int main() { int x=1; x += f1() + f2 () + f3() + f2(); printf("%d", x); return 0; } int f1() { int x = 25; x++; return x;} int f2() { static int x = 50; x++; return x;} int f3() { x *= 10; return x;} The output of the program is ______.
The velocity $v$ (in kilometer/minute) of a motorbike which starts form rest, is given at fixed intervals of time $t$ (in minutes) as follows: t 2 4 6 8 10 12 14 16 18 20 v 10 18 25 29 32 20 11 5 2 0 The approximate distance (in kilometers) rounded to two places of decimals covered in 20 minutes using Simpson's $1/3^{rd}$ rule is ________.
Suppose $c = \langle c, \dots, c[k-1]\rangle$ is an array of length $k$, where all the entries are from the set $\{0, 1\}$. For any positive integers $a \text{ and } n$, consider the following pseudocode. DOSOMETHING (c, a, n) $z \leftarrow 1$ ... , then the output of DOSOMETHING(c, a, n) is _______.