(Solved) : 25 Marks Libraries Random Number Generators May Generate Uniformly Dis Tributed Random Num Q44033483 . . .
![[25 marks] Libraries for random number generators may only generate uniformly dis- tributed random numbers. Two methods for c](https://media.cheggcdn.com/media/16c/16c9ce2f-ae18-4f57-bf43-249dca1dee8b/phpRYmd6n.png)
[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? Show transcribed image text [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?
Expert Answer
Answer to [25 marks] Libraries for random number generators may only generate uniformly dis- tributed random numbers. Two methods …
OR