Question: Write a python program. Generate 2 0 , 0 0 0 random numbers, each of which is a sum of X and Y . X

Write a python program.
Generate 20,000 random numbers, each of which is a sum of X and Y. X follows a log-normal distribution with parameters \mu =0.2 and \sigma =0.5; Y follows a normal distribution with \mu =0.2 and \sigma =0.5. Once random numbers are generated, compute the mean and variance.
Repeat this process for 1000 times and record all results in an array. Save only the first 10 rows and the last 5 rows to a text file.
You are required to complete this task using TWO approaches: (a) without for-loops and (b) with for-loops. Name those two files as task2outputHW6_a.txt and task2outputHW6_b.txt, respectively. Add a screenshot (see below for a sample) to your notebook indicating that output text file is generated.
Additional: (compare the computational efficiencies of two approaches.)
 Write a python program. Generate 20,000 random numbers, each of which

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!