An action performed by a device, department, or person that produces a result. Function remains more or less fixed whereas the purpose (which indicates intention or objective) generally changes. For example, the function of a hammer is to strike something nearby whereas its purpose (what to strike and why) could be anything the hammer-wielder has in mind.