). Compute the approximate value for Cov(2m,e
m
) using the simulation method. Compare your results between the exact and simulated values. b) [6 Marks] Compute the exact value of the integral η=∫
1
5
y
2
e
y
dy. Estimate the integral using the Monte Carlo (MC) integration method with a sample size of (n=1000). Determine the approximate percentage error (ϵ) between the exact value and the MC value. c) [8 Marks] Use the code to answer questions that follow: s 3336 <- function (N,×0,a,c,m){ pseudo <- rep(0,N) pseudo [1] <- <0 for (i in 2:(N+1)) pseudo[i] < (a∗ pseudo [i−1]+c)% pseudou <- pseudo/m return (pseudou) \} Explain the two pseudorandom number generation (PNG) methods, and identify the one used in the R code. Suppose (a=11,c=56,x
0
=13m=15) use the PNG to generate 30 pseudorandom numbers. Test the hypothesis that the generated numbers are uniformly distributed.
Answer:
Step-by-step explanation:
To determine the exact value of the covariance expression Cov(2m, em), we need more information about the variables involved. The covariance between two random variables, X and Y, is calculated as the expected value of the product of the differences between each variable and their respective means. Without the means or additional information, we cannot calculate the exact value of the covariance.
For the simulation method, we can generate random samples for 2m and em, calculate their covariance, and repeat the process multiple times to estimate an approximate value for Cov(2m, em). The simulated value will depend on the specific values generated for 2m and em in each iteration.
b) To compute the exact value of the integral η = ∫1^5 y^2 e^y dy, we can use integration techniques such as integration by parts or substitution. However, without further information or specific instructions, it is not possible to determine the exact value of this integral.
To estimate the integral using the Monte Carlo (MC) integration method, we can generate random points within the interval [1, 5] and evaluate the function y^2 e^y at those points. The estimate is then obtained by taking the average of these function values and multiplying it by the interval length (5 - 1). Using a sample size of n = 1000 means generating 1000 random points.
To calculate the approximate percentage error (ϵ) between the exact value and the MC value, you would need to know the exact value of the integral, which is not provided in the question.
c) The given code represents a pseudorandom number generation (PNG) method. It generates pseudorandom numbers using a linear congruential generator (LCG) algorithm. The LCG algorithm is a simple and widely used method for generating pseudorandom numbers based on a linear recurrence relation.
The LCG algorithm is defined by the recurrence relation:
X(n+1) = (a * X(n) + c) mod m
In the code, the values a = 11, c = 56, x0 = 13, and m = 15 are used as parameters for the LCG algorithm. It generates 30 pseudorandom numbers by iterating the recurrence relation.
To test the hypothesis that the generated numbers are uniformly distributed, you can perform a statistical test, such as the chi-square test or the Kolmogorov-Smirnov test. These tests compare the distribution of the generated numbers to a uniform distribution.
A. x²
B. 26x²
C. 2x^4
D. 2x²
10
20
Total Cost
$17.50
$35.00
$52.50
$70.00
30
40
$3.50
$1.75
$17.50
$7.25
===================================================
Explanation:
To get the unit cost, we divide the total cost over the number of pounds.
We can do this for any row
You don't need to show all four row calculations. You can simply pick one row.
This tells us that each pound costs $1.75
Put another way: the price is $1.75 per pound