Teaching Random Variables: Demo Program for Product of m Independent Uniform Variables

This paper presents demo program for teaching random variables dedicated to demonstration and visualization of behaviour of the product of m independent uniform random variables. The demo is used as a complementary tool in the teaching Random signals and processes curriculum at the graduate level. The demo is made in MATLAB and utilizes all benefits provided by MATLAB, such as simplicity, and good graphic environment, interactive use, among others. Additionally, this demo is used with other demo programs, also made in MATLAB, in teaching/learning process of random variables. Students were very satisfied with this demo program expressing that helped them understanding better the behaviour of the product of uniform random variables. Author


Introduction
Demo programs that illustrate concepts with visual aids have become one of the more important tools in the field of engineering education (Fu 2003). Demo programs are especially beneficial in terms of saving time and effort for both teaching and learning. 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 (Dolecek 2013b). In this work we present demo program in MATLAB environment, for the behaviour of the product of m=5 independent uniform variables, all in the same range, [1/2, 3/2]. The goal is to show how the product of uniform independent variables approaches to a lognormal variable, and that this convergence depends on the choice of the range of independent uniform random variables, and the number of variables in product. The rest of the paper is organised in the following way. Next section presents theoretical background, while Section 3 describes the demo program, and presents the illustration of the result of the demo presentations, for given parameters. The discussion is presented in Section 4. Finally, Section 5 elaborates the concluding remarks.

Theoretical Background
We consider uniform random variable X in the interval [R1, R2]. The corresponding Probability Density Function (PDF) is given as: Consider the product of m independent uniform random variables in the same interval: where Xi is the uniform random variable in the interval [R1, R2], where R1, R2 are positive numbers, R2> R1. In Dettmann and Georgiou (2009) is given the expression for the PDF of m independent random variables given in Equation (2): where: We consider here the special case of Equation (4), where R1=1/2 and R2=3/2, and m=5. Since the product (2) can be expressed as, according to the Central Limit Theorem (CLT), the right side of Equation (5) approaches to a normal random variable Z, showing that the variable Y approximates a lognormal random variable (Dolecek 2013a).

Features of demo program
The demo program is made in the MATLAB, which is widely accepted as software for research and teaching/learning at many universities across the world (Lyon and Magana 2020). Its principal characteristics are simplicity, high capability for the applications, not only in all parts of engineering but also in many other disciplines, like economy, psychology, medicine, etc. Pursuing its very favourable characteristics, we introduced various demo programs for teaching different subjects in digital signal processing, and communications. Since random variables and processes are an important subject in teaching communication systems, we introduced different demo programs for teaching random variables and processes, like, RANDEMO-Program for teaching fundamentals of random variables (Dolecek 1997a), Demo for teaching autocorrelation function and noise (Dolecek 2012), Demo for narrowband Gaussian noise (Dolecek and Harris 2011), Demo for sum of independent uniform random variable (Dolecek 2013a), and Demo for teaching Central Limit Theorem (Dolecek 1997b). The principal features of this demo are:  Easy to use. The user is guided during the presentation with the instructions what to do in next steps, and consequently he/she can be concentrated completely on the subject.  Interactivity. In order to get an active participation of students, there is option that the users choose the parameters by their own.
 Repeatability. The program can be repeated as many times as one wants with different parameters.  Easy installation. The program can be easily installed in any platform in the MATLAB environment.

Description of demonstrations and results
In this demonstration R1 =1/2, R2=3/2, and m=5. There are i=1,…, m steps. At each step the product of uniform random variables and the estimated probability density (PDF) are presented.
In the final step the product of m random variables is compared with the corresponding lognormal variable.
In the following, we present results for all steps.
Step 1: Uniform random variable, and the estimated PDF, m=1 Figure 1 presents the uniform random variable and the estimation of its PDF.
(a) Uniform random variable, R1=1/2, R2=3/2 (b) PDF Figure 1: First step Figures 2, 3, 4, and 5 illustrate next steps 2, 3, 4, and 5, respectively, presenting the product of uniform random variables, and the corresponding estimated PDFs. Figure 6 compares the product of five independent uniform random variables and lognormal random variable. Note that the product of five uniform variables approaches to a lognormal random variable.
Step 2: Product of two uniform random variables, and the estimated PDF, m=2 Note that in the third step the product of uniform variables is very similar to a lognormal variable.
Step 4: Product of four uniform random variables, and the estimated PDF, m=4  Figure 7 compares the estimated PDF of the product of uniform random variables with the lognormal PDF, thus confirming that this product approaches to a lognormal random variable.

Discussion
This demo is used as a complementary tool in the traditional in-room teaching. However, during COVID-19 pandemic it was used in online classes. It is worth to mention, that this demo, and other complementary demo programs, utilized in online classes, were of high utility in improving efficiency of online classes by improving understanding of the subjects. First, theoretical background was explained, followed by the demo, and finally were discussion. Typical discussions were about the influence of the choice of the parameters of uniform random variable, to convergence of the product to a lognormal random variable. Another important topic of discussions, was why this product approaches to a lognormal random variable, and not for example to a normal random variable. The students are asked to choose other parameters for running demo for their homework, and we discussed the obtained results. At the end of the course, a simple Quiz, about the utility of demo programs in the teaching/learning process is presented. As expected, students were very enthusiastic with the introducing such kind of tools in teaching random variables, especially in online classes.

Conclusions
This paper presents the demo program for the visualization of the behaviour of the product of the m independent uniform random variables in the same interval [1/2, 3/2], and taking m=5. The product of variables and the corresponding PDFs are estimated at each step, 1,…, m , showing how the product of independent uniform random variables approaches to the lognormal random variable. Students have chosen the parameters by their own for running this demo, for their homework.
The obtained results are discussed in the context of Equations (3)-(4), in online classes. Students considered this demo as a very useful complementary tool in the teaching/learning process, especially for online classes during the COVID-19 pandemic.