I doubt the answer is "1-(pConnectFailed+pSearchFailed)" because that might produce negative probabilities. Suppose both are 2/3.
The following might justify the code as-is:
If pNotConnectFailedOrSearchFailed is an estimate of "the probablity that neither the connection *nor* the search will fail" then it is the same estimate as "the probablity that the connection and the search will succeed".
Let C be a r.v. equal to 1 if connection succeeds, 0 if fails Let S be a r.v. equal to 1 if search succeeds, 0 if fails
Then Prob(C and S)=Prob(C)*Prob(S given C)
Obviously, Prob(C)=1-pConnectFailed.
Now the crucial question: Does pSearchFailed just estimate "the probability that the search will fail given the connection succeeded"? If not, someone please tell me what it means! If so, then Prob(S given C)=1-pSearchFailed. In which case, the code is correct as is.
And if all of the above is correct, I suggest renaming pNotConnectFailedOrSearchFailed to pConnectAndSearchSucceeds.
-Martin
Ian Clarke wrote:
Line 160:
double pNotConnectFailedOrSearchFailed = (1 - pConnectFailed) * (1- pSearchFailed);
My high-school math is a bit rusty, but shouldn't that be:
... = 1-(pConnectFailed+pSearchFailed);
_______________________________________________ Devl mailing list [EMAIL PROTECTED] http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/devl
