Mastering The Average Cost Function: Your Ultimate Guide