Reading Values from a Table
A scalar function takes an input, or an ordered tuple of inputs, and assigns it a single scalar output. Sometimes the function is given by a formula, so its value is found by substituting the inputs into that formula. In other cases, its values are supplied in a table. Then the task is not to derive a formula: it is to locate the entry that corresponds to the exact input tuple.
This distinction matters because a table records values at particular inputs. To read one correctly, you must match every coordinate with the right label. A table can be neatly formatted and still be misread if, for example, a row label is mistaken for a column label or the inputs are looked up in the wrong order.
Two Inputs: Match the Row and Column
A common layout for a function \(f\) of two inputs is to use the first input to label rows and the second input to label columns. The cell where the chosen row and column meet gives the function value. In that layout, the row label is the first coordinate and the column label is the second coordinate.
For example, in the table below, row labels specify \(x\), column labels specify \(y\), and each interior cell contains \(f(x,y)\).
| \(x \backslash y\) | \(-1\) | \(2\) | \(5\) |
|---|---|---|---|
| \(0\) | \(4\) | \(-2\) | \(7\) |
| \(3\) | \(1\) | \(6\) | \(0\) |
| \(5\) | \(-3\) | \(8\) | \(2\) |
To read \(f(3,2)\), find the row labeled \(x=3\), then follow it to the column labeled \(y=2\). The intersection contains \(6\), so \(f(3,2)=6\). Both labels are essential: the value \(6\) belongs to the ordered input \((3,2)\), not merely to the unordered pair of numbers 3 and 2.
Worked Example: Looking Up a Two-Input Value
Use the displayed table to find \(f(5,-1)\).
Step 1: Identify the coordinate order. The table uses row labels for \(x\), the first input, and column labels for \(y\), the second input. Thus the requested pair is \(x=5\), \(y=-1\).
Step 2: Select the row. Find the row whose label is \(5\). Its entries, under the column labels \(-1\), \(2\), and \(5\), are \(-3\), \(8\), and \(2\).
Step 3: Select the column and read the intersection. The requested second coordinate is \(-1\), so use the first of those columns. The intersecting entry is \(-3\).
Check: The selected row label matches the first input, \(5\), and the selected column label matches the second input, \(-1\). Their intersection is \(-3\), so the lookup uses the correct ordered pair.
Why the Cell Gives the Requested Value
The table layout is a compact way to label each entry. For a two-input table in the row-first convention described above, an entry in the row labeled \(x_i\) and column labeled \(y_j\) represents \(f(x_i,y_j)\). Therefore, if the requested inputs are \(x_i\) and \(y_j\), selecting that row and that column leads to the entry associated with precisely that pair.
The reasoning depends on respecting the coordinate labels. The row is not just a convenient place to search; it carries the first input label. The column carries the second. Selecting the cell where those labels meet is what identifies the ordered input.
This rule follows directly from how the table is labeled. A specific row and a specific column meet in one cell, and the two labels on that cell give the input coordinates for its entry. If a table uses a different stated layout, follow its labels rather than assuming the row-first convention.
Three Inputs: Choose the Layer First
A table for a function of three inputs can be organized as a collection of two-input tables, one for each listed value of the third input. These separate tables are often called layers. In the layout used here, the first coordinate labels rows, the second labels columns, and the third identifies the layer.
For a requested value \(g(a,b,c)\), the lookup has three parts: choose the layer labeled by \(c\), find the row labeled by \(a\), and then move to the column labeled by \(b\). Keeping that order visible helps prevent a coordinate from being assigned to the wrong direction.
| Layer \(c=0\) | ||
|---|---|---|
| \(a \backslash b\) | \(-1\) | \(2\) |
| \(0\) | \(5\) | \(3\) |
| \(2\) | \(7\) | \(4\) |
| Layer \(c=4\) | ||
|---|---|---|
| \(a \backslash b\) | \(-1\) | \(2\) |
| \(0\) | \(2\) | \(8\) |
| \(2\) | \(9\) | \(6\) |
Worked Example: Looking Up a Three-Input Value
Use the two layers above to find \(g(2,-1,4)\).
Step 1: Read the input order. The first input is \(a=2\), the second is \(b=-1\), and the third is \(c=4\).
Step 2: Choose the layer. The third coordinate is \(4\), so use the table labeled \(c=4\), not the table labeled \(c=0\).
Step 3: Find the row. Within the \(c=4\) layer, select the row labeled \(a=2\).
Step 4: Find the column and read its entry. In that row, select the column labeled \(b=-1\). The entry there is \(9\).
Check: The chosen layer matches \(c=4\), the row matches \(a=2\), and the column matches \(b=-1\). The entry \(9\) is therefore the one labeled by the requested ordered triple \((2,-1,4)\).
Notice the lookup order: the third coordinate selects the layer, even though it appears last in the function notation. It does not replace the row or column coordinate. All three labels are needed to identify the entry.
Worked Example: Reading Two Entries from Different Layers
For the same table, find \(g(0,2,0)\) and \(g(0,2,4)\).
First lookup: \(g(0,2,0)\). The third coordinate is \(0\), so choose layer \(c=0\). In that layer, select row \(a=0\) and column \(b=2\). Their intersection is \(3\), giving \(g(0,2,0)=3\).
Second lookup: \(g(0,2,4)\). The third coordinate is now \(4\), so choose layer \(c=4\). Select row \(a=0\) and column \(b=2\). The intersecting entry is \(8\), giving \(g(0,2,4)=8\).
Check: Both lookups use the same row label \(a=0\) and column label \(b=2\). They differ in the layer, as required by their different third coordinates, and the selected entries are \(3\) and \(8\), respectively.
Table Entries Are Not Formula Calculations
When a scalar function is specified by a formula, evaluating it means substituting the given coordinates and carrying out the indicated operations. A table provides a different kind of information: its entries state the values at the labeled inputs. Looking up an entry does not require discovering a rule that generates the other entries.
For instance, the table gives \(f(3,2)=6\) because the cell with row label \(3\) and column label \(2\) contains \(6\). It does not, by itself, tell us to calculate \(3+2+1\), or establish that this expression is a formula for \(f\). Even if some listed values happen to fit a familiar pattern, that observation is not a substitute for the table’s stated entries.
Likewise, if a requested tuple has no matching entry in the displayed table, the table alone does not supply a value for that lookup. Do not silently replace the missing entry with a nearby one, infer a pattern, or estimate between entries. A separate rule or additional information would be needed to justify such a calculation.
Common Mistake: Reversing the Inputs
Consider the two-input table. The row label represents the first coordinate \(x\), and the column label represents the second coordinate \(y\). A frequent error is to swap those roles when looking up a value.
For example, to find \(f(5,-1)\), a reversed lookup would select row \(x=-1\) and column \(y=5\). But the table has no row labeled \(-1\). More fundamentally, that procedure does not match the requested ordered pair: it treats the first coordinate as \(y\) and the second as \(x\). The correct lookup uses row \(x=5\) and column \(y=-1\), producing \(-3\).
The same issue can occur in three-input tables. If you read \(g(2,-1,4)\) by choosing the \(c=0\) layer, you have ignored the third coordinate. If you choose the correct layer but use column \(2\), you have confused the first and second coordinates. A reliable check is to point to the label corresponding to each input before reading the entry.
Keep the requested coordinates in their given sequence; do not rearrange them.
Use the table’s headings to determine which coordinate selects a row, column, or layer.
Confirm that every selected label matches the corresponding coordinate before stating the scalar value.
Check Your Understanding
Use the tables and conventions in this tutorial to answer the questions. For each lookup, identify which labels you used.
- In the two-input table, what is \(f(3,5)\)?
- In the two-input table, what is \(f(0,-1)\)?
- In the three-input tables, what is \(g(2,2,0)\)?
- In the three-input tables, what is \(g(0,-1,4)\)?
- If a requested tuple has no corresponding entry in a displayed table, can you use that table alone to calculate its value? Explain briefly.