A general finite discrete random variable is essentially the same as a complex random draw. Consider a population with N elements labeled {1,2,...,N}. A complex random draw chooses element i of this set with probability p(i), where all probabilities are non-negative, and the probabilities sum to 1. A random variable X is a FUNCTION of the random draw. The simplest function just looks at the serial number of the draw, so that X takes the value i with probability p(i).
EXCEL has a built in function for generating finite discrete random variables. We demonstrate how this is done in this slide:
Step1: Write down each element (i) of population set in one column and probability of each element P(i) in immediate next column.
Step2: Select the top tab named DATA it will show a menu. In the top write of data menu select DATA ANALYSIS.
(Note: If you do not see DATA ANALYSIS in the menu, go to file, select options. In bottom left column select Add-Ins. In bottom left of second column select Go (right besides manage). Ensure to check the box with Analysis ToolPak and click OK. Data Analysis option will appear in Data menu)
Step3: In Data Analysis select Random Number Generation and click Ok. Another dialogue box will be open as:
Step4: In first row you write the number of random variables you want to generate. Second option requires to mention the number of finite random numbers to be generated.
Select “discrete” in Distribution menu. Under Parameters give range of cells that has elements of population along with probabilities.
Select Output range and click ok.
Example:
If we flip a fair coin 3 times, we can list all possible outcomes and find the probability of each outcome. Such as :{ HHH, HTH, HTT, HHT, THH, TTH, THT, TTT).
Probability distribution for the number of heads in 3 flips of a coin is given as:
Step1: Input this data in Excel sheet, let we write it in column A and B from A1:B5.
Step2: For generating finite discrete random variable (s) select data from top of excel workbook and then go to Data analysis in the menu.
Step3: Write number or random variables to be generated suppose we want to generate 2 RV so we write 2.
Step4: Write number of random numbers to be generated e.g. 10.
Step5: Select discrete form distribution menu.
Step6: Under parameters select A2:B5 (Do not include labels).
Step7: Select output range let I choose cell F2 and click on OK button.
Two Discrete finite random variables will be generated as:
In similar way we can generate ANY number of discrete finite random variables.