Answered step by step
Verified Expert Solution
Question
1 Approved Answer
SHOW CODE FOR BOTH APPROACHES SHOW CODE Task 2: Generate 20,000 random numbers, each of which is a sum of X and Y. X follows
SHOW CODE FOR BOTH APPROACHES
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 -0.2 and -05; Y follows a normal distribution with -0.2 and -05. 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 top 10 rows and 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 "task2outputHW7_a.txt" and "task2outputHW7_b.txt", respectively. Add a screenshot (see below for a sample) to your notebook indicating that output text file is generated task2outputHW7 a - Notepad Eile Edit Format View Help 1.519 0.801 1.550 0.940 1.639 0.962 1.645 1.061 1.544 0.572 1.633 1.350 1.774 1.441 1.656 1.056 1.604 0.743 1.505 0.843 1.555 0.706 1.652 0.632 1.408 0.668 1.584 0.863 1.710 1.309 Extra credit (10%) (compare the computational efficiencies of two approaches.)Step 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