```Date: Mar 13, 2007 11:54 AM
Author: briggs@encompasserve.org
Subject: Re: Probabilities

In article <1173799560.186277.223040@8g2000cwh.googlegroups.com>, Anonymous writes:> Hi all,> > I've got the following phrase:> > BABAAAAAABAAABBAAAAAABA> > I would like to calculate the conditional probability P(B|A).To phrase it more clearly, you want the conditional probabilitythat the next symbol is a B given that the current symbol is an A.(And perhaps you want to throw in that you want to choose thecurrent position uniformly in the range 1 through 23)> If I use a logical thought, I get:> > P(B|A) = the_number_of_AB / the_number_of_A = 4 / 17 = 0.23And you want to consider the A at the end of the string as being"not followed by a B" even though this is arguably a degenerate case.Yes, I'd consider this result to be correct, given that interpretation. > and if I use the formula P(B|A) = P(B inter A)/P(A) I get:> P(B inter A) = 4 / (23-1)> and P(A) = 17/23 then:> > P(B|A) = 4/22 * 23/17 = 0.25This time you did consider that the A at the end of the string tobe a degenerate case and threw it out.  In effect, you are choosingthe "current position" uniformly in the range 1 through 22 now.Yes, I'd consider this result to be correct, given that interpretation.> So I would like to know why the "logical thought" is wrong and if the> result is right with the formula.Both results are correct.  It just depends on whether you include orexclude one particular boundary case.
```