
DEMO PROGRAMS FOR NORMAL AND UNIFORM 
RANDOM VARIABLES TRANSFORMATION 
Gordana Jovanovic Dolecek and Fred Harris 
Department of Electronics, Institute INAOE, Puebla, Mexico 
Department of Electrical Eng., SDSU San Diego, U.S.A. 
Keywords:  Demo program, MATLAB, Linear transform, Nonlinear transform, Normal variables, Uniform variables. 
Abstract:  This paper presents MATLAB-based demo programs for transformation of normal and uniform random 
variables. Linear as well as nonlinear transforms are considered. It is demonstrated how the transform 
changes the corresponding probability density function. It is also shown how to use the transformation of 
given random variable to generate a new desired random variable. The programs can be used as a 
complement to theoretical classes or alone as a self-study tool. 
1 INTRODUCTION 
Computer-aided learning has become an important 
educational research activity in various engineering 
disciplines and there has been a growing interest in 
the development of educational software in all areas 
of study (Fernandez and Sanchez, 2004). As a result 
many computer packages have been developed to 
assist learning (Yann and Teng, 2003; Li and Lie, 
2004).  
It is known that random variable (r.v.) is generally 
considered as one of the most abstract and 
conceptually difficult areas in the engineering 
education and teaching of random variables is one of 
the subjects that requires more time for its 
understanding. Our experience shows that the use of 
demo programs gives students the visual and 
intuitive representation of the random variables 
which had traditionally been stated in terms of 
abstract mathematical description (Jovanovic, 1997; 
Jovanovic and Champac, 2000). Such software tools 
must have characteristics like repeatability, capacity 
to motivate students, interactivity, versatility, easy to 
use etc.  
Presented in this paper are demo programs to 
teach the transform of uniform and normal random 
variables. The programs can be used as a 
complement to theoretical classes or alone as a self-
study tool. The programs are interactive, i.e., the 
user chooses the parameters of the input variables 
and the corresponding transform.  
Each program presents input and output variables 
and the desired transform as well as the estimated 
probability densities. The exact densities are also 
presented.  
The rest of the paper is as follows. Next section is 
devoted to the linear and nonlinear transformations 
of uniform random variables, while Section 3 
demonstrates the linear and nonlinear transforms of 
normal random variables. 
2 UNIFORM VARIABLE  
2.1  Demo for Linear Transform 
In this program the linear transform (LT) Y=aX+b of 
the uniform random variable X  is discussed. The 
user chooses the range (R
1
, R
2
) of the uniform r.v. 
and the parameters of the linear transform a and b.  
The program shows the output variable and the 
estimation of the input and output probability 
densities (PDS), thus demonstrating that the linear 
transform of the uniform r.v. results in an uniform 
r.v. As an illustration Fig.1 shows the result for R
1 
= 
-1, R
2 
= 4, a = 2, and b = 3. The estimation of the 
corresponding PDFs is given in Fig.2. 
Figure 3 presents the corresponding uniform 
PDFs. 
It is also demonstrated how this result is useful to 
generate the desired uniform r.v. from the given 
uniform r.v. For example, in MATLAB the file rand 
363
Dolecek G. and Harris F. (2009).
DEMO PROGRAMS FOR NORMAL AND UNIFORM RANDOM VARIABLES TRANSFORMATION.
In Proceedings of the First International Conference on Computer Supported Education, pages 363-366
DOI: 10.5220/0001835003630366
Copyright
c
 SciTePress