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;).