HP 40gs HP 39gs_40gs_Mastering The Graphing Calculator_English_E_F2224-90010.p - Page 121
Simulation of a normal die, Simulating Random Variables
UPC - 882780045217
View all HP 40gs manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 121 highlights
Simulation of a normal die Similarly the expression INT(RANDOM*6+1) will simulate one roll of the die. This means that MAKELIST(INT(RANDOM*6+1),X,1,500,1) will simulate 500 rolls of a normal die. We therefore need only store the resulting list into a Statistics aplet column to analyze and graph it. This is shown in the series of screen shots to the right. To simulate the adding of two six sided dice, use the similar expression MAKELIST(INT(RANDOM*6+1)+INT(RANDOM*6+1),X,1,500,1) Simulating Random Variables It is occasionally handy to be able to simulate a set of observations on random variables of various sorts. This can also be done using the MATH menu function MAKELIST. See the previous page for the syntax of MAKELIST. It is also covered in more detail on page 190) Example 1: Simulate 100 observations on a Uniform[0,1] random variable to be stored in C2. In the HOME view type: MAKELIST(RANDOM,X,1,100,1) C2 Note: 1. The symbol is one of the screen keys in the HOME view, appearing as and read as 'store'. 2. The X is simply a dummy variable here to count off the values. Example 2: Simulate 50 observations on a discrete uniform[3,7] random variable In HOME type: MAKELIST(INT(5*RANDOM+3),X,1,50,1) C2 Example 3: Simulate 50 observations on a Binomial random variable with n = 20 and p = 0.75. In HOME type: MAKELIST(Σ(I=1,20,RANDOM