Compute the conjunction probability of $contains$ operators in string

58 Views Asked by At

I have an unknown string S of length n. I have to given small string A1 and A2. Supposed that I know the probability of S.contains(A1) = true (which mean A1 appears in S at least once) and S.contains (A2) = true.

How do we compute the probability of S.contains(A1) && S.contains(A2)?

The general problem: Compute the probability P[S.contains(A1) && S.contains(A2) && ... && S.contains(An)] when we know P[S.contains(A1)], P[S.contains(A2)], ..., P[S.contains(An)]

Thank you

Update: We can compute P[S.contains(x) == true] in which x is an arbitrary string.

1

There are 1 best solutions below

3
On

I guess if intersection of A1 and A2 is 0, then you should simply multiply the Pr(A1) and Pr(A2). or if you know probability of S.contains(A1) or S.contains(A2) you can simply subtract it from P(S.contains(A1) + p(S.contains(A2))