Q2 1. Modify the "sim.2()" function used in "Parallelization" mclapply() lecture. Save the modified function as "my.sim.
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Q2 1. Modify the "sim.2()" function used in "Parallelization" mclapply() lecture. Save the modified function as "my.sim.
Q2 1. Modify the "sim.2()" function used in "Parallelization" mclapply() lecture. Save the modified function as "my.sim.2()". Your "my.sim.2()" function has: o the mean value in the "rnorm()" function fixed at 20; o the first line in "my.sim.2()" function body set a seed number; o my.sim.2() function takes only one numeric value "my.seed" as input and will pass this value as input when you set seed. 2. Use multiple CPU cores to speed up the function "lapply(101:200, my.sim.2)" Report time consumption before VS after multiple core speed up.