Functions Question Properties

Is this statement true?

For all functions f f (a + b) = f (a) + f (b).

If so, why? If not, what are these special functions and what property do they have?

EDIT: Wow, I think the floor / clearing functions don't have the property.? I can think of counterexamples, but can anyone prove it. But what are the functions that contain this property?

0


a source to share


4 answers


You mentioned the function f for which:

f(a + b) = f(a) + f(b)

      



Such a function is called Homomorphism , and it can be defined on certain algebraic structures. In this case, + is a special binary function that maps a and b to an element of the same area.

Obviously, not all functions are homomorphisms, as others have already shown you.

+4


a source


In procedural programming, this is not true because arbitrary functions can have arbitrary side effects.



For example, you might have a global counter that increments each time you call f () and adds it to the return value.

0


a source


Is there a log (a + b) = log (a) + log (b)?

0


a source


No.

They are called linear if also f (k * a) = k * f (a).

In general, such a function is called a homomorphism, but this is not limited to addition.

0


a source







All Articles