Question

Let Y ∼ Unif(1, 5) R1. Write code in R that will simulate the setup in...

Let Y ∼ Unif(1, 5)

R1. Write code in R that will simulate the setup in question 3a, and hence, allow you to roughly check your answer.

3a. If you generate 5 random numbers based on Y , what is the probability you’ll get more (numbers greater than 4) than (numbers less than or equal to 4)?

R2. Write code in R that will simulate the setup in question 3b, and hence, allow you to roughly check your answer.

3b. If you take lots of random values for Y and plug them into the polynomial h(x) = (2x−1)(x+3), what value would you get out of the polynomial on average?

Homework Answers

Answer #1

THE CODE AND EXPLANATION IS GIVEN

NOTE:: I HOPE THIS ANSWER IS HELPFUL TO YOU...*** PLEASE SUPPORT ME WITH YOUR RATING..THANK YOU

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
3. Let Y ∼ Unif(1, 5). (See questions R1 and R2.) a. If you generate 5...
3. Let Y ∼ Unif(1, 5). (See questions R1 and R2.) a. If you generate 5 random numbers based on Y , what is the probability you’ll get more (numbers greater than 4) than (numbers less than or equal to 4)? b. If you take lots of random values for Y and plug them into the polynomial h(x) = (2x−1)(x+3), what value would you get out of the polynomial on average?
Write an R code that does the following: (a) Generate n samples x from a random...
Write an R code that does the following: (a) Generate n samples x from a random variable X that has a uniform density on [0,3]. Now generate samples of Y using the equation: y = α/(x + β). For starters, set α = 1, β = 1 The R code: x=runif(n=1000, min = 0, max = 3) x y=1/x+1 y Please answer the following: b) Use plot(x,y) to check if you got the right curve. c) How does the correlation...
Language: Python Write a program to simulate an experiment of tossing a fair coin 16 times...
Language: Python Write a program to simulate an experiment of tossing a fair coin 16 times and counting the number of heads. Repeat this experiment 10**5 times to obtain the number of heads for every 16 tosses; save the number of heads in a vector of size 10**5 (call it headCounts). You should be able to do this in 1-3 lines of numpy code. (Use np.random.uniform1 to generate a 2d array of 10**5 x 16 random numbers between 0 and...
R Code Directions: All work has to be your own, you may not work in groups....
R Code Directions: All work has to be your own, you may not work in groups. Show all work. Submit your solutions in a pdf document on Moodle. Include your R code (which must be commented and properly indented) in the pdf file. Name this pdf file ‘your last name’-HW5.pdf. Also submit one text file with your R code, which must be commented and properly indented. You may only use ‘runif’ to generate random numbers; other random number generating functions...
Use R to do each of the following. Use R code instructions that are as general...
Use R to do each of the following. Use R code instructions that are as general as possible, and also as efficient as possible. Use the Quick-R website for help on finding commands. 1. Enter the following values into a data vector named Dat: 45.4 44.2 36.8 35.1 39.0 60.0 47.4 41.1 45.8 35.6 2. Calculate the difference between the 2nd and 7th entries of this vector using only reference indices. 3. Calculate the median of Dat. 4. Sort the...
write a code in python Write the following functions below based on their comments. Note Pass...
write a code in python Write the following functions below based on their comments. Note Pass is a key word you can use to have a function the does not do anything. You are only allowed to use what was discussed in the lectures, labs and assignments, and there is no need to import any libraries. #!/usr/bin/python3 #(1 Mark) This function will take in a string of digits and check to see if all the digits in the string are...
##4. What will the following program display? ##def main(): ## x = 1 ## y =...
##4. What will the following program display? ##def main(): ## x = 1 ## y = 3.4 ## print(x, y) ## first printing ## change_us(x, y) ## print(x, y) ##second printing ## ##def change_us(a, b): ## a = 0 ## b = 0 ## print(a, b) ## ##main() ## ##Yes, yes, main() displays ##1 3.4 ##0 0 ##1 3.4 ## The question is: why x and y are still the same while the second printing of (x,y)? ## It seems...
R Code Directions: All work has to be your own, you may not work in groups....
R Code Directions: All work has to be your own, you may not work in groups. Show all work. Submit your solutions in a pdf document on Moodle. Include your R code (which must be commented and properly indented) in the pdf file. Name this pdf file ‘your last name’-HW5.pdf. Also submit one text file with your R code, which must be commented and properly indented. You may only use ‘runif’ to generate random numbers; other random number generating functions...
Question (2) [5 marks] (Use R) Suppose you have a company producing cupcakes. Each cupcake is...
Question (2) [5 marks] (Use R) Suppose you have a company producing cupcakes. Each cupcake is supposed to contain 10 grams of sugar. The cupcakes are produced by a machine that adds the sugar in a bowl before mixing everything. You believe the machine does not add 10 grams of sugar for each cupcake. If your assumption is true, the machine needs to be fixed. You stored the level of sugar of thirty cupcakes. Note: You can create a randomized...
Question 5 0/1 point (graded) The following is the full path to a homework assignment file...
Question 5 0/1 point (graded) The following is the full path to a homework assignment file called "assignment.txt": /Users/student/Documents/projects/homeworks/assignment.txt. Which line of code will allow you to move the assignment.txt file from the “homeworks” directory into the parent directory “projects”? mv assignment.txt mv assignment.txt . mv assignment.txt .. mv assignment.txt /projects incorrect Answer Incorrect: Try again. This code does not provide enough information about where to move the file. You need to specify a relative or full path to the...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT