Concept
How do functions provide a well-defined answer?
Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk / Chapter 1
"One of the things that makes functions useful is that we can ask “which element of Y goes with X?” and we will always get back a well-defined answer. We can’t really do that with relations in general, because the answer might be “none” or “several.” With F, I can ask, “which drink does Hermione map to?” and the answer is “Mt. Dew.” In symbols, we write this as follows: F(Hermione) = Mt. Dew. This will look familiar to computer programmers, since it resembles a function call. In fact, it is a function call. “Functions” in languages like C++ and Java were in fact named after this discrete math notion. If you know anything about programming, you know that in a program I can “call the F() function” and “pass it the argument ‘Hermione’” and “get the return value ‘Mt. Dew.’” I never have to worry about getting more than one value back, or getting none at all."
Related Ideas
- What are a function’s meaning, definition, and range?Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk · Chapter 1
- Why is the relation not a function?Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk · Chapter 1
- How do the examples f₁ through f₆ illustrate function properties?Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk · Chapter 1
- Is the relation still a function after removing (Julie, volleyball)?Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk · Chapter 1
- How can a relation be defined extensionally or intensionally?Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk · Chapter 1
- What is an injective function?Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk · Chapter 1
- What is a surjective function?Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk · Chapter 1
- What is a bijective function?Stephen Davies, Ph.D. Version 2.2.2 Through Discrete Mathematics A Cool Brisk Walk · Chapter 1