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

Probability.ProbabilityIntersection Method 

Calculates the probability of the intersection of two sets of events occurring where the two sets of events are taken from the same probability space.

public double ProbabilityIntersection(
   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 (subset) of events given as an array of integers which corresponds to the index of the events within the set of all events.

Return Value

The probability of the intersection of eventsA and eventsB.

Remarks

Before this method is called the set of events and the corresponding probabilities of each event within each of the two sets of events must be set using SetProbability, or SetProbability.

Example

If the probability measure of the set under consideration is p = {0.2, 0.3, 0.4, 0.1}, and we consider the two (sub)sets of events eventsA = {0, 2} (i.e. the events corresponding to probabilities 0.2, 0.4), and eventB = {0, 3} (i.e. the events corresponding to probabilities 0.2, 0.1). In such situations this method will return the probability of the events corresponding to the intersection of these two sets of events occurring. That is, the probability of the 0th event with a probability of 0.2 occurring.

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