Final answer:
The fraction of foo() that was parallelized is 60%.
Step-by-step explanation:
The fraction of foo() that was parallelized can be determined by comparing the time it took to complete foo() with a single core to the time it took with four cores.
Using the information provided, when foo() is executed with a single core, it takes 20 minutes.
When it is executed with four cores, it takes 8 minutes. This means that the parallelization speedup is :
20/8 = 2.5.
Therefore, the fraction of foo() that was parallelized is:
1 - (1/2.5)
= 0.6, or 60%.