Bifalgorithm post · Brisk · Chapter 1
How do functions provide a well-defined answer?
How do functions provide a well-defined answer? (Brisk · Chapter 1) — "One of the things that makes functions useful is that we can ask “which element of Y goe…
Ideas in this flowchart
- Functions associate each input with exactly one well-defined output.
- For a function, asking which element of Y goes with X always produces an answer.
- A general relation may associate an input with no elements or with several elements.
- The function F maps Hermione to the drink Mt. Dew.
- The mapping is written symbolically as F(Hermione) = Mt. Dew.
- This notation resembles a function call in programming languages.
- A program calls F() and passes Hermione as its argument.
- The function call returns Mt. Dew as its return value.
- A function call never returns more than one value or no value at all.
