Retrieves the values of the probability distribution associated with a (discrete) random variable within a given position within the table of random variables which have been set.
In particular, this method returns an array where the first term corresponds to the probability of the 1st possible outcome of the random variable, the 2nd term to the probability of the 2nd possible outcome and so on. For further details, concerning how the table of random variables is set please see the notes within the XML Web service overview or the notes given below.
Recall that a (discrete) random variable describes the number of times a given outcome (or event)
occurs from a given experiment. In particular, in can be viewed as a function f
, which
maps the possible outcomes to the number of occurrences of that outcome during the experiment
considered. Say for example we are considering an experiment of counting the ages of children within
a nursery. All the children's ages (in years) take one of five values: namely 1, 2, 3, 4, 5
,
and for the entire nursery the number of children of each age was found to be: 28, 30, 26, 32, 30
;
respectively.
The random variable of this experiment which we denote by f
, mapping
the ages of the children to the number of children in the nursery of that age, is
given by:
f(1) = 28
f(2) = 30
f(3) = 26
f(4) = 32
f(5) = 30
Now 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:
p(1) = 28 / (28+30+26+32+30)
p(2) = 30 / (28+30+26+32+30)
p(3) = 26 / (28+30+26+32+30)
p(4) = 32 / (28+30+26+32+30)
p(5) = 30 / (28+30+26+32+30)
These values corresponding to the probability distribution associated with the random
variable describing the experiment being considered are evaluated and returned by this
method as an array where the k
-th term of the array corresponds to probability
of the k
-th outcome of the experiment occurring. In the example given above
we have the following correspondence:
= 28
(i.e. f(1)
,
which corresponds to a probability, that is the value of the probability distribution p(1)
,
equal to 28 / (28+30+26+32+30)
, which is also the first term of the array returned.
= 30
(i.e. f(2)
,
which a corresponding probability distribution value p(2)
, equal to 30 / (28+30+26+32+30)
and so on...
Hence, the array returned (in the notion used above) in the examples of the nursery is
{p(1), p(2), p(3), p(4), p(5)}
.
In order to apply this method to the study of random variables you will first need to set the random variables within the internal table (i.e. an ordered collection of random variables) by using one or more of the following:
i
th position within the random variable table.
Note: If one of the random variables is either incorrectly set or is no longer in use then it can be removed from the table using (int).
RandomVariables Class | DiscreteProbability Namespace