curve(dt(x, df = 1), xlim = c(-4, 4))
set.seed(123)
# generate 1000 random numbers from the given distribution. Assign them to the variable x.
# compute the sample mean of x.
set.seed(123)
# generate 1000 random numbers from the given distribution. Assign them to the variable x.
x <- rt(1000, df = 1)
# compute the sample mean of x.
mean(x)
# Although a t distribution with M = 1 is, as every other t distribution, symmetric around zero it actually has no expectation. This explains the highly non-zero value for the sample mean.
test_object("x")
test_function_result("mean")
success_msg("Well done! The expectation is not defined for a t distributed RV with one degree of freedom: although a t distribution with M = 1 is, as every other t distribution, symmetric around zero it actually has no expectation. This explains the non-zero value of the sample mean.")