## Operators, Functions, and Properties – part 30

In many of the posts in this series we’ve shown operators that work on a single number coming in and that produce a single number coming out.  This is a hugely important subcategory of operators, but single-in single-out operators aren’t by any means the only type.  So let’s take a look at the operators typically encountered in K-12 mathematics in the United States.

The arithmetic operations from elementary school: add, subtract, multiply, divide – these are usually conceived as two-input, one-output operations.  There are some more you learn in secondary school: exponentiation, and perhaps the min and max operators we looked at in the previous post.  Interestingly, most of the new operations you learn in secondary school are single-input types: absolute value, square, square root; and later on sin, cos, tan and other trigonometric functions, and log.  Occasionally, secondary school students run into situations where there are more than two inputs (e.g. to find a slope of a line going through two given points) but these rarely rise to the level of standardized notation.

Even things like the quadratic formula, which looks for the value of $x$ for which $ax^2 +bx + c = 0$, and where the numbers $a, b$, and $c$ could be regarded as the inputs, is rarely seen or treated as an operator.  Instead, it is treated as a series of one-offs: here’s an equation, solve it.  Here’s another equation, solve it too.

There is a vocabulary to distinguish these kinds of operators and functions, though the vocabulary is more firmly established in computer science than it is in mathematics.  The one-in, one-out kind are called unary operators and unary functions; the two-in, one-out kind are called binary operators and binary functions.  Functions with three values coming in and one coming out would be called ternary functions, and so on.  Sometimes you see the notation “n-ary function” for a function that has n values coming in (for some unspecified n) and one value coming out.

Some mathematicians might scoff at all this, and bring up that in some sense, all operators and all functions are of the one-in, one-out type.  What comes in, no matter what it is, is called the domain, and what comes out, whatever it is, is called the range.  Neither domain and range have to be numbers.  They can be whatever they need to be.

For example, subtraction can be seen as a single-in, single-out function where the domain (what comes in) consists of pairs of numbers.  The range (what comes out) consists of single numbers.  The image below compares the way we normally think of subtraction, on the left, and subtraction as an operator on a pair of numbers, on the right.

Though the view on the right may seem artificial, it seems less so if you see what we have to do to the diagram on the left to keep straight what input is what. As another example, sort-by-due-date can be seen as a single-in, single-out operator where the domain consists of a bag of bills and the range consists of a linear arrangement  of these same bills – a special arrangement where the bills that need to be paid soon are up front and the bills that need to be paid later are in the back.

In prior posts in this series, we’ve looked at state machines, where the operators operate on the state of the machine.   We’ve played with stopwatches and calculators as examples of such machines.  Sometimes the state of these machines consisted of a single number, but more commonly, the state consists of multiple numbers and other things.  For example, the state of the tab in your browser window includes a history of sites, so that the “back” operator has a way to get you back to the site you were before you clicked on a link.

In the next post, we’ll play with some operators that have interesting domains and interesting ranges.

This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.
{"ft_lang_label":"__label__en","ft_lang_prob":0.961405,"math_prob":0.97234195,"size":3756,"snap":"2021-43-2021-49","text_gpt3_token_len":783,"char_repetition_ratio":0.13033049,"word_repetition_ratio":0.021705426,"special_character_ratio":0.20660277,"punctuation_ratio":0.10949868,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9616767,"pos_list":[0,1,2,3,4,5,6,7,8,9,10],"im_url_duplicate_count":[null,null,null,null,null,null,null,null,null,5,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-10-22T22:13:27Z\",\"WARC-Record-ID\":\"<urn:uuid:9f7697f2-d497-4740-95f4-99ecbf59aec1>\",\"Content-Length\":\"111181\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:3e8a4403-9d29-466e-8670-2ea2717cb37c>\",\"WARC-Concurrent-To\":\"<urn:uuid:4c370a70-13b5-4d14-a579-095a1314edf2>\",\"WARC-IP-Address\":\"192.0.78.25\",\"WARC-Target-URI\":\"https://unlearningmath.com/2010/11/16/operators-functions-and-properties-part-30/\",\"WARC-Payload-Digest\":\"sha1:ASQC3NFZ7XBDX4Y46K5Y22H3CGORPUFZ\",\"WARC-Block-Digest\":\"sha1:FE55VYP2MYBBDDBWUSI2USJMIHT466EU\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-43/CC-MAIN-2021-43_segments_1634323585522.78_warc_CC-MAIN-20211022212051-20211023002051-00460.warc.gz\"}"}