Suppose you have 100 accesses. How many will hit primary memory? How many will hit secondary? What is the total time taken by (a) the primary accesses and (b) the secondary accesses? Add them up and divide by 100; that is the average.