WebCab Probability and Statistics for COM v3.3 Demo

RandomVariables.ProbabilityOfEvents Method 

Evaluate the probabilities of the probability distribution associated with a random variable when the random variable is provided to the method directly rather than read from the internal table set.

public double[] ProbabilityOfEvents(
   int[] numberOfOccurrences
);

Parameters

numberOfOccurrences
An array where the k-th term of the array is the number of occurrences of the k-th possible outcome of the experiment.

Remarks

That is, we evaluate the associated probability of an event occurring within an experiment when the number of occurrences of each event is known. Note that the probabilities returned are given in decimal format (i.e. 1 percent = 0.01).

Remark: This is a utility method which assists in the application of method we require that an experiments random variable is provided in terms of the probability of each of the possible outcomes which can occur.

Example and Further Explanation

Considering the experiment of counting the number of children of the ages 1, 2, 3, 4, or 5, within a nursery. Say the random variable f, for this experiment has been found to be:

  1. f(1) = 28, i.e. the number of 1 year old children is 28.
  2. f(2) = 30, i.e. the number of 2 year old children is 30.
  3. f(3) = 26, i.e. the number of 3 year old children is 26.
  4. f(4) = 32, i.e. the number of 4 year old children is 32.
  5. f(5) = 30, i.e. the number of 5 year old children is 30.

In order to pass this experiment, (that is represent its random variable) for this method you will need to pass the single parameter with the following values: {28, 30, 26, 32, 30}.

The associated (discrete) probability distribution p, for these results which gives the probability of a child randomly selected from the nursery take a given age is:

  1. p(1) = 28 / (28+30+26+32+30), i.e. probability of a child being 1 years old.
  2. p(2) = 30 / (28+30+26+32+30), i.e. probability of a child being 2 years old.
  3. p(3) = 26 / (28+30+26+32+30), i.e. probability of a child being 3 years old.
  4. p(4) = 32 / (28+30+26+32+30), i.e. probability of a child being 4 years old.
  5. p(5) = 30 / (28+30+26+32+30), i.e. probability of a child being 5 years old.

The probability of each of the possible outcomes which can occur is exactly what is returned by this method. In particular, this method will return the array: {p(1), p(2), p(3), p(4), p(5)}, where the k-th term corresponds to the probability of an occurrence of the k-th outcome occurring.

See Also

RandomVariables Class | WebCab.COM.Statistics.DiscretePrb Namespace | CumulativeProbDistFunc