Question: [25 marks] Libraries for random number generators may only generate uniformly dis- tributed random numbers. Two methods for converting uniformly distributed random numbers to normally

 [25 marks] Libraries for random number generators may only generate uniformly

[25 marks] Libraries for random number generators may only generate uniformly dis- tributed random numbers. Two methods for converting uniformly distributed random numbers to normally distributed random numbers are the Box-Muller method and the polar Marsiglia method. Let uy and uz be two independent random numbers drawn from a uniform distribution on [0,1]. In the Box-Muller method, uj and u2 are converted to two normally distributed num- bers ni and n2 via n = 1-2 ln u, cos(2nu2), n = V-2 ln u sin(2nu2). In the polar Marsiglia method, we compute V = 2u1 - 1, V2 = 2u2 1, w = v + oz. If w > 1, discard the result and try again. Otherwise, set -2 In w -11, -2 In w n2 = V2.02. Write a program that takes an integer N and floating-point numbers A and B generates an array of size N with values that have a Gaussian distribution with mean A and variance B. Which algorithm would be preferred on a distributed architecture? Which algorithm would be preferred on a GPU architecture? [25 marks] Libraries for random number generators may only generate uniformly dis- tributed random numbers. Two methods for converting uniformly distributed random numbers to normally distributed random numbers are the Box-Muller method and the polar Marsiglia method. Let uy and uz be two independent random numbers drawn from a uniform distribution on [0,1]. In the Box-Muller method, uj and u2 are converted to two normally distributed num- bers ni and n2 via n = 1-2 ln u, cos(2nu2), n = V-2 ln u sin(2nu2). In the polar Marsiglia method, we compute V = 2u1 - 1, V2 = 2u2 1, w = v + oz. If w > 1, discard the result and try again. Otherwise, set -2 In w -11, -2 In w n2 = V2.02. Write a program that takes an integer N and floating-point numbers A and B generates an array of size N with values that have a Gaussian distribution with mean A and variance B. Which algorithm would be preferred on a distributed architecture? Which algorithm would be preferred on a GPU architecture

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!