This is student work which has not yet been approved as correct by the instructor
The cost function can be used to find the Mathematical Optimisation for something to use as little resources as possible to be more efficient.
Devote time and attention to gaining knowledge of (an academic subject), especially by means of books