Question 1   When using NTFS as a file system, … Read More...
1. R has built-in datasets. One such dataset is called trees. Run the following code to access that dataset: data(trees). 2. Use the head() command to see the first 6 observations. 3. How many observations and variables are in the dataset? 4. Use attach() so that you do not have to use two-level names to call the variables. 5. Find the mean, median, variance, standard deviation of each of the three variables, Height, Girth, and Volume using the individual commands (mean(), var(), etc.) 6. Use the command summary() to find the same basic summary as the individual commands. For syntax help, type ?summary for the help file. 7. Now use the stat.desc() command in the pastecs package for all three variables. 8. Create histograms and boxplots of all three variables (either separate or 3 per panel). Briefly describe the graphs. 9. Create a scatterplot (with points only) of Girth and Height, placing Girth on the x-axis and Height on the y-axis. Briefly describe the graph (the main things to mention is whether or not there appears to be an association and if there is, state whether positve or negative). 10. Read in the dataset from the class website called farmacres.csv. Use read.table(), read.csv() or use the Import Dataset options in the Environment Window. Call the dataset farm. 11. Use the histogram() command in the Lattice package to create a histogram of the acres by stratum. Briefly describe the distributions. 1

## 1. R has built-in datasets. One such dataset is called trees. Run the following code to access that dataset: data(trees). 2. Use the head() command to see the first 6 observations. 3. How many observations and variables are in the dataset? 4. Use attach() so that you do not have to use two-level names to call the variables. 5. Find the mean, median, variance, standard deviation of each of the three variables, Height, Girth, and Volume using the individual commands (mean(), var(), etc.) 6. Use the command summary() to find the same basic summary as the individual commands. For syntax help, type ?summary for the help file. 7. Now use the stat.desc() command in the pastecs package for all three variables. 8. Create histograms and boxplots of all three variables (either separate or 3 per panel). Briefly describe the graphs. 9. Create a scatterplot (with points only) of Girth and Height, placing Girth on the x-axis and Height on the y-axis. Briefly describe the graph (the main things to mention is whether or not there appears to be an association and if there is, state whether positve or negative). 10. Read in the dataset from the class website called farmacres.csv. Use read.table(), read.csv() or use the Import Dataset options in the Environment Window. Call the dataset farm. 11. Use the histogram() command in the Lattice package to create a histogram of the acres by stratum. Briefly describe the distributions. 1

0 2p 1 2 Figure 1: PlotCycloidArc(8.5) Math98 HW4 The cylcoid is the plane curve traced out by a point on a circle as the circle rolls without slipping on a straight line.1 In this exercise we will use MATLAB to create an animation of a circle rolling on a straight line, while a point on the circle traces the cycloid. a. Implement a MATLAB function of the form function PlotCycloidArc(ArcLength). This function takes in a positive number ArcLength and displays a snapshot of the cirle rolling (without slipping) on the x-axis while a point on the cirlce traces the cycloid. The circle is initially centered at (0,1) and has radius 1, and the initial tracing point is taken to be (0, 0). An example output is shown in the above figure. As in the figure, plot the cycloid arc black, the circle blue, and use a red dot for the tracing point. Hint: If the circle has rolled for a length of arc t  0, the coordinates of the tracing point are (t−sin t, 1−cos t). b. Implement a MATLAB function of the form function CycloidMovie(NumHumps,NumIntervals). This function will output an animation of the circle rolling along a line while a point on the circle traces the cycloid. This function inputs two natural numbers NumHumps and NumIntervals representing the number of periods (or humps) of the cycloid and the number or frames per hump that will be used to make the animation, respectively. Use the getframe command to save frames outputted from PlotCycloidArc and the movie command to play them back together as a movie. Use the axis command to view the frames on the rectan- gle [0, 2NumHumps] × [0, 5/2]. Also label the ticks 0, 2, . . . , 2NumHumps on the x axis with the strings 1See Wikipedia for more on the cycloid. 0, 2, . . . , 2NumHumps and do the same for 1, 2 on the y axis (see the figure above). Label the movie ’Cycloid Animation’. Submit MATLAB code for both parts a and b and a printout the figures obtained by the commands PlotCycloidArc(8.5), PlotCycloidArc(12), and CycloidMovie(3,10).

## 0 2p 1 2 Figure 1: PlotCycloidArc(8.5) Math98 HW4 The cylcoid is the plane curve traced out by a point on a circle as the circle rolls without slipping on a straight line.1 In this exercise we will use MATLAB to create an animation of a circle rolling on a straight line, while a point on the circle traces the cycloid. a. Implement a MATLAB function of the form function PlotCycloidArc(ArcLength). This function takes in a positive number ArcLength and displays a snapshot of the cirle rolling (without slipping) on the x-axis while a point on the cirlce traces the cycloid. The circle is initially centered at (0,1) and has radius 1, and the initial tracing point is taken to be (0, 0). An example output is shown in the above figure. As in the figure, plot the cycloid arc black, the circle blue, and use a red dot for the tracing point. Hint: If the circle has rolled for a length of arc t  0, the coordinates of the tracing point are (t−sin t, 1−cos t). b. Implement a MATLAB function of the form function CycloidMovie(NumHumps,NumIntervals). This function will output an animation of the circle rolling along a line while a point on the circle traces the cycloid. This function inputs two natural numbers NumHumps and NumIntervals representing the number of periods (or humps) of the cycloid and the number or frames per hump that will be used to make the animation, respectively. Use the getframe command to save frames outputted from PlotCycloidArc and the movie command to play them back together as a movie. Use the axis command to view the frames on the rectan- gle [0, 2NumHumps] × [0, 5/2]. Also label the ticks 0, 2, . . . , 2NumHumps on the x axis with the strings 1See Wikipedia for more on the cycloid. 0, 2, . . . , 2NumHumps and do the same for 1, 2 on the y axis (see the figure above). Label the movie ’Cycloid Animation’. Submit MATLAB code for both parts a and b and a printout the figures obtained by the commands PlotCycloidArc(8.5), PlotCycloidArc(12), and CycloidMovie(3,10).

info@checkyourstudy.com Operations Team Whatsapp( +91 9911743277)