# Difference between revisions of "Examples in mathematics"

(→Unit testing and examples) |
|||

(4 intermediate revisions by the same user not shown) | |||

Line 1: | Line 1: | ||

− | '''Examples in mathematics''' have different flavor than examples in other disciplines. This is probably because [[definitions in mathematics]] are different from definitions in other disciplines (mathematical definitions are exact). Some [https://www.readthesequences.com/The-Cluster-Structure-Of-Thingspace common] [https://wiki.lesswrong.com/wiki/How_an_algorithm_feels problems] of deciding whether something is or is not an example do not appear in mathematics. Instead, there are other problems. | + | '''Examples in mathematics''' have a different flavor than examples in other disciplines. This is probably because [[definitions in mathematics]] are different from definitions in other disciplines (mathematical definitions are exact). Some [https://www.readthesequences.com/The-Cluster-Structure-Of-Thingspace common] [https://wiki.lesswrong.com/wiki/How_an_algorithm_feels problems] of deciding whether something is or is not an example do not appear in mathematics. Instead, there are other problems. |

==Unit testing and examples== | ==Unit testing and examples== | ||

Line 12: | Line 12: | ||

There is a tendency in human thinking to leave ideas merely at the verbal level, i.e. at a level where the ideas don't constrain anticipation.<ref>https://www.readthesequences.com/A-Technical-Explanation-Of-Technical-Explanation</ref> Giving surprising examples and non-examples is one way to catch people's fuzzy thinking and to correct them. | There is a tendency in human thinking to leave ideas merely at the verbal level, i.e. at a level where the ideas don't constrain anticipation.<ref>https://www.readthesequences.com/A-Technical-Explanation-Of-Technical-Explanation</ref> Giving surprising examples and non-examples is one way to catch people's fuzzy thinking and to correct them. | ||

+ | |||

+ | (I think there's an analogy to overfitting that would be good to explain.) | ||

{| class="wikitable" | {| class="wikitable" | ||

Line 20: | Line 22: | ||

|- | |- | ||

! Is an example according to intuition | ! Is an example according to intuition | ||

− | | An "obvious" example, or central example | + | | An "obvious" example, or central example. |

− | | A surprising non-example. | + | | A surprising non-example. False positives, also known as type I errors. |

|- | |- | ||

! Is not an example according to intuition | ! Is not an example according to intuition | ||

− | | A surprising example. | + | | A surprising example. False negatives, also known as type II errors. |

− | | An obvious non- | + | | An obvious non-example. |

|} | |} | ||

+ | |||

+ | ===Obvious examples=== | ||

+ | |||

+ | An "obvious" example, or central example. | ||

+ | |||

+ | Let <math>f : \mathbf R \to \mathbf R</math> be defined by <math>f(x) = 2x^2 - 3x + 5</math>. This does define a function, and someone who thought that a function is "something that is defined by a formula" would think that this is a function. | ||

+ | |||

+ | ===Surprising non-examples=== | ||

+ | |||

+ | A surprising non-example. Let <math>f : \mathbf Q \to \mathbf Z</math> be defined by <math>f(a/b) = a</math> (i.e. a function that outputs the numerator of a fraction). This does ''not'' define a function. To see this, note that <math>f(1/2) = 1</math> and <math>f(3/6) = 3</math>. But <math>1/2=3/6</math> so we must have <math>f(1/2)=f(3/6)</math> (a function must output a unique object for any given object), but <math>1\ne3</math>, so something has gone wrong. It turns out that each fraction has many different representations, and the idea of taking "the" numerator does not make sense, unless we constrain the representation somehow (e.g. by reducing the fraction and always putting any minus sign in the numerator). Someone who thought that a function is "something that is defined by a formula" might mistakenly think "this thing is defined by a formula, so must be a function". | ||

+ | |||

+ | As another example, let <math>f : A \to \emptyset</math> be a function where <math>A \ne \emptyset</math>. This does ''not'' define a function. To see this, note that since <math>A\ne \emptyset</math>, we must have some <math>a \in A</math>. By the definition of function, we would have <math>f(a) \in \emptyset</math>, which is a contradiction since <math>\emptyset</math> is empty. Someone who was familiar with the empty function (see the next cell in this table) might conflate this example with it, and think that this is a function. | ||

+ | |||

+ | The examples in this cell are false positives, also known as type I errors. | ||

+ | |||

+ | ===Surprising examples=== | ||

+ | |||

+ | A surprising example. Let <math>f : \mathbf N \to \mathbf N</math> be defined by <math>f(n) = n\text{th digit of }\pi</math>. This does define a function, but someone who thought that a function is "something that is defined by a formula" wouldn't think it is a function. | ||

+ | |||

+ | Another example is the empty function <math>f : \emptyset \to A</math> for any set <math>A</math>. This does define a function, but the function doesn't "do" anything. Since it is an "extreme" example of a function, someone who was only used to dealing with "normal-looking" functions (or someone who isn't used to working with the empty set or vacuous conditions) might dismiss this example. | ||

+ | |||

+ | As a third example, let <math>\mathcal M</math> be the set of all Turing machines, and let <math>f : \mathcal M \times \mathbf N \to \{\text{true}, \text{false}\}</math> be defined by <math>f(M,n) = \text{Turing machine }M\text{ halts on input }n</math>. This does define a function, although the function is not ''computable''. Someone familiar with the halting problem might substitute "is a well-defined function" with "is a computable function" and say that this is not a function. In this example, it is not the intuitive notion of "function" that is getting in the way, but rather, a different technical concept (i.e., that of a computable function) that is getting in the way. | ||

+ | |||

+ | The examples in this cell are false negatives, also known as type II errors. | ||

+ | |||

+ | ===Obvious non-examples=== | ||

+ | |||

+ | An obvious non-example. Let <math>f : \mathbf R \to \mathbf R</math> be defined by <math>f(x) = x/0</math>. This does ''not'' define a function because division by zero is undefined. Someone familiar with division by zero would recognize this, and correctly reject this example. | ||

==Hierarchical nature of examples== | ==Hierarchical nature of examples== |

## Latest revision as of 08:13, 28 September 2019

**Examples in mathematics** have a different flavor than examples in other disciplines. This is probably because definitions in mathematics are different from definitions in other disciplines (mathematical definitions are exact). Some common problems of deciding whether something is or is not an example do not appear in mathematics. Instead, there are other problems.

## Contents

## Unit testing and examples

A common problem in math is that one comes in with some preconceived idea of what an object should "look like" which is different from what the definition says. In other words, there is a mismatch between one's intuitive notion and the definition.

Take the example of a definition of function. A function is some object that takes each object in some set to a unique object in another set. Someone who was not familiar with the formal definition might mistakenly think of a function as "something that is defined by a formula".

In giving examples, it is particularly important to give examples in the places where intuition and the formal definition disagree. By default, the learner may have a tendency to search only for positive examples.

One can view the giving of examples as analogous to writing unit tests in programming. It is good to have some obvious examples, but one also wants to test the software on surprising cases (called "edge cases") to make sure the software really works.

There is a tendency in human thinking to leave ideas merely at the verbal level, i.e. at a level where the ideas don't constrain anticipation.^{[1]} Giving surprising examples and non-examples is one way to catch people's fuzzy thinking and to correct them.

(I think there's an analogy to overfitting that would be good to explain.)

Is an example according to definition | Is not an example according to definition | |
---|---|---|

Is an example according to intuition | An "obvious" example, or central example. | A surprising non-example. False positives, also known as type I errors. |

Is not an example according to intuition | A surprising example. False negatives, also known as type II errors. | An obvious non-example. |

### Obvious examples

An "obvious" example, or central example.

Let be defined by . This does define a function, and someone who thought that a function is "something that is defined by a formula" would think that this is a function.

### Surprising non-examples

A surprising non-example. Let be defined by (i.e. a function that outputs the numerator of a fraction). This does *not* define a function. To see this, note that and . But so we must have (a function must output a unique object for any given object), but , so something has gone wrong. It turns out that each fraction has many different representations, and the idea of taking "the" numerator does not make sense, unless we constrain the representation somehow (e.g. by reducing the fraction and always putting any minus sign in the numerator). Someone who thought that a function is "something that is defined by a formula" might mistakenly think "this thing is defined by a formula, so must be a function".

As another example, let be a function where . This does *not* define a function. To see this, note that since , we must have some . By the definition of function, we would have , which is a contradiction since is empty. Someone who was familiar with the empty function (see the next cell in this table) might conflate this example with it, and think that this is a function.

The examples in this cell are false positives, also known as type I errors.

### Surprising examples

A surprising example. Let be defined by . This does define a function, but someone who thought that a function is "something that is defined by a formula" wouldn't think it is a function.

Another example is the empty function for any set . This does define a function, but the function doesn't "do" anything. Since it is an "extreme" example of a function, someone who was only used to dealing with "normal-looking" functions (or someone who isn't used to working with the empty set or vacuous conditions) might dismiss this example.

As a third example, let be the set of all Turing machines, and let be defined by . This does define a function, although the function is not *computable*. Someone familiar with the halting problem might substitute "is a well-defined function" with "is a computable function" and say that this is not a function. In this example, it is not the intuitive notion of "function" that is getting in the way, but rather, a different technical concept (i.e., that of a computable function) that is getting in the way.

The examples in this cell are false negatives, also known as type II errors.

### Obvious non-examples

An obvious non-example. Let be defined by . This does *not* define a function because division by zero is undefined. Someone familiar with division by zero would recognize this, and correctly reject this example.

## Hierarchical nature of examples

Something can be considered "concrete" or "abstract" depending on the context. Consider a term like "metric space". One can give examples of metric spaces. On the other hand, a metric space is itself an example (of a structured space, of a topological space).