I am doing an assignment for my data class and new to R programming. If a fair 6-sided die is rolled, Let X be the number showing on the top of the die. (The first question is involved the R programming)
Generate 5 realizations from the distribution of X. Show the sample you generated and the sample mean, sample variance, and sample deviation
What is the expectation and the variance of the sample mean in first question?
I have written the code for the first assignment which I am confident that I am right:
S_R <- sample (1:6, 5, replace=TRUE)
print(S_R)
mean(S_R)
Var(S_R)
but I have one problem in the second question is that Every time when I concluded and knit to PDF, it is going to run as random so that the value will change no matter what. This is kinda hard for me to compute the expectation and variance of sample mean.