# Probability of one of two programs printing a letter?

Program 1 and Program 2 can either print A, B, or C upon activation.

Program 1 prints any of the 3 letters with equal probability, while Program 2 prints A with 50% probability, and B or C with 25% probability each.

A program is randomly selected and activated 7 times, printing A, C, C, B, A, B, A. I need to find the probability that program 2 was chosen.

I was thinking I would have to use the Total Probability theorem, and add up the probabilities of all the letters received, given that program 2 was chosen.

(.5)(.5) + (.5)(.25) + (.5)(.25) + (.5)(.25) + (.5)(.5) + (.5)(.25) + (.5)(.5)

((.5 represents the probability of program 1 being chosen, and it would be multiplied by program 's probabilities for choosing either letter, either A (.5) or B or C (.25)))

But this gives me a number greater than 1, which can't be correct. May I ask how to go about attempting this problem, please?

• Are the programs names 1 and 2, and they print the letters A, B or C? If so, can you please edit your question so that this is clearly stated. As of yet, you are talking about programs 1,2, A, B, C and letters A, B, C and it is quite confusing which is doing what. Commented Mar 10, 2022 at 23:31
• Suggest that you re-write your question, because you blur such terms as "Program 1" with "Program A", which confuses the reader. I was able to reverse engineer your intended question, but I should not have had to do that. Going forward, with this question and your future mathSE questions, please proofread your question both before posting and after posting. Then, please edit your question to remove any ambiguities or confusion. Commented Mar 10, 2022 at 23:32
• Impossible to solve unless you know something about the dependence/independence of successive letters that are typed. The above problem wording uses the "independence always holds whenever I want" fallacy. Commented Mar 11, 2022 at 0:18
• @Michael probably the most misused fallacy in probability.:)
– DRF
Commented Mar 11, 2022 at 8:12

This answer assumes that you used "Program A" when you intended "Program 1" and that you used "Program B" when you intended "Program 2".

This is a straight Bayes Theorem problem.

You have an event $$E$$ which is that
A, C, C, B, A, B, A
was printed.

Let $$p(E|1)$$ denote the probability that event $$E$$ would have occurred if Program 1 had been chosen.

Let $$p(E|2)$$ denote the probability that event $$E$$ would have occurred if Program 2 had been chosen.

Then, the probability of Program 1 (rather than Program 2) being the program that was used is

$$\frac{p(E|1)}{p(E|1) + p(E|2)}. \tag1$$

Therefore, given the formula in (1) above, the problem reduces to computing $$p(E|1)$$ and $$p(E|2)$$.

Clearly, $$p(E|1) = \frac{1}{3^7}.$$

The shortcut to computing $$p(E|2)$$ is that the computation is unchanged if you change the event to the printing of

A, A, A, B, B, C, C.

So,

$$p(E|2) = \frac{1}{2^3} \times \frac{1}{4^2} \times \frac{1}{4^2} = \frac{1}{2^{(11)}}.$$

Putting this all together,

$$p(E|1) = \frac{\frac{1}{3^7}}{\frac{1}{3^7} + \frac{1}{2^{(11)}}}.$$

Edit
There is a certain informality in the above analysis. More formally, what I might have said is:

Let $$p(E,1)$$ denote the probability that Program-1 was chosen, and that then event $$E$$ occurred.

Let $$p(E,2)$$ denote the probability that Program-2 was chosen, and that then event $$E$$ occurred.

Then, the probability that Program-1 was chosen is

$$\frac{p(E,1)}{p(E,1) + p(E,2)}.$$

Since, absent any other information, it is assumed that Program-1 and Program-2 each have a $$50\%$$ chance of being chosen, you end up with a computation that yields an equivalent answer. I used the informal approach (instead) instinctively, because that is the way my intuition went.