Function: Difference between revisions

From Objective Mathematics
Jump to navigation Jump to search
No edit summary
Line 23: Line 23:
|}
|}
That table describes the input and output of an XOR gate. A XOR gate (another example of something that performs a function) can be seen in figure (1).  
That table describes the input and output of an XOR gate. A XOR gate (another example of something that performs a function) can be seen in figure (1).  
The following lines of C++ code perform a function:
The following lines of C++ code perform a function:
[[File:Bernegger Manuale 136.jpg|thumb|Figure (2): A 1619 book of mathematical tables by Matthias Bernegger, showing some of the sine, tangent, and secant functions. ]]
[[File:Bernegger Manuale 136.jpg|thumb|Figure (2): A 1619 book of mathematical tables by Matthias Bernegger, showing some of the sine, tangent, and secant functions. ]]
Line 44: Line 45:


== The traditional concept ==
== The traditional concept ==
In standard mathematics, a function always converts elements of a set <math>X</math> into elements of a set <math>Y</math>. The sets could be [[Sets#Infinite sets|infinite]], so the function doesn't have to describe a real process. In fact, though standard mathematicians usually think about functions ''as if'' they were processes, standard mathematics technically doesn't define functions as processes at all. Rather, it defines a function from <math>X</math> to <math>Y</math> as a subset of <math>X \times Y</math> satisfying certain conditions.<ref group="note">Namely, for each <math>x \in X</math>, the subset of <math>X \times Y</math> must contain one and only one tuple whose first argument is <math>x</math>.</ref>
In standard mathematics, a function always converts elements of a set <math>X</math> into elements of a set <math>Y</math>. The sets could be [[Sets#Infinite sets|infinite]], so the function doesn't have to describe a real process. In fact, though standard mathematicians usually think about functions ''as if'' they were processes, standard mathematics technically doesn't define functions as processes at all. Rather, it defines a function from <math>X</math> to <math>Y</math> as a subset of <math>X \times Y</math> satisfying certain conditions.<ref group="note">Namely, for each <math>x \in X</math>, the subset of <math>X \times Y</math> must contain one and only one tuple whose first argument is <math>x</math>.</ref> This sharp disconnect between formal mathematical jargon, and the intuition applicable to real life, is part of what Objective Mathematics seeks to avoid. [TODO rewrite last sentence]
 
Standard mathematicians usually prefer not to consider things like "the set of all strings containing less than ''n'' characters," where ''n'' is the number of bytes of free RAM available on some computer. Instead, standard mathematicians usually prefer to consider things like "the set of all strings." The reason for this is clear enough: the latter is much more elegant and simple than the former. The problem with the latter, though, is that it is completely disconnected from reality. There is no such thing as a function from the set of all strings to the set of all strings, since everything that exists is delimited and finite. For example, in the [[Function#Examples|examples section §]], Objective Mathematics made the identification that <math>r : \text{String} \rightarrow \text{String} </math>, where <math>r</math> is the <code>reverseString</code> function and <math>\text{String}</math> denotes the ''[[concept]]'' of a string,<ref group="note">C++, being a practical language, basically says the same thing as Objective Mathematics; it's just a bit more specific. It says that the [[Type theory|type]] of <code>reverseString</code> is that of a (C++) function from <code>std::string</code> to <code>std::string</code>. </ref> but standard mathematics ''cannot'' identify <code>reverseString</code> as a function from "the set of all strings" to "the set of all strings", since there are limits on how big its input and output could be.
 
In conclusion, standard mathematicians are forced to make an impossible choice. Do we work with nice, clean mathematical objects and be disconnected from reality, or do we keep our connection with reality and suffer through nasty, non-conceptual messes?


A function doesn't have to describe a real process, bec
[TODO I think this is a bad example, and I also am not sure if it belongs in this article.]


== Notes ==
== Notes ==


<references group="note" />
<references group="note" />

Revision as of 05:34, 20 January 2024

A function is a process that converts units of one mathematical notion into units of another.

The notation is shorthand for the following statement: and are some mathematical notions, is a function converting an into a .

Examples

Figure (1): Redstone XOR gate in Minecraft

Functions

The following table encodes a function:

f(x)
x (0,0) (1,0) (0,1) (1,1)
f(x) 0 1 1 0

That table describes the input and output of an XOR gate. A XOR gate (another example of something that performs a function) can be seen in figure (1).

The following lines of C++ code perform a function:

Figure (2): A 1619 book of mathematical tables by Matthias Bernegger, showing some of the sine, tangent, and secant functions.
string reverseString(const string &s) { 
  string returnStr = ""; 
  for (int i = s.size() - 1; i >= 0; --i) { 
    returnStr.append(s[i]);
  }
  return returnStr;
}

A sequence is a function.

A table describing several trigonometric functions is shown in figure (2).

A graph can describe a function: it provides instructions for producing outputs from inputs.

The method that an elementary schooler learns for carrying out long division is a function.

Non-functions

A coffee machine is not a function. It carries out a process; it takes some inputs (energy, water, coffee grounds, paper filter) and converts them into coffee. But the inputs and outputs are not mathematical notions.

The traditional concept

In standard mathematics, a function always converts elements of a set into elements of a set . The sets could be infinite, so the function doesn't have to describe a real process. In fact, though standard mathematicians usually think about functions as if they were processes, standard mathematics technically doesn't define functions as processes at all. Rather, it defines a function from to as a subset of satisfying certain conditions.[note 1] This sharp disconnect between formal mathematical jargon, and the intuition applicable to real life, is part of what Objective Mathematics seeks to avoid. [TODO rewrite last sentence]

Standard mathematicians usually prefer not to consider things like "the set of all strings containing less than n characters," where n is the number of bytes of free RAM available on some computer. Instead, standard mathematicians usually prefer to consider things like "the set of all strings." The reason for this is clear enough: the latter is much more elegant and simple than the former. The problem with the latter, though, is that it is completely disconnected from reality. There is no such thing as a function from the set of all strings to the set of all strings, since everything that exists is delimited and finite. For example, in the examples section §, Objective Mathematics made the identification that , where is the reverseString function and denotes the concept of a string,[note 2] but standard mathematics cannot identify reverseString as a function from "the set of all strings" to "the set of all strings", since there are limits on how big its input and output could be.

In conclusion, standard mathematicians are forced to make an impossible choice. Do we work with nice, clean mathematical objects and be disconnected from reality, or do we keep our connection with reality and suffer through nasty, non-conceptual messes?

[TODO I think this is a bad example, and I also am not sure if it belongs in this article.]

Notes

  1. Namely, for each , the subset of must contain one and only one tuple whose first argument is .
  2. C++, being a practical language, basically says the same thing as Objective Mathematics; it's just a bit more specific. It says that the type of reverseString is that of a (C++) function from std::string to std::string.