Question: "use" used in the same way in the following two sentences?

I can't use this tool.

We can use this mathematical formula to solve the problem.
Answer: the same meaning
Question: "optimization" used in the same way in the following two sentences?

In an optimization problem we seek values of the variables that lead to an optimal value of the function that is to be optimized.

The simultaneous optimization of growth and profitability.
Answer: the same meaning
Question: "dozen" used in the same way in the following two sentences?

There shouldn't be more than two dozen Christmas cards left to write.

Can I have a dozen eggs, please?
Answer: the same meaning
Question: "visit" used in the same way in the following two sentences?

Did you ever visit Paris?

The principal visited his rage on the students.
Answer:
different meanings