WebCab Probability and Statistics Web Services for .NET v3.3 Demo

Probability.ConditionalProbability Method 

Calculates the conditional probability which is usually denoted by A|B.

public double ConditionalProbability(
   int[] eventsA,
   int[] eventsB
);

Parameters

eventsA
The first (sub)set of events given as an array of integers which corresponds to the index of the events within the set of all events.
eventsB
The second (sub)set of events defined as an array of integers which corresponds to the index of the events within the set of all events.

Return Value

The conditional probability of eventA, when eventB is known to occur.

Remarks

The conditional probability is the probability of an event A taking place when it is known that event B occurs.

Example

If the probability measure on a set is p = {0.2, 0.3, 0.4, 0.1}, and we have two sets of events A = {0, 2}, and B = {0, 3}, then the probability of A|B, will be 0.33.

Exceptions

Exception TypeCondition
IncompatibleEventExceptionThrown if any of two events is incorrect.
ProbabilityNotSetExceptionThrown if the probability measure has not been set using SetProbability.

See Also

Probability Class | DiscreteProbability Namespace | SetProbability | SetProbability