In: Math
Find below the R code with comments. I assume that you are knowledgeable regarding the theory behind t-dictribution.
x=rnorm(1000) #generate 1000 random values
hist(x, main="1.2a Histogram of 1000 Random N(0,1) Values") #plot
histogram
x.grid=seq(-3,3,.01) # create vector of x values
v.sim=(rnorm(1000))^2 + (rnorm(1000))^2 +
(rnorm(1000))^2
t.sim = x / sqrt(v.sim/15) # t-distribution of the 1000 random
values with 15 degrees of freedom (formulae)
#plotting histogram of t-distribution
hist(t.sim,probability="TRUE", nclass=50,
main="4.2b Histogram of 1000 Random t(df=15) Values\n (density
scale)")
#Probability density graph
t.grid=seq(min(t.sim),max(t.sim),.01) #Create vector of x
values
density.t.grid=dt(t.grid,df=15) # Compute vector of corresponding
density values
lines(t.grid,density.t.grid,col='blue') # use R function lines() to
add to current plot
I hope this will give you the desired graph.