Question
Part1) Random Variables - 25 points Consider a game which involves rolling three dice. Write the R code for the following. Using the rollDie function
Part1) Random Variables - 25 points Consider a game which involves rolling three dice. Write the R code for the following.
Using the rollDie function from the prob library, setup the sample space for this experiment with the probability space. For each of the following scenarios from a) through e), show the corresponding outcomes and the probability of that event. The sample outputs for b) are shown as example.
a) The sum of the rolls is greater than 6 but less than 10. b) All the three rolls are identical.
b) All the three rolls are identical. Sample Output for outcomes:
x1 x2 x3 probs
1. 1 1 1 0.00463
44 2 2 2 0.00463
87 3 3 3 0.00463
130 4 4 4 0.00463
173 5 5 5 0.00463
216 6 6 6 0.00463
Sample Output for probability:
[1] 0.02778
c) Only two of the three rolls are identical. d) None of the three rolls are identical. e) Only two of the three rolls are identical given that the sum of the rolls is greater than 9.
Part4) R - 30 points
Initialize the Dow Jones Industrials daily closing data, dow, using the read.csv function with the link: http://people.bu.edu/kalathur/datasets/DJI_2020.csv
The first 6 rows of the dataset are as shown below:
> head(dow)
Date. Close
1 1/2/20 28869
2 1/3/20 28635
3 1/6/20 28703
4 1/7/20 28584
5 1/8/20 28745
6 1/9/20 28957
Provide the simplest R code and output for all of the following. The code should work for any given data.
a) Store the result of the summary function for the Close attribute as the variable sm. Change the names of this variable so that the output appears as shown below.
>sm
Min Q1 Q2 Mean Q3 Max
18592. 23466 24826 25544 28862 29551
Using the above data, show the quartile variations for the 4 quartiles as shown below. You can use paste or sprintf.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started