In Chapter 1, addition was spoken of as a "function" because it "does something" to the numbers it is applied to and produces some result. Multiplication was also referred to as a function, but the notion of function is actually much broader than these two examples alone might suggest. For example, the average or normal weight of a woman depends on her height, and is therefore a function of her height. In fact if one were told that the normal weight for a height of 57 inches is 113 pounds, the normal weight for a height of 58 inches is 115 pounds, and so on, then one could evaluate the function "normal weight" for any given height by simply consulting the list of corresponding heights and weights.
It is usually more convenient to present the necessary information about a function such as "normal weight" not by a long English sentence as begun above, but by a table of the form shown in Figure 2.1.
H  57  113  W 
E  58  115  E 
I  59  117  I 
G  60  120  G 
H  61  123  H 
T  62  126  T 
63  130  
I  64  134  I 
N  65  137  N 
66  141  
I  67  145  P 
N  68  149  O 
C  69  153  U 
H  70  157  N 
E  71  161  D 
S  72  165  S 
The quantity (or quantities) to which a function or verb is applied is (are) called the argument (or arguments) of the function. For example, in the expression 3*4 the number 3 is the left (or first) argument of the verb * and 4 is the right (or second) argument. Evaluation of the "normal weight" function (represented by Table 2.1) for a given argument (say 68 inches) is performed by finding the argument 68 in the first column and reading the weight (149 pounds) which occurs in the same row.
The domain of a function is the collection of all arguments for which it is defined. Addition is, of course, defined for any pair of numbers, but the function "normal weight" is certainly not defined for heights such as 2 inches or 200 inches. For practical purposes, the domain of a function such as "normal weight" is simply the collection of arguments in the table we happen to possess, even though information for other arguments might be available elsewhere. For example, the domain of the function of Table 2.1 is the set of integers from 57 to 72, that is, the set of integers 57+i.16.
The range of a function is the collection of all the results of the function. For example, the range of the function of Figure 2.1 is the set of integers 113, 115, 117, 120, etc. occurring in the second column.
#12
A table of normal weights often shows several columns of weights, one for small framed people, one for medium, and one for large. Such a table appears below. In such a case the weight is a function of two arguments, the height and the "frameclass"; the first argument determines the column in which the result appears. Thus the normal weight of a smallboned, 66inch woman is 133 pounds.
#34
Small  Medium  Large  
H  57  105  113  121  W 
E  58  107  115  123  E 
I  59  109  117  125  I 
G  60  112  120  128  G 
H  61  115  123  131  H 
T  62  118  126  135  T 
63  122  130  139  
I  64  126  134  143  I 
N  65  129  137  147  N 
66  133  141  151  
I  67  137  145  155  P 
N  68  141  149  158  O 
C  69  145  153  162  U 
H  70  149  157  165  N 
E  71  153  161  169  D 
S  72  157  165  173  S 
An arithmetic verb can also be represented by a table, as is illustrated below for the case of multiplication. Since the domain of multiplication includes all numbers, no table can represent the entire multiplication verb; this table, for example, applies only to the domain of the first few integers. The multiplication sign in the upper left corner is included simply to indicate the arithmetic verb which the table represents.
In any table, the first column represents the domain of the first argument and the first row represents the domain of the second argument; the rest is called the body of the table. For example the body of this table is that part bordered on the left and top by the solid lines.
Verb  Right Domain  
Name  *  1  2  3  4  5  6  7  8  9  10 
1  1  2  3  4  5  6  7  8  9  10  
2  2  4  6  8  10  12  14  16  18  20  
3  3  6  9  12  15  18  21  24  27  30  
Left  4  4  8  12  16  20  24  28  32  36  40 
Domain  5  5  10  15  20  25  30  35  40  45  50 
6  6  12  18  24  30  36  42  48  54  60  
7  7  14  21  28  35  42  49  56  63  70  
8  8  16  24  32  40  48  56  64  72  80 
In any table representing a function of two arguments, any one column of the body (taken together with the column of arguments not in the body) represents a function of one argument. For example, the second column of the body of the normal weight table for two arguments represents the same function of one argument as does the original normal weight table.
Thus any function of two arguments can be thought of as a collection of functions of one argument. For example, the second column of the body of the times table above represents the "times two" function, the third column represents the "times three" function, etc.
Similarly, one row of the body of a function table represents a function of one argument. For of example, the fifth row of the body of Figure 2.2 gives weights as a function of "frame" for 61 inch women.
#510
The basic rule for reading a function table is very simple: to evaluate a function, find the row in which the value of the first argument occurs (in the first column, not in the body of the table) and find the column in which the second argument occurs (in the first row) and select the element at the intersection of the selected row and the selected column. However, just as there is more to reading an English sentence than pronouncing the individual words, so a table can be "read" so as to yield useful information about a function beyond that obtained by simply evaluating it for a few cases.
For example, the second normal weight table can be "read" so as to answer the following questions:
Arithmetic verbs are more orderly than a function such as that represented by the table above, and the patterns that can be detected in reading their function tables are more striking and interesting. Consider, for example, an attempt to read this table to answer the following questions:
Similarly, one can construct a verb table for addition and read it to determine answers to the following questions:
Because of the patterns they exhibit, verb tables can be very helpful in gaining an understanding of unfamiliar mathematical verbs. For this reason they will be used extensively in succeeding chapters.
If
a=.1 2 3 4 5 6 7 8 b=.1 2 3 4 5 6 7 8 9 10
then the expression a*/byields the body of the multiplication table as follows:
a*/b 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12 14 16 18 20 3 6 9 12 15 18 21 24 27 30 4 8 12 16 20 24 28 32 36 40 5 10 15 20 25 30 35 40 45 50 6 12 18 24 30 36 42 48 54 60 7 14 21 28 35 42 49 56 63 70 8 16 24 32 40 48 56 64 72 80
Similarly, the body of an addition table for the same set of arguments can be produced as follows:
a+/b 2 3 4 5 6 7 8 9 10 11 3 4 5 6 7 8 9 10 11 12 4 5 6 7 8 9 10 11 12 13 5 6 7 8 9 10 11 12 13 14 6 7 8 9 10 11 12 13 14 15 7 8 9 10 11 12 13 14 15 16 8 9 10 11 12 13 14 15 16 17 9 10 11 12 13 14 15 16 17 18
The general rule is that the symbol for a verb followed by the symbol / produces the appropriate verb table when applied to any arguments a and b. The expression a+/b may be read as "the addition table for a and b" or "a addition table b", or even as "a plus slash b". Similarly, "a*/b", may be read as "a times table b", etc.
When we want to create a table using the same list for both arguments, in the form a f/a, we have the option of abbreviating the expression in the form f/~a, using the reflexive adverb. The saving is not great when the argument is a simple variable, but it becomes more significant when the argument is an expression. Use of the reflexive adverb is akin to the use of reflexive pronouns in English and other languages, in forms such as "Take care of yourself." For example:
+/~i.8 0 1 2 3 4 5 6 7 1 2 3 4 5 6 7 8 2 3 4 5 6 7 8 9 3 4 5 6 7 8 9 10 4 5 6 7 8 9 10 11 5 6 7 8 9 10 11 12 6 7 8 9 10 11 12 13 7 8 9 10 11 12 13 14 */~i.8 0 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 0 2 4 6 8 10 12 14 0 3 6 9 12 15 18 21 0 4 8 12 16 20 24 28 0 5 10 15 20 25 30 35 0 6 12 18 24 30 36 42 0 7 14 21 28 35 42 49
It is important to note that the expression a+/b produces only the body of the addition table, to which one may add a first column consisting of a and a first row consisting of b if this is found to make the table easier to read. Here is an adverb for creating simple verb tables. For now, we can just use it. How it works is explained in Chapter Nine, Verb, Adverb, and Conjunction Definition.
ftable=.1 :(':';'2 2$(>5!:1<''u'');(i.y);(,.i.x);(i.x)u/(i.y)') 5 +ftable 5 ┌─┬─────────┐ │+│0 1 2 3 4│ ├─┼─────────┤ │0│0 1 2 3 4│ │1│1 2 3 4 5│ │2│2 3 4 5 6│ │3│3 4 5 6 7│ │4│4 5 6 7 8│ └─┴─────────┘
It is also important to note the difference between the expression a*/b, which yields the multiplication table, and the expression a*b, which yields the elementbyelement product of a and b. For example:
a=.1 3 5 b=.2 4 6
a*b 2 12 30
a*/b 2 4 6 6 12 18 10 20 30
#1213
The body of a table alone does not define a function. For example, the following tables define two distinct functions although the bodies of the tables are identical:
+  2  3  4  5  f  2  3  5  7  
2  4  5  6  7  6  4  5  6  7  
3  5  6  7  8  5  5  6  7  8  
4  6  7  8  9  4  6  7  8  9  
5  7  8  9  10  3  7  8  9  10 
The name of the function represented by the first table is + (as shown in the upper lefthand corner), and the table can be used to evaluate expressions as shown on the left below:
5 + 3 is 8  5 f 3 is 6  
4 + 5 is 9  4 f 5 is 8  
3 + 3 is 6  3 f 3 is 8 
The function represented by the second table is called f (as indicated in the upper left corner) and the expressions on the right above show the evaluation of the function f for the same arguments used on the left. Since the results differ, the two tables represent different functions.
The complete specification of a function table therefore requires the specification of four items:
From these four items the table can be constructed and used as illustrated below:
Left domain:  3 4 5 6  
Right domain:  11 9 7 5 3 1  
Body:  5+(3*i.4)+/(2*i.6)  
Name:  g 
Function  Right Domain  
Name  g  11  9  7  5  3  1 
3  10  12  14  16  18  20  
Left Domain 
4  13  15  17  19  21  23 
5  16  18  20  22  24  26  
6  19  21  23  25  27  29 
4 g 5 is 19
6 g 9 is 21
2*6 g 9 is 42
#1416
The advantages of the verb table can perhaps be better appreciated by applying it to some unfamiliar verbs than by applying it to verbs such as addition and multiplication which are probably already well understood by the reader. For this purpose we will now introduce several simple new verbs, denoted by <. and >., which will also be found to be very useful in later work.
It is sometimes instructive to introduce a new function as a puzzle—the reader must determine the general rule for evaluating the function by examining the results obtained when it is applied to certain chosen arguments. For example, the function <. can be applied to certain arguments with the results shown below:
3<.8 3 47<.32 32
If one performs enough such experiments it should be possible to guess the general rule for the function. In attempting such a guess it is helpful to organize the experiments in some systematic way, and the body of the function table provides precisely the sort of organization needed. For example:
i=1 2 3 4 5 6 7 8 i<./i 1 1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 1 2 3 3 3 3 3 3 1 2 3 4 4 4 4 4 1 2 3 4 5 5 5 5 1 2 3 4 5 6 6 6 1 2 3 4 5 6 7 7 1 2 3 4 5 6 7 8
From the foregoing the reader should be able to state the definition of the function and from that statement be able to apply it correctly to any pair of arguments.
The functions <. is called the minimum function because it yields the smaller of its two arguments. The maximum function is denoted by >. and is defined analogously. The body of its function table appears below:
i>./i 1 2 3 4 5 6 7 8 2 2 3 4 5 6 7 8 3 3 3 4 5 6 7 8 4 4 4 4 5 6 7 8 5 5 5 5 5 6 7 8 6 6 6 6 6 6 7 8 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 8
#1718
Let us treat the verbs denoted by [ and ] similarly as puzzles. For example:
1[2 1 1]2 2 1[0 1 2 3 1 1]0 1 2 3 0 1 2 3 0 1 2 3[1 0 1 2 3
Clearly [ and ] are not scalar (rank 0) verbs. Given a list argument and a scalar argument, they can yield either a scalar or a list. Can you tell what the rule is for them yet? To find out more, let us make the scalar versions of these verbs, that is ["0 and ]"0, and try them out:
0 1 2 3 ["0/4 5 6 0 0 0 1 1 1 2 2 2 3 3 3 0 1 2 3 ]"0/4 5 6 4 5 6 4 5 6 4 5 6 4 5 6
Does this make sense? How about this?
m=.i.&.>(<"0) 1+i.3 m ┌─┬───┬─────┐ │0│0 1│0 1 2│ └─┴───┴─────┘ n=.i.&.>(<"0) 4+i.3 n ┌───────┬─────────┬───────────┐ │0 1 2 3│0 1 2 3 4│0 1 2 3 4 5│ └───────┴─────────┴───────────┘ m]&.>/n ┌───────┬─────────┬───────────┐ │0 1 2 3│0 1 2 3 4│0 1 2 3 4 5│ ├───────┼─────────┼───────────┤ │0 1 2 3│0 1 2 3 4│0 1 2 3 4 5│ ├───────┼─────────┼───────────┤ │0 1 2 3│0 1 2 3 4│0 1 2 3 4 5│ └───────┴─────────┴───────────┘ m[&.>/n ┌─────┬─────┬─────┐ │0 │0 │0 │ ├─────┼─────┼─────┤ │0 1 │0 1 │0 1 │ ├─────┼─────┼─────┤ │0 1 2│0 1 2│0 1 2│ └─────┴─────┴─────┘
We have seen the effect of the dyadic [ and ] verbs on individual numbers and on lists of numbers. The [ verb, called left, returns its left argument unchanged, while the ] verb returns ins right argument unchanged.
#1920
In the monadic case, each returns its argument unchanged. In this case, they are both known as same. For example:
]1 1 [1 1 ]2 1 4 2 1 4 [2 1 4 2 1 4
Normally an assignment statement does not result in a value being displayed. Sometimes this is what we want, and at other times we want to make the assignment and then immediately display the value. We can always do it this way:
a=.5 6 7 a 5 6 7
However, J allows us to abbreviate this process using the ] verb, known as right or same, described above. When applied to a single value, it returns its argument, thus:
]a=.5 6 7 5 6 7
We will use this abbreviation for assign and display throughout the rest of this book. In general, ]y returns the value of y. Similarly, x]y returns y. The right function is not provided just for this simple convenience, but has other important uses that will appear later.
Similarly, there is a left function [ . As you might suppose, x[y is x. However, when [ has no left argument, it returns the argument it does have, so that [y is y.
Another very useful function is called the power function and is denoted by ^ . The body of its function table is shown below:
i=.1 2 3 4 5 6 7 i^/i 1 1 1 1 1 1 1 2 4 8 16 32 64 128 3 9 27 81 243 729 2187 4 16 64 256 1024 4096 16384 5 25 125 625 3125 15625 78125 6 36 216 1296 7776 46656 279936 7 49 343 2401 16807 117649 823543
The power function is defined in terms of multiplication in much the same way as multiplication is defined in terms of addition. To appreciate how multiplication is defined as "repeated additions", consider the following expressions:
2#2 2 2 +/2#2 4 3#2 2 2 2 +/3#2 6 4#2 2 2 2 2 +/4#2 8 +/5#2 10 +/6#2 12 +/8#3 24

2*2 4 3*2 6 4*2 8 5*2 10 6*2 12 8*3 24

Comparing the results of +/2#2 and 2*2 and the results of +/3#2 and 2*3, etc., it should be clear that m*n is equivalent to adding n quantities each having the value m.
The corresponding definition of the power function ^ can be obtained by replacing each occurrence of + in the foregoing expressions by * and each occurrence of * by ^ :
2#2 2 2 */2#2 4 3#2 2 2 2 */3#2 8 4#2 2 2 2 2 */4#2 16 */5#2 32 */6#2 64 */8#3 6561


In general, m to the power n (that is, m^n) is obtained by multiplying together n factors each having the value m.
The special case of m^2 occurs so frequently in algebra and elsewhere that we abbreviate it as *:m, read square m.
#2124
Figure 2.4 shows a map which represents the "times two" function. The rule for evaluating a function represented by a map is very simple: locate the specified argument in the top row, then follow the arrow from that argument to the result at the head of the arrow in the bottom row; e.g. the result for the argument 3 is 6.
Map of "Times Two" Function
Figure 2.4
The rules for constructing a map are also simple. First consider all of the values in the domain of the function together with all of the results, and choose the smallest number and the largest number from among them. Write a row of numbers beginning with the smallest and continuing through each of the integers in order up to the largest. Repeat the same numbers in a row directly below the first row. For each argument in the top row now draw an arrow to the corresponding result in the bottom row.
Just is it is often helpful to read tables, so is it helpful to read such maps. Consider the four maps shown below. From the first it is clear that in the map of addition of 2, the arrows are all parallel. From the map below this it is clear that the same is true for addition of 3, and that the slope of the arrow depends on the amount added. The maps on the right show multiplication; here the arrows are not parallel, and the distance between successive arrowheads is seen to be equal to the multiplier.
Maps for Addition and Multiplication
Figure 2.5
It is sometimes useful to show the maps of a sequence of functions such as the following.
i=.1 2 3 4 5 6 2*i 2 4 6 8 10 12 8+2*i 10 12 14 16 18 20
The appropriate maps are shown in the figure below. The broken lines show the map of the overall result produced, that is, the map of the function 8+2*i .
Maps of a Sequence of Functions
Maps will be used in the next chapter to introduce the function subtraction and the new negative numbers which this function produces.
#2526
There has been error in communication with Booktype server. Not sure right now where is the problem.
You should refresh this page.