TITLE: Probability of one of two programs printing a letter?
QUESTION [3 upvotes]: 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?

REPLY [6 votes]: 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.

Addendum
Response to the comment of Michael, following the original question.
His comment makes sense to me.  I assumed that each letter is an independent event, whose probability of being printed is unaffected by the letters printed before or after.  Further, I (also) agree that without this assumption, the problem is not solvable.
{"set_name": "stack_exchange", "score": 3, "question_id": 4400566}