homework4.Rmd: All answers to the questions, codes and results (figures, tables) should be included in this single file.
Generate the mathematical notations listed in https://www.calvin.edu/%7Erpruim/courses/s341/S17/from-class/MathinRmd.html.
Generate 100 random numbers from uniform distribution ranging from 0 to 10.
Generate 100 random numbers from normal distribution with mean 10 and standard deviation 2.
Coint toss simulation:
sample function. How many heads do you get? How many do you
expect to get?sample function in the loop.Dice rolling simulation:
sample function. Report the number
of times you see each side (using the table function).Based on the mtcars data frame,

pch=19). I expect to see something like the following
(colors don’t have to be exactly the same):

Put math expression in figures. Generate a figure for power
function
. Show
the curves for k=0.5, 1, 1.5 in the same figure. In the figure, You
should:
matplot function to draw multiple lines together.log="y" in the plot.The following codes will get you started. But you need to modify the
parameters in the matplot function.
x = 1:100
y1 = x^0.5
y2 = x^1
y3 = x^1.5
matplot(x, cbind(y1, y2, y3), type="l", lty=1, log="y", lwd=2)
I expect to see a figure like the following:

sample function for random sampling: https://www.gastonsanchez.com/packyourcode/intro.html.sample function for random sampling: https://www.gastonsanchez.com/packyourcode/intro.html.par function in R is
comprehensive. You might want to take a look ?par and play
with the examples.Review all contents for this week, especially the day 2 and 3 stuff. The simulation question in the homework might be a little complicated. Talk to me if necessary.