Complete the following two parts Give two algorithms for gen

Complete the following two parts. Give two algorithms for generating a random variable having density function f(x) = 1/4 + 2x^3 +/4 x^4, 0

Solution

a)the algorithim is in c++

int main()

{ int x;

int sum=0;

int m,n;

int z;

if(x>=0&&x<=1)

{

z=1/4;

m=2*pow(x,3);

n=5/4*pow(x,4);

sum=sum+z+m+n;

 Complete the following two parts. Give two algorithms for generating a random variable having density function f(x) = 1/4 + 2x^3 +/4 x^4, 0 Solutiona)the algor

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site