cost function example problems