# What is the probability that a 1 was sent, given that 1 was received?

I have the following information:

$0$ is sent with probability $0.3$

$1$ is sent with probability $0.4$

$2$ is sent with probability $0.3$

Due to noise, $0$ is changed to $1$ during transmission with probability $0.2$

Due to noise, $0$ is changed to $2$ during transmission with probability $0.1$

Due to noise, $1$ is changed to $0$ during transmission with probability $0.2$

Due to noise, $1$ is changed to $2$ during transmission with probability $0.1$

Due to noise, $2$ is changed to $0$ during transmission with probability $0.2$

Due to noise, $2$ is changed to $1$ during transmission with probability $0.1$

Let A - the event that $\text{1 is received}$,

B - the event that $\text{1 is sent}$

I must find $P(B|A)$:

$$P(B|A) = \frac{P(A|B)P(B)}{P(A)}$$

$P(B)$ = 0.4

$P(A|B)$ = P(1 is sent) $\times$ P(1 does not change)

P(1 does not change) = [1 - P(1 becomes 0)]$\times$[1 - P(1 becomes 2)] (right?)

(1-0.2)(1-0.1) = 0.72

P(1 is sent) $\times$ 0.72 = (0.4)(0.72) = 0.288

P(A) = P(1 is sent and it stays 1) + P(0 is sent and it changes to 1) + P(2 is sent and it changes to 1)

P(A) = 0.288 + (0.3)(0.2) + (0.3)(0.1) = 0.378

Final answer: $$\frac{0.288 \times 0.4}{0.378} = 0.30$$

Has this been done correctly?

• @miracle173, I did that now. – Wildcard Dec 14 '16 at 3:56

Let's start out simply:

The odds of a 0 being sent are 0.3. The odds of a 1 being sent are 0.4. The odds of a 2 being sent are 0.3.

The odds of a 1 being received given that a 0 was sent are 0.2. Out of the total sample space, that's odds of 0.3 * 0.2 = 0.06.

Likewise, odds of a 2 being sent and a 1 being received (out of total sample space) is 0.3 * 0.1 = 0.03.

Total odds (out of total sample space) of a 1 being received when something else was sent is then 0.03 + 0.06 = 0.09.

Odds of a 1 being sent and received is 0.4 * 0.7 = 0.28. (Note: Given that a 1 was sent, odds of a 0 being received are 0.2. Given that a 1 was sent, odds of a 2 being received are 0.1. Thus, given that a 1 was sent, odds of a 1 being received are 0.7.)

So given that a 1 was received, the odds that it was actually a 1 that was sent are 0.28 / (0.28 + 0.09) = 0.28 / 0.37 = 28/37 $\approx$ 0.757.

You can visualize the total sample space, proportionately, like so:

With that picture, all you have to do is count squares to see that the answer is 28/37. :)

• I had you to "Odds of a 1 being sent and received is 0.4 * 0.7 = 0.28." – VD18421 Dec 13 '16 at 4:29
• Where did you get the 0.7 – VD18421 Dec 13 '16 at 4:29
• @VeeshaDawg, see update. – Wildcard Dec 13 '16 at 4:31
• Okay I see, thanks! :D – VD18421 Dec 13 '16 at 4:32
• Amazing image, thanks for the effort! – VD18421 Dec 13 '16 at 4:45

Let $S=k$ be the event that $k$ was sent and let $R=k$ be the event that $k$ was received.

You want to compute $P[S=1|R=1] = {P[S=1 \text{ and } R=1] \over P[R=1]}$.

$P[R=1] = \sum_k P[R=1|S=k] P[S=k] = 0.3 \times 0.2 + 0.4 \times 0.7 + 0.3 \times 0.1$.

$P[S=1 \text{ and } R=1] = P[R=1|S=1] P[S=1] = 0.4 \times 0.7$.

Hence $P[S=1|R=1] = {28 \over 37}$.

• What I don't understand is that.. If we are calculating the probability that 1 stays at 1 .. thats equal to to the probability that 1 does not turn to 2 and that 1 does not turn to 0 – VD18421 Dec 13 '16 at 4:18
• woudnt that be (1-0.1)(1-0.2)? – VD18421 Dec 13 '16 at 4:19
• No, you are looking at the probability that a one was sent given that one was received. There are only three possibilities to look at, $k$ was sent and $1$ received for $k=0,1,2$. – copper.hat Dec 13 '16 at 4:20
• I believe k = 0,1,2 – VD18421 Dec 13 '16 at 4:21
• My answer is incorrect, I need to fix it. – copper.hat Dec 13 '16 at 4:27

By letting $S,R$ be the value Sent and Received, then we are given, and can immediately infer, that: \begin{align}\newcommand{\P}{\operatorname {\mathsf P}} &\P(S{=}0)=0.3, \P(S{=}1)=0.4, \P(S{=}2)=0.3 \\ &\P(R{=}1\mid S{=}0)=0.2, \P(R{=}2\mid S{=}0)=0.1 &\implies \P(R{=}0\mid S{=}0)=0.7 \\ &\P(R{=}0\mid S{=}1)=0.2, \P(R{=}2\mid S{=}1)=0.1 &\implies \P(R{=}1\mid S{=}1)=0.7 \\ &\P(R{=}0\mid S{=}2)=0.2, \P(R{=}1\mid S{=}2)=0.1 &\implies \P(R{=}2\mid S{=}2)=0.7 \\ \end{align}

Then by Bayes' Rule, with the Law of Total Probability: $$\P(S{=}1\mid R{=}1) = \dfrac{\P(R{=}1\mid S{=}1)\P(S{=}1)}{\P(R{=}1\mid S{=}0)\P(S{=}0){+}\P(R{=}1\mid S{=}1)\P(S{=}1){+}\P(R{=}1\mid S{=}2)\P(S{=}2)}$$

The rest is just substitution of values.

Why does $\P(R{=}1\mid S{=}1)=0.7$ and so forth?   It is because by the definition of probability (which is also applicable to conditional probabilities): $$\P(R{=}0\mid S{=}1)+\P(R{=}1\mid S{=}1)+\P(R{=}2\mid S{=}1)~=~1 \\[2ex] \therefore~\P(R{=}1\mid S{=}1)~=~1-0.1-0.2$$

P(1 does not change) = [1 - P(1 becomes 0)]$\times$[1 - P(1 becomes 2)] (right?)

This assumes that P(1 becomes 0) and P(1 becomes 2) are independent events.

Consider what happens if 1 is transformed to 0 with probability 0.5, and 1 is transformed to 2 with probability 0.5 - what is the probability that 1 is correctly received?

The correct calculation is P(1 does not change) = 1 - [(P(1 becomes 0) + P(1 becomes 2)]