In Write - Through Technique , every write operation to the CACHE is repeated to the main memory AT THE SAME TIME. That means cache write / update and memory write/ update is done paralley means both have done at the same time .
[when cache miss occurs before updating the main memory block, we need to first find that block in the memory , is it available or not . That's why need to add main memory access time in case of cache miss .] // ambiguous part, need not to consider due to practicality though in question it is given access time and writing/updating time separately
Update:
The question implicitly assumes that all the blocks required are contained within the main memory hence no need for extra search time . we no need to check whether a block exists or not because, if it doesn't exist then we have to go to secondary storage but that is not mentioned in the question .
As they mention " Consider a two level memory hierarchy " in the question itself .
Write-Through Technique use Write No Allocate Policy . Where the missed Main memory block is updated while residing in the main memory and not brought to the cache.
Now, H = hit rate in cache
Tc = cache access time
Tm = memory access time
memory update time = 30 ns
here H = 20% , Tc= 10 ns Tm = 20 ns
for this problem formula used is :
TAvg writing Time = H * T mem update time + ( 1 - H ) * ( T mem update time ) .
TAWT = 0.2 * 30 + 0.8 * ( 30 )
= 6 + 24
= 30
so answer is 30 ns.