Is there difference between a function in mathematics to a function in computer science? I never learned a lot of mathematics (generally only arithmetic) and never learned computer science in a formal frame.
I emphasize that I don't mean to ask about a &quot;function&quot; in programming (&quot;procedure&quot;/&quot;method&quot;), rather only about the difference between the formal definition of function in mathematics to the formal definition of function in (theoretical) computer science, if at all there is any such difference (unless computer science don't share the exact definition common in mathematics).
Is there difference between a function in mathematics to a function in computer science?
A function in mathematics is just a special case for a binary relation, where for every x there is exactly one y such that xRy is in the binary relation.
Computer science uses that term with the same meaning, as it uses lots of mathematical terms. It also uses the term &quot;function&quot; (or &quot;subroutine&quot;, &quot;procedure&quot;, &quot;method&quot;) with a totally different meaning of one component of a program in the area of computer programming.
Just like the word &quot;function&quot; would be used with a completely different meaning in patent law (functional vs. decorative components) architecture (a functional design), medicine or psychology (like a &quot;functional alcoholic&quot;).