# Pseudocode def average_price(log): find the latest checkpoint X load total_price, item_count from X for each event in the log after X: update total_price, item_count avg_price = total_price / item_count return avg_price