DATA605: Assignment #6

Bonnie Cooper

6.1.6

A die is rolled twice. Let X denote the sum of the two numbers that turn up, and Y the difference of the numbers (specifically, the number on the first roll minus the number on the second). Show that E(XY ) = E(X)E(Y ). Are X and Y independent?

##   roll1 roll2 X Y XY
## 1     1     1 2 0  0
## 2     1     2 3 1  3
## 3     1     3 4 2  8
## 4     1     4 5 3 15
## 5     1     5 6 4 24
## 6     1     6 7 5 35

find the mean of the columns…

##     roll1     roll2         X         Y        XY 
##  3.500000  3.500000  7.000000  1.944444 13.611111

Does mean( XY ) == mean(X)*mean(Y)?

##   XY 
## TRUE

This shows that, yes, E(XY ) = E(X)E(Y )

The code below simulates this process and finds the values X, Y and XY

##   roll1 roll2  X Y XY
## 1     4     6 10 2 20
## 2     1     5  6 4 24
## 3     1     3  4 2  8
## 4     3     2  5 1  5
## 5     3     3  6 0  0
## 6     2     1  3 1  3

Now find the mean of the columns…

##   roll1   roll2       X       Y      XY 
##  3.4648  3.5096  6.9744  1.9468 13.5922

Does mean( XY ) == mean(X)*mean(Y)?

##      XY 
## 13.5922
##        X 
## 13.57776

…those simulated values look pretty close