Right answer is B
n= 10^6. (given)
-------------------------------------------------------------------------------------------------
insertion sort takes 10*n*n units of time for n instructions. (given)
=> insertion sort takes 10 * 10^6 * 10^6 units of time for 10^6 instructions.
=> insertion sort takes 10^13 units of time for 10^6 instructions.
=> insertion sort takes 10^7 units of time for 1 instruction.
=> 1 instruction in 10^7 units of time..................................................(i)
-------------------------------------------------------------------------------------------------
merge sort takes 100*n*log n units of time for n instructions (given)
=> merge sort takes 100*10^6*log 10^6 units of time for 10^6 instructions.
=> merge sort takes 10^8* 19.931 units of time for 1 instruction.
=> 1 instruction in 10^8* 19.931 units of time ....................................(ii)
--------------------------------------------------------------------------------------------------
A executes 10^10 instructions in 1 second (given)
=> 1 instruction in 1/10^10 second......................................................(iii)
-------------------------------------------------------------------------------------------------------
B executes 10^8 instructions in 1 second (given)
=> 1 instruction in 1/10^8 second........................................................(iv)
------------------------------------------------------------------------------------------------------
computer A runs insertion sort (given)
=> for 1 instruction resultant time will be = 1/10^10 * 10^7 ( from (i) and (iii) )
= 1000 second
-------------------------------------------------------------------------------------------------------
computer B runs merge sort.
=> for 1 instruction resultant time will be = 1/10^8 *10^8* 19.931 ( from (ii) and (iv) )
= 19.931 second
= 20 second (approx)
-------------------------------------------------------------------------------------------------------
speed of B/ speed of A
= time of A for 1 instruction / time of B for 1 instruction ( since speed is inversely proportional to time)
= 1000 sec / 20 sec
= 50
Hence, B is 50 times faster than A