Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python program show code Task 2: Generate 20,000 random numbers, each of which is a sum of X and Y. X follows a log-normal distribution
Python program
show code
Task 2: Generate 20,000 random numbers, each of which is a sum of X and Y. X follows a log-normal distribution with parameters u = 0.2 and 0 =0.5; Y follows a normal distribution with j = 0.2 and o =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. distribution with parameters u = 0.2 and 0 =0.5; Y follows a normal distribution with u = 0.2 and o =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. task2outputHW7_a - Notepad File Edit Format View Help 1.579 0.773 1.589 0.808 1.577 0.811 1.592 0.803 1.583 0.806 1.593 0.806 1.576 0.780 1.579 0.777 1.583 0.790 1.585 0.794 1.591 0.789 1.582 0.777 1.584 0.790 1.583 0.782 1.598 0.825Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started