Algorithm Analysis for calculating MAV