How do I solve this problem using bayes theorem?

101 Views Asked by At

The problem is as follows

A secret agent, disguised as a waiter for the evening, momentarily observes a note with a highly confidential password over the shoulder of an invited military commander. The password consists of a long randomized sequence of the letters a, b, and c, which occur with probabilities P(a) = 0.5, P(b) = 0.2, and P(c) = 0.3.

The agent makes random errors when reproducing the observed password on the napkin with the error probabilities: P(b|a) = 0.05, P(c|a) = 0.1, P(a|b) = 0.15, P(c|b) = 0.05, P(a|c) = 0.1, P(b|c) = 0.15.

(a) What is the probability that a letter a on the agent's napkin originally was a letter b on the military commander's password note?

(b) Given that a letter c was reproduced on the napkin, what is the probability that there was a letter c on that position in the original password note?

The problem is that I don't know what the probabilities p(a|b) and so on are supposed to mean if thats not the probability that one letter was originally the other. I have tried setting up events like let A = "a" is produced, and B = originally "b", then $P(A \bigcap B)$ would give me the answer after applying bayes theorem but that didnt work...

5

There are 5 best solutions below

4
On

P(a|b) is the probability that the agent writes an a on his copy given that commander wrote a b. You have to use the fact that P(x) = P(x|a)+P(x|b)+P(x|c). Does this help? P(a and b) will always be zero because both characters can only pick one letter per position and also P(a and b) doesn't show up in Baye's theorem. Does this help?

0
On

Be careful to use right and clear notations to represent so many conditional probabilities. For example, in your description of the problem, you said "$P(b|a) = 0.05$", where $P(b|a)$ is the probability that "the letter on napkin is $b$ under the condition that actually it is $a$". For clarification, it is better to explicitly denote it as "$P(N=b|R=a)$" (where "$N$" and "$R$" stand for "$napkin$" and "$real$" respectively).

Now in you question (a), you want to calculate the probability that "the real letter is $b$ under the condition that it is $a$ on the napkin", that is, $P(R=b|N=a)$. From Bayes Theorem, we have

$P(R=b|N=a)=\frac{P(N=a|R=b)P(b)}{P(N=a|R=a)P(a)+P(N=a|R=b)P(b)+P(N=a|R=c)P(c)}=...$.

In your question (b), what you need to calculate is $P(R=c|N=c)$. It should be straightforward for you to complete the rest in the similar way.

0
On

It is often useful to transmute a problem into a well known type, to simplify both understanding and solution.

Here I introduce three imaginary "factories" $F_1, F_2, F_3$ supposed to produce $a,\; b\;and \;c\;$ respectively (but also produce other types by mistake),and account for $0.5, 0.2, 0.3$ of the total output

Thus for part $(a)$, we simply want to compute the probability that the $a$ we got comes from $F_2 $$\Large\frac{P(F_2 \cap a)}{P(F_1\cap a)+P(F_2\cap a)+P(F_3\cap a)}$

Now $P(F_2 \cap a) = P(F_2)\cdot P(a |F_2)= 0.2*0.15$, and so on,

so the formula we get is

$$\dfrac{P(F_2)\cdot P(a) | F_2)}{\sum_{i=1}^3\; [P(F_i)\cdot P(a | F_i)]}$$

Proceed in a similar manner for part (b)

6
On

If the message is abc then there are $3! - 1 = 5$ possible wrong messages.

Given: P(b|a) = 0.05, P(c|a) = 0.1, P(a|b) = 0.15, P(c|b) = 0.05, P(a|c) = 0.1, P(b|c) = 0.15
Adding an extension:
$P(a|a) = 1 - (P(b|a) + P(c|a)) = 1 - (0.05 + 0.1) = 0.85$
$P(b|b) = 1 - (P(a|b) + P(c|b)) = 1 - (0.15 + 0.05) = 0.80$
$P(c|c) = 1 - (P(a|c) + P(b|c)) = 1 - (0.1 + 0.15) = 0.75$

Then

The probability that the message is copied correctly (abc) = $P(correct) = 0.85 \times 0.80 \times 0.75 = 0.476$

  1. The probability that a on the copied message was b on the real message is $P(b|a) = P(b) \times P(a|b) \div P(a) = 0.2 \times 0.15 \div (0.15 + 0.1 + 0.85) =$ ???. $0.15 + 0.1 + 0.85 > 1$??!!

  2. $P(c|c) = 0.75$ (vide supra) = Probability that c is on the copied message given that c is on the real message.
    Probability that c is on the real message given that c is on the copied message = $P(c|c) = P(c) \times P(c|c) \div P(c) = 0.3 \times 0.75 \div 0.9$

0
On

The problem is that I don't know what the probabilities p(a|b) and so on are supposed to mean if thats not the probability that one letter was originally the other.

$\def\P{\mathsf P}$That is what they are, but they really should indicate whom is writing what. Such as $\P(A=a\mid C=b)$ , $\P(a_A\mid b_C)$ , or similar to mean, "the probability that the agent writes 'a' when the commander writes 'b'." So you were provided:

$$\P(a_C) = 0.5, \P(b_C) = 0.2, \P(c_C) = 0.3\\ \P(b_A\mid a_C) = 0.05, \P(c_A\mid a_C) = 0.1\\ \P(a_A\mid b_C) = 0.15, \P(c_A\mid b_C) = 0.05\\ \P(a_A\mid c_C) = 0.1, \P(b_A\mid c_C) = 0.15$$

PS: Note that $\P(a_A\mid a_C) + \P(b_A\mid a_C) + \P(c_A\mid a_C) = 1$ and so forth.

I have tried setting up events like let A = "a" is produced, and B = originally "b", then P(A⋂B) would give me the answer after applying bayes theorem but that didnt work...

(a) What is the probability that a letter a on the agent's napkin originally was a letter b on the military commander's password note?

You are being asked for: the probability that the commander wrote "b" when the agent wrote "a". That is $\P(b_C\mid a_A)$.

Bayes' theorem and the Law of Total Probability will certanly work.

$$\P(b_C\mid a_A) =\dfrac{\P(a_A\mid b_C)\P(b_C)}{\P(a_A\mid a_C)\P(a_C)+\P(a_A\mid b_C)\P(b_C)+\P(a_A\mid c_C)\P(c_C)}$$


(b) Given that a letter c was reproduced on the napkin, what is the probability that there was a letter c on that position in the original password note?

Again, find $\P(c_C\mid c_A)$ similarly.