Answer:
Part a: For optimal 4-way merging, initiate with one dummy run of size 0 and merge this with the 3 smallest runs. Than merge the result to the remaining 3 runs to get a merged run of length 6000 records.
Part b: The optimal 4-way merging takes about 249 seconds.
Step-by-step explanation:
The complete question is missing while searching for the question online, a similar question is found which is solved as below:
Part a
For optimal 4-way merging, we need one dummy run with size 0.
- Merge 4 runs with size 0, 500, 800, and 1000 to produce a run with a run length of 2300. The new run length is calculated as follows
![L_(mrg)=L_0+L_1+L_2+L_3=0+500+800+1000=2300](https://img.qammunity.org/2021/formulas/computers-and-technology/college/zqgox4isugw6czcrxub7h0wxdxu23tjozz.png)
- Merge the run as made in step 1 with the remaining 3 runs bearing length 1000, 1200, 1500. The merged run length is 6000 and is calculated as follows
![L_(merged)=L_(mrg)+L_4+L_5+L_6=2300+1000+1200+1500=6000](https://img.qammunity.org/2021/formulas/computers-and-technology/college/3b0tsz30x6nuxqvzg1jqpdbt3mzj6pocgb.png)
The resulting run has length 6000 records.
Part b
For step 1
Input Output Time
Input Output Time is given as
![T_(I.O)=(L_(run))/(Size_(block)) * Time_(I/O \, per\, block)](https://img.qammunity.org/2021/formulas/computers-and-technology/college/mruwfct4cysm8bohv5ybx98aehlhdamsp8.png)
Here
- L_run is 2300 for step 01
- Size_block is 100 as given
- Time_{I/O per block} is 2 sec
So
![T_(I.O)=(L_(run))/(Size_(block)) * Time_(I/O \, per\, block)\\T_(I.O)=(2300)/(100) * 2 sec\\T_(I.O)=46 sec](https://img.qammunity.org/2021/formulas/computers-and-technology/college/qu2v60f7eczglfq9srvqj60yencgmzfxnc.png)
So the input/output time is 46 seconds for step 01.
CPU Time
CPU Time is given as
![T_(CPU)=(L_(run))/(Size_(block)) * Time_(CPU \, per\, block)](https://img.qammunity.org/2021/formulas/computers-and-technology/college/lxdyxvirit2drt1rvq4icidx1amq2p24qs.png)
Here
- L_run is 2300 for step 01
- Size_block is 100 as given
- Time_{CPU per block} is 1 sec
So
![T_(CPU)=(L_(run))/(Size_(block)) * Time_(CPU \, per\, block)\\T_(CPU)=(2300)/(100) * 1 sec\\T_(CPU)=23 sec](https://img.qammunity.org/2021/formulas/computers-and-technology/college/la2ik0idtfh3b76tmgvvvkirsxwlblstpt.png)
So the CPU time is 23 seconds for step 01.
Total time in step 01
![T_(step-01)=T_(I.O)+T_(CPU)\\T_(step-01)=46+23\\T_(step-01)=69 sec\\](https://img.qammunity.org/2021/formulas/computers-and-technology/college/ljef1rtsijdnrolmonr2amdih6x73k9my8.png)
Total time in step 01 is 69 seconds.
For step 2
Input Output Time
Input Output Time is given as
![T_(I.O)=(L_(run))/(Size_(block)) * Time_(I/O \, per\, block)](https://img.qammunity.org/2021/formulas/computers-and-technology/college/mruwfct4cysm8bohv5ybx98aehlhdamsp8.png)
Here
- L_run is 6000 for step 02
- Size_block is 100 as given
- Time_{I/O per block} is 2 sec
So
![T_(I.O)=(L_(run))/(Size_(block)) * Time_(I/O \, per\, block)\\T_(I.O)=(6000)/(100) * 2 sec\\T_(I.O)=120 sec](https://img.qammunity.org/2021/formulas/computers-and-technology/college/fli2k018ef3ei79z8d5hq30d9176k3vf2i.png)
So the input/output time is 120 seconds for step 02.
CPU Time
CPU Time is given as
![T_(CPU)=(L_(run))/(Size_(block)) * Time_(CPU \, per\, block)](https://img.qammunity.org/2021/formulas/computers-and-technology/college/lxdyxvirit2drt1rvq4icidx1amq2p24qs.png)
Here
- L_run is 6000 for step 02
- Size_block is 100 as given
- Time_{CPU per block} is 1 sec
So
![T_(CPU)=(L_(run))/(Size_(block)) * Time_(CPU \, per\, block)\\T_(CPU)=(6000)/(100) * 1 sec\\T_(CPU)=60 sec](https://img.qammunity.org/2021/formulas/computers-and-technology/college/i00tyg5y6ng91se8rb56n9uzh9qiy8i9jr.png)
So the CPU time is 60 seconds for step 02.
Total time in step 02
![T_(step-02)=T_(I.O)+T_(CPU)\\T_(step-02)=120+60\\T_(step-02)=180 sec\\](https://img.qammunity.org/2021/formulas/computers-and-technology/college/4zaygydfh3n7wtu89ubg8vwmh2yakdb2m6.png)
Total time in step 02 is 180 seconds
Merging Time (Total)
Now the total time for merging is given as
![T_(merge)=T_(step-01)+T_(step-02)\\T_(merge)=69+180\\T_(merge)=249 sec\\](https://img.qammunity.org/2021/formulas/computers-and-technology/college/qink4udg9hyltyw0yjzik3o6ze8b4c6a9t.png)
Total time in merging is 249 seconds seconds