I guess you want to find the average speed for the whole journey
average speed = distance travelled / time
the distance from home to the shop = speed * time = 0.5*10 = 5 miles
time for travelling back = distance / speed = 5/30 = 1/6 hours
average speed for whole journey = 10 / (1/2 + 1/6) = 10 * 3 / 2 = 15 mph