8
$\begingroup$

In English, we read and write from left to right, but for some reason we apply functions in the opposite order. Consider the following procedure:

Take an element $x$, apply a function $f$ to it and then apply a function $g$ to the result.

The formula we would write for this is $g(f(x))$, which is in some sense the wrong way around, it would be more consistent to write $((x)f)g$. (I have to admit that I had some trouble formatting that, but that's presumably because I'm used to do it the other way around.) This would not only be consistent with the way we write, but also with the notation using arrows, i.e. \begin{equation} X \overset{f}{\rightarrow} Y \overset{g}{\rightarrow} Z \end{equation}

What is the reason for this apparent inconsistency?

I could imagine the reason to be either historical or logical, or both, and I would be interested in either explanation.


I wasn't sure how to tag this, so feel fry to add any appropriate tags.

$\endgroup$
  • 1
    $\begingroup$ Take an element 𝑥, apply a function 𝑓 to it and then apply a function 𝑔 to the result. This is said g of f of x. $\endgroup$ – Jorge Fernández Hidalgo Mar 28 at 21:37
  • 1
    $\begingroup$ This question might be a good fit for HSM.se. $\endgroup$ – J.G. Mar 28 at 21:38
  • 1
    $\begingroup$ It's habit, nothing more. In his textbook on algebra, Paul Cohn makes an heroic effort to write $xf$ in place of $f(x)$. $\endgroup$ – Lord Shark the Unknown Mar 28 at 21:38
  • $\begingroup$ In category theory, the notation $(x)fg$ is used (and it's indeed more clear than $g(f(x))$ that can be very confusing at some point). $\endgroup$ – user657324 Mar 28 at 21:41
  • 1
    $\begingroup$ @JorgeFernándezHidalgo: you are right but that's just a habit. We could equally well say $x$ transformed by $f$ then $g$ (which is exactly what I do say if I am choosing to write functions on the right). $\endgroup$ – Rob Arthan Mar 28 at 21:44
5
$\begingroup$

The origin of $f(x)$ in Euler 1734, and Euler's frequent use of $fx$ (which he learned from his teacher, Johann Bernoulli) and $f:x$, have been discussed here before. I'm not sure of their motives (although my guess would be $f$ of $x$ is a more natural choice for pronunciation than $x$'s $f$), but they were prolific enough to be among the most influential mathematicians when it comes to notational conventions.

Because after all, all we have is a notational convention. As if to make things more confusing, some operations are represented to the right, e.g $x$ squared is $x^2$ rather than, say, $\operatorname{sq}x$ or $\operatorname{pow}_2 x$.

$\endgroup$
  • $\begingroup$ Although this answer does not give a reason as to why the notation $f(x)$ was picked instead of $x(f)$, this answer gives what seems to me as close as we are likely to get, so I'll probably accept it soon if no other answer comes along. $\endgroup$ – Peter Mar 29 at 0:52
0
$\begingroup$

We say "$f$ of $x$" and "$g$ of $f$ of $x$", so "reading from right to left" can be recast here as "applying functions from the left", which is consistent with natural language.

$\endgroup$
  • $\begingroup$ I'm not convinced that it isn't the other way around, that we say "$f$ of $x$" because we write $f(x)$. Maybe if we would write $x(f)$ we would say "$x$ in $f$". (I'm not saying you're wrong, just that I don't see any supporting evidence for the statement that natural language informed notation instead of the other way around.) $\endgroup$ – Peter Mar 29 at 0:49
  • 1
    $\begingroup$ @Peter Let's consider "$\sin$ of $x$" as an example, which sounds like a property of an angle; and it is one, and a very important one at that. We miss this important way of thinking about it if we say "$x$ in $\sin$", which has the added drawback of sounding like a membership comment. We wouldn't want to confuse a function value (a codomain element) with the function with a domain element. $\endgroup$ – J.G. Mar 29 at 6:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.