Let T1=100 ns be the single-core baseline execution time.
Non-parallelizable (serial) portion: Tserial=10%×100 ns=10 ns
Parallelizable portion: Tparallel=90%×100 ns=90 ns
When using p cores, the number of additional cores used is (p−1).
The overhead for using (p−1) additional cores is (p−1)×10 ns.
The total execution time T(p) on p cores is:
T(p)=Tserial+pTparallel+10(p−1) T(p)=10+p90+10p−10=p90+10p Evaluating T(p) for integer values of p≥1:
For p=1: T(1)=190+10(1)=100 ns
For p=2: T(2)=290+10(2)=45+20=65 ns
For p=3: T(3)=390+10(3)=30+30=60 ns
For p=4: T(4)=490+10(4)=22.5+40=62.5 ns
For p=5: T(5)=590+10(5)=18+50=68 ns
The execution time is minimized when the number of cores p=3, giving T(3)=60 ns.
Thus, the number of cores that minimizes execution time is 3.