# How can I determine source type of a sequence?

I have sequences of binary events, e.g. $s=0001101$. I know that there are two types of sources $A,B$ possible generating each sequence. There are different conditional probabilities for a hit given a certain outcome from the previous position:

$P(s_{i+1}=1|s_i=1,A)=a$
$P(s_{i+1}=1|s_i=0,A)=q$
$P(s_{i+1}=1|s_i=1,B)=q$
$P(s_{i+1}=1|s_i=0,B)=q$

How can I determine the probability for a sequence being $A$ or $B$ (e.g. $P(A|s=0001101)$)? I thought Bayes, but I'm lost :/

• This seems to be routine bookwork. You should probably add the self-study tag (check its tag wiki here) and expect hints and guidance. [If it's really not, you'd need to supply enough context to make it clearer how the problem arises.] Commented Sep 16, 2014 at 21:17
• The context is my previous question stats.stackexchange.com/questions/114978/… which apparently wasn't boiled down enough to be understandable.
– Gere
Commented Sep 17, 2014 at 6:23

You can do part of this using Bayes rule, but it requires additional calculation, and for a complete answer, some additional information.

Note that (if you can make the necessary Markov assumption) you can calculate $P(\{s_2,s_3,...,s_7\}|s_1,A)$ (and similarly for $B$).

to get $P(\{s_1,s_2,s_3,...,s_7\}|A)$ from there, you need $P(s_i=1|A)$. You'd also want $P(A)$ and $P(\{s_1,s_2,s_3,...,s_7\})$ to apply Bayes

• I tried some approach, but wasn't sure if I'm doing it right. Is it OK to estimate $P(1|A)$ from $P(1|A)=P(1|1A)P(1|A)+P(1|0A)P(0|A)$? Do I need additional information apart from $P(A), P(B)$? (Solving for $a,q$ turned out to be very messy - not sure if I went wrong)
– Gere
Commented Sep 17, 2014 at 6:22
• I don't know what you mean by that notation. Commented Sep 17, 2014 at 7:19
• I'd like to estimate $P(1|A)$ "recursively" from assuming it's an infinite event chain and $P(s_{i+1}=1|A)=P(s_i=1|A)$ which are also related by transition probabilities.
– Gere
Commented Sep 17, 2014 at 8:04
• You haven't defined $P(1|A)$ and I don't know what it means. Commented Sep 17, 2014 at 8:24
• Didn't you use it yourself? Here is the written out version of what I guessed: $P(s_{i+1}=1|A)=P(s_{i+1}=1|s_i=0,A)P(s_i=0|A)+P(s_{i+1}=1|s_i=1,A)P(s_i=1|A)$ together with $P(s_i=1|A)=1-P(s_i=0|A)=P(s_{i+1}=1|A)$ (assuming an infinite sequence)
– Gere
Commented Sep 17, 2014 at 11:40