Ian Clarke <[EMAIL PROTECTED]> writes:
>On Wed, Oct 01, 2003 at 06:18:04PM -0400, Dan Merillat wrote:
>> pConnectFailed = .75, pSearchFailed=.75
>
>Since a ConnectFailed and a SearchFailed are mutually exclusive 
>pConnectFailed+pSearchFailed will always be <= 1.

Actually, the two formulas: 1-(pCF+pSF) and (1-pCF)*(1-pSF) can be
reconciled.  We just have to be a little careful about how we measure
our probabilities.

If we are talking about the global probability (out of all connection
attempts) that we get a SearchFailed, then indeed pConnectFailed +
pGlobalSearchFailed is always <= 1.  That is, pGlobalSearchFailed =
#search_failed / #connections_attempted.

However, what the code actually keeps track of is the conditional
probability (out of all successful connections) that we get a
SearchFailed.  That is, pConditionalSearchFailed = #search_failed /
#connections_succeeded.

To get the global probability, we need to multiply that by the
probability of a successful connection:

pGlobalSearchFailed = pConditionalSearchFailed * pConnectSucceeded
                    = pConditionalSearchFailed * (1-pConnectFailed)
                    = pConditionalSearchFailed -
                          pConditionalSearchFailed * pConnectFailed

Now we have:

pConnectOrSearchFailed = 1 - (pConnectFailed + pGlobalSearchFailed)
    = 1 - pConnectFailed - pGlobalSearchFailed
    = 1 - pConnectFailed - (pConditionalSearchFailed -
                               pConditionalSearchFailed * pConnectFailed)
    = 1 - pConnectFailed - pConditionalSearchFailed +
                               pConditionalSearchFailed * pConnectFailed
    = (1-pConnectFailed) * (1-pConditionalSearchFailed)

Comparing the first and last lines, we see that the two formulas are
equivalent IF we are clear whether we are measuring the global or
conditional probabilities.  The code computes the latter, so the last
line is the appropriate one.

>Anyway, as Ed has said - these days pConnectFailed will always be 0 as 
>connections are opened before the reference is considered for routing 
>(in theory), so this debate may be on a moot point.

This type of issue may come up again with measurements of other
probabilities, though, so it's an instructive question to consider.

theo


-- 
Theodore Hong         Dept. of Computing, Imperial College London
[EMAIL PROTECTED]   180 Queen's Gate, London SW7 2BZ
PGP key: http://www.doc.ic.ac.uk/~twh1/

_______________________________________________
Devl mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to