In any random experiment, a chance, or probability, always exists that a particular event will or will not occur. The probability that event A will occur is the ratio of the number of outcomes favorable to A to the total number of possible outcomes.
You can assign a number between zero and one to an event as an indication of the probability that the event will occur. If you are absolutely sure that the event will occur, its probability is 100% or one. If you are sure that the event will not occur, its probability is zero.
Many experiments generate outcomes that you can interpret in terms of real numbers. Some examples are the number of cars passing a stop sign during a day, the number of voters favoring candidate A, and the number of accidents at a particular intersection. Random variables are the numerical outcomes of an experiment whose values can change from experiment to experiment.
Discrete random variables can take on only a finite number of possible values. For example, if you roll a single unbiased die, six possible events can occur. The roll can result in a 1, 2, 3, 4, 5, or 6. The probability that a 2 will result is one in six, or 0.16666.
Continuous random variables can take on any value in an interval of real numbers. For example, an experiment measures the life expectancy x of 50 batteries of a certain type. The batteries selected for the experiment come from a larger population of the same type of battery. The following figure shows the histogram for the observed data.

The previous figure shows that most of the values for x are between zero and 100 hours. The histogram values drop off smoothly for larger values of x. The value of x can equal any value between zero and the largest observed value, making x a continuous random variable.
You can approximate the histogram in the previous figure by an exponentially decaying curve. The exponentially decaying curve is a mathematical model for the behavior of the data sample. If you want to know the probability that a randomly selected battery will last longer than 400 hours, you can approximate the probability value by the area under the curve to the right of the value 4. The function that models the histogram of the random variable is the probability density function.
A random variable X is continuous if it can take on an infinite number of possible values associated with intervals of real numbers and a probability density function f(x) exists such that the following relationships and equations are true.
| f(x) ≥ 0 for all x | (A) |
![]() |
(B) |
![]() |
(C) |
The chance that X will assume a specific value of X = a is extremely small. The following equation shows solving Equation C for a specific value of X.
![]() |
(D) |
Because X can assume an infinite number of possible values, the probability of it assuming a specific value is zero.
The normal distribution is a continuous probability distribution. The functional form of the normal distribution is the normal density function. The following equation defines the normal density function f(x).
![]() |
(E) |
The normal density function has a symmetric bell shape. The following parameters completely determine the shape and location of the normal density function:
= 0.If a random variable has a normal distribution with a mean equal to zero and a variance equal to one, the random variable has a standard normal distribution.
The following equation defines the one-sided probability of a normally distributed random variable.
| p = Prob(X ≤ x) | (F) |
where p is the one-sided probability, X is a standard normal distribution with the mean value equal to zero and the variance equal to one, and x is the value.
You can use the Normal instance of the Continuous CDF VI to compute p for x.
![]() |
Note You can use the Continuous CDF VI only in the LabVIEW Full and Professional Development Systems. |
Suppose you measure the heights of 1,000 randomly selected adult males and obtain a data set S. The histogram distribution of S shows many measurements grouped closely about a mean height, with relatively few very short and very tall males in the population. Therefore, you can closely approximate the histogram with the normal distribution.
Next, you want to find the probability that the height of a male in a different set of 1,000 randomly chosen males is greater than or equal to 170 cm. After normalizing 170 cm, you can use the Continuous CDF VI to compute the one-sided probability p. Complete the following steps to normalize 170 cm and calculate p using the Continuous CDF VI.
The choice of the probability density function is fundamental to obtaining a correct probability value.
In addition to the normal distribution method, you can use the following methods to compute p:
The Normal instance of the Continuous Inverse CDF VI computes the values x that have the chance of lying in a normally distributed sample for a given p. For example, you might want to find the heights of males that have a 60% chance of lying in a randomly chosen data set.
![]() |
Note You can use the Continuous Inverse CDF VI only in the LabVIEW Full and Professional Development Systems. |
In addition to the inverse normal distribution method, you can use the following methods to compute x with a known p:
The following equation defines the probability distribution function F(x).
![]() |
(G) |
where f(x) is the probability density function,
, and
By performing differentiation, you can derive the following equation from Equation G.
![]() |
(H) |
You can use a histogram to obtain a denormalized discrete representation of f(x). The following equation defines the discrete representation of f(x).
![]() |
(I) |
The following equation yields the sum of the elements of the histogram.
![]() |
(J) |
where m is the number of samples in the histogram and n is the number of samples in the input sequence representing the function.
Therefore, to obtain an estimate of F(x) and f(x), normalize the histogram by a factor of Δx = 1/n and let hj = xj.
The following figure shows the block diagram of a VI that generates F(x) and f(x) for Gaussian white noise.

The VI in the previous figure uses 25,000 samples, 2,500 in each of the 10 loop iterations, to compute the probability distribution function for Gaussian white noise. The Integral x(t) VI computes the probability distribution function. The Derivative x(t) VI performs differentiation on the probability distribution function to compute the probability density function.
![]() |
Note You can use the Integral x(t) VI and the Derivative x(t) VI only in the LabVIEW Full and Professional Development Systems. |
The following figure shows the results the VI in the previous block diagram returns.

The previous figure shows the last block of Gaussian-distributed noise samples, the plot of the probability distribution function F(x), and the plot of the probability density function f(x). The plot of F(x) monotonically increases and is limited to the maximum value of 1.00 as the value of the x-axis increases. The plot of f(x) shows a Gaussian distribution that conforms to the specific pattern of the noise signal.