Quarry School

Follow a composition through tables

Subject: MathematicsLeans on: Table readingLeans on: Composition orderLeans on: DomainLeans on: Listing separate inputs
Level 1 · FoundationsAbout 14 min read6 new terms
How this was estimated

Programmatic estimate. Rung levels, worked steps, prerequisites, terms and sentence length contribute to this level. It describes the lesson, not your ability.

Reading counts the whole lesson, including folded explanations, at 180 words a minute. Practice allows two minutes per item. These are planning assumptions; take the time you need.

AI estimate unavailable.

Path to here

Open the unit’s lesson list to follow the lesson order.

    Quick review (2 minutes)

    In plain words

    Picture a row of labeled drawers.

    Rule

    To evaluate f(g(a)) from tables, read g(a), then use that output as the input for the f lookup.
    A composition is defined only when both lookups exist.

    Step

    1. 1. Read the nested notation and choose the inner table.

    2. 2. Find the column labeled with the original input in that table.

    3. 3. Read its output and write it as the intermediate value.

    4. 4. Find that value among the input labels of the outer table, which may be a different column.

    5. 5. Read the outer output. If either required input is absent from a complete table, the composition is undefined there.

    Question

    The two pictures list every input accepted by f and g. Find f(g(3)) and g(f(3)). You start at input 3 and find the final output in each order. Plan: read the inner table first, write its answer, and use that answer as an input in the outer table.

    Answer

    f(g(3)) = 8.
    g(f(3)) = 2.

    Trap

    Reading the same input column in both pictures. The outer lookup uses the inner output, which can move you to a new column.

    Strategy

    1. 1. Rewrite the composition with parentheses. Identify the function nearest the starting input.

    2. 2. For an evaluation, find the input in the inner table and read down to its output.

    3. 3. Locate that in-between number in the outer input row and read down again.

    4. 4. For a solve question, start from the requested final output, read up to every matching outer input, then find which inner inputs produce those numbers.

    5. 5. Check by reading each claimed path forward. If a lookup is missing, distinguish a complete definition from selected samples.

    Term

    Function

    Definition

    A rule that gives exactly one output for each input it accepts.

    Term

    Input

    Definition

    The starting value you give a function. It goes inside the parentheses in function notation.

    Term

    Output

    Definition

    The answer a function produces from an accepted input.

    Term

    Evaluate

    Definition

    Find the output of a function or the value of an expression for a given input.

    Term

    Domain

    Definition

    All inputs for which a function is defined.

    Term

    Undefined

    Definition

    Having no permitted output under the rule being used, as with division by zero or a negative real square-root radicand.

    Term

    Inner function

    Definition

    The function evaluated first in a composition. Its output becomes the next function's input.

    Term

    Outer function

    Definition

    The function evaluated second in a two-function composition. It receives the inner function's output.

    Term

    Table

    Definition

    An organized display of matching values. In a function table, each input and its output share a column or row.

    Term

    Intermediate answer

    Definition

    The in-between output of the first function, which becomes the next function’s input.

    Term

    Nested

    Definition

    Placed inside another expression, like one pair of parentheses inside another.

    Term

    Solve

    Definition

    Find every input that makes a stated equality or inequality true. This differs from evaluating at a given input.

    1 In plain words

    Picture a row of labeled drawers. The label tells you which drawer to open, and the number inside is its answer. A table records those labels and answers in matching columns. For two jobs in a row, open a drawer in the first table, take its number, and use that number as the drawer label in the second table. You may move to a different column. Here each table lists every input its function accepts. An unlisted input therefore has no answer. A table showing only selected samples would leave other inputs unknown instead. The in-between answer selects the second drawer; it is not automatically the starting label.

    2 Picture it

    3g tablef tablefirstsecond28
    3 goes into g table, then 2 into f table: 8.
    input xoutput f(x)16283341
    The textbook puts both functions under one shared input row.
    input xoutput g(x)13253247
    x: 1, 2, 3, 4; g(x): 3, 5, 2, 7.

    Reminder

    Reminder: Table reading, Composition order, Domain, Listing separate inputs
    • Table reading. Read one column downward: the f picture's input 2 has output 8.
    • Composition order. f(g(3)) starts in g, then uses its answer in f.
    • Domain. When a table lists every accepted input, its input row gives the complete domain; these pictures accept only 1, 2, 3, and 4.
    • Listing separate inputs. {1, 3} lists only 1 and 3. The interval [1, 3] also includes every number between them, so it describes a different set.

    3 Why

    Each column states one input-output pair. In f(g(3)), the first lookup is the output beneath input 3 in the g table. That value becomes the input label for the f table. Reading both outputs beneath 3 would instead give f(3) and g(3), two independent evaluations. The two-stage lookup also explains the composite domain. Some allowed starting inputs produce intermediate numbers that do not appear among the next function's accepted inputs, so those starts cannot finish the composition.

    4 The rule

    To evaluate f(g(a)) from tables, read g(a), then use that output as the input for the f lookup.

    A composition is defined only when both lookups exist.

    The same idea, five ways

    Say it

    f of g of three; f after g at three

    Write it

    Look up g at 3, then look up f at the number g returns.

    In math
    • f(g(3)) = f(2) = 8
    • (f ∘ g)(3) = 8
    • 3 → g → 2 → f → 8
    Like

    One drawer gives you the label of the next drawer.

    See it
    3g tablef tablefirstsecond28
    The same picture again: 3 goes into g table, then 2 into f table: 8.

    The same idea, other ways

    As labeled drawers

    Open drawer 3 in g. It contains 2. Open drawer 2 in f. It contains 8. The second drawer number comes from the first drawer's contents.

    drawer 3gffirstsecondlabel 28
    The first output selects the second drawer.
    As a path

    Write only the numbers along the path: 3 to 2 to 8. Then label the first arrow g and the second arrow f. This keeps the meaning attached to each lookup.

    3gffirstsecond28
    Two labeled arrows replace crowded parentheses.
    x1234
    f(x)6831
    g(x)3527

    Part 1: Read f after g

    Start in g because it is inner. Its answer tells you where to look in f. The outer table's output is the final answer.

    • f(g(3)) uses g(3) first.
    • The outer input is g’s output, which may differ from the starting input.
    input xoutput g(x)13253247↓ evaluate: input given, read the output below it
    Read downward under 3 to find the next input 2.

    Worked example

    One more f-after-g path

    OpenStax problem

    Using the two complete tables beside this example, find f(g(1)). The input is 1; find its final answer after g and then f. Plan: read g under 1, then use its output as the next input in f.

    input xoutput f(x)16283341
    The same picture again: x: 1, 2, 3, 4; f(x): 6, 8, 3, 1.
    input xoutput g(x)13253247
    The same picture again: x: 1, 2, 3, 4; g(x): 3, 5, 2, 7.
    Show the steps and the answer
    input xoutput f(x)16283341↓ evaluate: input given, read the output below it
    x: 1, 2, 3, 4; f(x): 6, 8, 3, 1, read at x = 3.
    input xoutput g(x)13253247↓ evaluate: input given, read the output below it
    x: 1, 2, 3, 4; g(x): 3, 5, 2, 7, read at x = 1.
    1. The column under 1 in g gives g(1)=3.g receives the original input.
    2. The column under 3 in f gives f(3)=3.The first output selects the outer input.
    Answer
    f(g(1)) = 3.
    Double-check The path is 1 to 3 to 3; the final 3 belongs to f's output row.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: f(g(1)) = 6 because f gives 6 under input 1.
    This used f first even though g touches the starting 1.
    ✓ Instead: g(1) = 3, then f(3) = 3, so f(g(1)) = 3.

    Tips and tricks

    • Read the inner output before moving to the other input row.

    Part 2: Read g after f

    Reversing the composition changes which table receives the starting input. You must restart the path rather than reverse the digits of the first answer.

    • g(f(4)) uses f(4) first.
    • A repeated final answer does not imply the paths match.
    input xoutput f(x)16283341↓ evaluate: input given, read the output below it
    Input 4 in f sends 1 to the outer table.

    Worked example

    A g-after-f path

    OpenStax problem

    Using the two complete tables beside this example, find g(f(4)). The input is 4; find the final answer after f and then g. Plan: read f under 4, then read g under the number f returns.

    input xoutput f(x)16283341
    The same picture a third time: x: 1, 2, 3, 4; f(x): 6, 8, 3, 1.
    input xoutput g(x)13253247
    The same picture a third time: x: 1, 2, 3, 4; g(x): 3, 5, 2, 7.
    Show the steps and the answer
    input xoutput f(x)16283341↓ evaluate: input given, read the output below it
    The same picture again: x: 1, 2, 3, 4; f(x): 6, 8, 3, 1, read at x = 4.
    input xoutput g(x)13253247↓ evaluate: input given, read the output below it
    The same picture again: x: 1, 2, 3, 4; g(x): 3, 5, 2, 7, read at x = 1.
    1. Read f(4)=1 under input 4 in f.f is inner in this order.
    2. Read g(1)=3 under input 1 in g.The first answer 1 is the new input.
    Answer
    g(f(4)) = 3.
    Double-check The path 4 to 1 to 3 uses a column from each table in the requested order.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: g(f(4)) = g(4) = 7.
    The outer function receives f(4), not the original 4.
    ✓ Instead: f(4) = 1, then g(1) = 3, so g(f(4)) = 3.

    Tips and tricks

    • Restart at the original input when you reverse the order.

    Part 3: Build tables of composite outputs

    Collect every successful two-stage path in a new table. Include only starting inputs that finish both stages. Here both original tables list every accepted input. A missing second lookup means the composition is undefined at that start. Braces list separate inputs: {1, 3} means only 1 and 3, rather than the entire stretch from 1 to 3.

    • The composite f ∘ g accepts only inputs 1 and 3.
    • The composite g ∘ f accepts only inputs 3 and 4.
    • If a table lists selected samples rather than a complete function, an unlisted lookup is unknown from that table, not proven undefined.
    input xoutput (f ∘ g)(x)1338↓ evaluate: input given, read the output below it
    These are all starting inputs that can pass through g and then f.

    Worked example

    Collect both composite functions

    Build complete tables for f ∘ g and g ∘ f from the two complete function tables pictured here. Try each starting input and keep the paths that finish. Plan: record both lookups for each of the four inputs, then draw a new table containing only successful paths.

    Show the steps and the answer
    input xoutput f(x)16283341
    The same picture, shown 4 times now: x: 1, 2, 3, 4; f(x): 6, 8, 3, 1.
    input xoutput g(x)13253247
    The same picture, shown 4 times now: x: 1, 2, 3, 4; g(x): 3, 5, 2, 7.
    input xoutput (f ∘ g)(x)1338
    f after g has two allowed starting inputs.
    input xoutput (g ∘ f)(x)3243
    g after f has a different pair of allowed starting inputs.
    1. For f∘g, starting at 1 gives g(1)=3, then f(3)=3. Starting at 3 gives g(3)=2, then f(2)=8.Both intermediate answers appear as accepted f inputs.
    2. Starting at 2 gives g(2)=5, and starting at 4 gives g(4)=7. Both paths stop before f.The complete f table accepts neither 5 nor 7.
    3. For g∘f, starting at 3 gives f(3)=3, then g(3)=2. Starting at 4 gives f(4)=1, then g(1)=3.Both intermediate answers appear as accepted g inputs.
    4. Starting at 1 gives f(1)=6, and starting at 2 gives f(2)=8. Both paths stop before g.The complete g table accepts neither 6 nor 8.
    Answer
    • f ∘ g accepts exactly {1, 3}, meaning only inputs 1 and 3; its complete output table is pictured.
    • g ∘ f accepts exactly {3, 4}, meaning only inputs 3 and 4; its complete output table is pictured.
    Double-check There are four possible starting inputs for each order. Each order has two successful paths and two stopped paths, so every starting input has been accounted for.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: If f(5) is missing, guess the next output from a pattern.
    The displayed data does not establish a rule for new inputs.
    ✓ Instead: When the table lists every input the function accepts, 5 is outside its domain; when it shows selected samples, its value is unknown from the table.

    Tips and tricks

    • Write the intermediate input before deciding whether a path can finish.

    Part 4: The same function can receive its own answer

    You can visit the same drawer system twice. In p(p(3)), the first p receives 3. The second p receives the number from that first drawer. The two visits can use different columns. This is composition with the same function, rather than squaring its first output.

    • p(p(a)) means apply p to a, then apply p to the resulting output.
    • The second lookup must use an accepted p input.
    3p tablep tablefirstsecond02
    The same table is visited twice, with a new input for the second visit.

    Worked example

    Use the same table twice

    Find p(p(3)) in this complete p table. You put the first answer through p again. Plan: read p under 3, then move to p under the number it returns.

    input xoutput p(x)02142130
    x: 0, 1, 2, 3; p(x): 2, 4, 1, 0.
    Show the steps and the answer
    input xoutput p(x)02142130↓ evaluate: input given, read the output below it
    x: 0, 1, 2, 3; p(x): 2, 4, 1, 0, read at x = 3 and 0.
    input xoutput q(x)01132031
    x: 0, 1, 2, 3; q(x): 1, 3, 0, 1.
    1. p(3)=0.The innermost p acts on 3 first.
    2. p(p(3))=p(0)=2.The same function receives a new input, 0, on the second pass.
    Answer
    p(p(3)) = 2.
    Double-check Read backward: p returns 2 under input 0, and p returns 0 under input 3. Multiplying p(3) by itself would give 0, which answers a different question.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: p(p(3))=p(3)2=0.
    A square multiplies the first output by itself. A composition uses that output as a new input.
    ✓ Instead: p(3) = 0 and p(0) = 2, so p(p(3)) = 2.

    Tips and tricks

    • Write both lookups even when the function names match.

    5 How

    1. Read the nested notation and choose the inner table.
    2. Find the column labeled with the original input in that table.
    3. Read its output and write it as the intermediate value.
    4. Find that value among the input labels of the outer table, which may be a different column.
    5. Read the outer output. If either required input is absent from a complete table, the composition is undefined there.

    Evaluate or solve a composition from complete tables

    1
    Is the starting input given?
    YesEvaluate: read down in the inner table, then down in the outer table.
    NoThe final output is given: solve backward, reading upward from every matching output.
    ↓
    2
    Is a needed input missing from the next table?
    YesIf the table defines every accepted input, the composition is undefined there. If it gives selected samples, its value is unknown from this table.
    NoRead the matching output and continue.
    1. Rewrite the composition with parentheses. Identify the function nearest the starting input.
    2. For an evaluation, find the input in the inner table and read down to its output.
    3. Locate that in-between number in the outer input row and read down again.
    4. For a solve question, start from the requested final output, read up to every matching outer input, then find which inner inputs produce those numbers.
    5. Check by reading each claimed path forward. If a lookup is missing, distinguish a complete definition from selected samples.

    6 Worked example

    Worked example

    Both orders from the tables at input 3

    OpenStax problem

    The two pictures list every input accepted by f and g. Find f(g(3)) and g(f(3)). You start at input 3 and find the final output in each order. Plan: read the inner table first, write its answer, and use that answer as an input in the outer table.

    input xoutput f(x)16283341
    The same picture, shown 5 times now: x: 1, 2, 3, 4; f(x): 6, 8, 3, 1.
    input xoutput g(x)13253247
    The same picture, shown 5 times now: x: 1, 2, 3, 4; g(x): 3, 5, 2, 7.
    Show the steps and the answer
    input xoutput f(x)16283341↓ evaluate: input given, read the output below it
    In f, input 2 gives 8 and input 3 gives 3.
    input xoutput g(x)13253247↓ evaluate: input given, read the output below it
    In g, input 3 gives the intermediate value 2.
    1. For f(g(3)), read the column under 3 in the g picture: g(3)=2.g is the inner function in this expression.
    2. Move to the column under 2 in the f picture: f(2)=8.The intermediate answer 2 becomes the outer input.
    3. For g(f(3)), read the column under 3 in the f picture: f(3)=3.The reversed composition starts with f.
    4. Move to the column under 3 in the g picture: g(3)=2.The intermediate answer happened to equal the original input this time.
    Answer
    • f(g(3)) = 8.
    • g(f(3)) = 2.
    Double-check Read backward from the final answers. The 8 in f sits below input 2, and the 2 in g sits below input 3, so the first path is 3 → 2 → 8. For the other order, the 2 in g sits below 3, and the 3 in f sits below 3, so its path is 3 → 3 → 2.

    Ladder: from easy to exam-hard

    Try each rung before you open its steps.

    Rung 1 of 5

    One successful two-table path

    The pictured p and q tables list every accepted input. Find p(q(0)). You start at 0 and want the final answer. Plan: read q under 0, then p under its answer.

    input xoutput p(x)02142130
    The same picture again: x: 0, 1, 2, 3; p(x): 2, 4, 1, 0.
    input xoutput q(x)01132031
    The same picture again: x: 0, 1, 2, 3; q(x): 1, 3, 0, 1.
    Show the steps and the answer
    input xoutput p(x)02142130↓ evaluate: input given, read the output below it
    x: 0, 1, 2, 3; p(x): 2, 4, 1, 0, read at x = 1.
    input xoutput q(x)01132031↓ evaluate: input given, read the output below it
    x: 0, 1, 2, 3; q(x): 1, 3, 0, 1, read at x = 0.
    1. q(0)=1.The inner function q receives the starting 0.
    2. p(q(0))=p(1)=4.The output 1 from q selects the column under 1 in p.
    Answer
    p(q(0)) = 4.
    Double-check Read backward: output 4 in p belongs to input 1, and output 1 in q occurs under 0, confirming this path.

    Rung 2 of 5

    Reverse the table order

    Use these complete p and q tables to find q(p(0)). You start at 0 again, but p goes first. Plan: read p under 0, then q under the in-between answer.

    input xoutput p(x)02142130
    The same picture a third time: x: 0, 1, 2, 3; p(x): 2, 4, 1, 0.
    input xoutput q(x)01132031
    The same picture a third time: x: 0, 1, 2, 3; q(x): 1, 3, 0, 1.
    Show the steps and the answer
    input xoutput p(x)02142130↓ evaluate: input given, read the output below it
    x: 0, 1, 2, 3; p(x): 2, 4, 1, 0, read at x = 0.
    input xoutput q(x)01132031↓ evaluate: input given, read the output below it
    x: 0, 1, 2, 3; q(x): 1, 3, 0, 1, read at x = 2.
    1. p(0)=2.p is inner in q(p(0)).
    2. q(p(0))=q(2)=0.The first output 2 becomes the input of q.
    Answer
    q(p(0)) = 0.
    Double-check Output 0 in q occurs under input 2, and p gives 2 under input 0. A final output of 0 is a valid answer.

    Rung 3 of 5

    Use the same table twice

    Find p(p(3)) in this complete p table. You put the first answer through p again. Plan: read p under 3, then move to p under the number it returns.

    input xoutput p(x)02142130
    The same picture, shown 4 times now: x: 0, 1, 2, 3; p(x): 2, 4, 1, 0.
    Show the steps and the answer
    input xoutput p(x)02142130↓ evaluate: input given, read the output below it
    The same picture again: x: 0, 1, 2, 3; p(x): 2, 4, 1, 0, read at x = 3 and 0.
    input xoutput q(x)01132031
    The same picture, shown 4 times now: x: 0, 1, 2, 3; q(x): 1, 3, 0, 1.
    1. p(3)=0.The innermost p acts on 3 first.
    2. p(p(3))=p(0)=2.The same function receives a new input, 0, on the second pass.
    Answer
    p(p(3)) = 2.
    Double-check Read backward: p returns 2 under input 0, and p returns 0 under input 3. Multiplying p(3) by itself would give 0, which answers a different question.

    Rung 4 of 5

    A path cannot finish

    Find q(p(1)) from the complete tables pictured here. Determine whether both stages have an answer. Plan: find p(1), then look for that number in q’s input row.

    input xoutput p(x)02142130
    The same picture, shown 5 times now: x: 0, 1, 2, 3; p(x): 2, 4, 1, 0.
    input xoutput q(x)01132031
    The same picture, shown 5 times now: x: 0, 1, 2, 3; q(x): 1, 3, 0, 1.
    Show the steps and the answer
    input xoutput p(x)02142130↓ evaluate: input given, read the output below it
    The same picture again: x: 0, 1, 2, 3; p(x): 2, 4, 1, 0, read at x = 1.
    input xoutput q(x)01132031
    The same picture, shown 6 times now: x: 0, 1, 2, 3; q(x): 1, 3, 0, 1.
    1. p(1)=4.p is the inner function.
    2. q(4) is undefined in this complete table.The input row of q contains only 0, 1, 2, and 3, so it does not accept 4.
    Answer
    q(p(1)) is undefined.
    Double-check The value 4 appears in p’s output row, but never in q’s input row. The failed outer lookup confirms the stop.

    Rung 5 of 5

    Solve backward for every start

    Which starting inputs x satisfy p(q(x)) = 4 in these complete tables? The final output 4 is given; find every starting input producing it. Plan: read upward from 4 in p, then upward from the needed number in q.

    input xoutput p(x)02142130
    The same picture, shown 6 times now: x: 0, 1, 2, 3; p(x): 2, 4, 1, 0.
    input xoutput q(x)01132031
    The same picture, shown 7 times now: x: 0, 1, 2, 3; q(x): 1, 3, 0, 1.
    Show the steps and the answer
    input xoutput p(x)02142130↑ solve: output given, read every input above it
    x: 0, 1, 2, 3; p(x): 2, 4, 1, 0, solved for p(x) = 4.
    input xoutput q(x)01132031↑ solve: output given, read every input above it
    x: 0, 1, 2, 3; q(x): 1, 3, 0, 1, solved for q(x) = 1.
    1. Only p(1)=4, so q(x) must equal 1.The outer function must receive input 1 to return the requested output 4.
    2. The output 1 in q occurs under inputs 0 and 3.Solving from a table requires every match, rather than only the first one.
    3. Check x=0: q(0)=1 and p(1)=4. Check x=3: q(3)=1 and p(1)=4.Forward evaluation verifies that both claimed inputs give the requested final output.
    Answer
    • x = 0 or x = 3.
    • Solution set: {0, 3}.
    Double-check The other two starts fail the requested output: q(1) = 3 gives p(3) = 0, and q(2) = 0 gives p(0) = 2.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: f(g(3)) = f(3)·g(3) = 3 × 2 = 6.
    That is the product of two outputs, not the two-stage lookup.
    ✓ Instead: g(3) = 2, then f(2) = 8.
    ✗ Not this: The composite domain {1, 3} can be written [1, 3].
    The interval also includes 2 and 2.5, but neither is an accepted input of this complete composite.
    ✓ Instead: Write {1, 3}, which lists only the two accepted starting inputs.

    Tips and tricks

    • Put one finger on the inner output and another on the matching outer input.
    • Draw every table as an input row above an output row; use the intermediate answer to select the next column.
    • Rebuild, do not memorize: find the inner input on top, read down, then carry the number to the other table.

    7 The trap

    Reading the same input column in both pictures. The outer lookup uses the inner output, which can move you to a new column.

    Problems marked OpenStax come from Precalculus 2e by Jay Abramson, published by OpenStax, under the CC BY-NC-SA 4.0 licence. Access for free at https://openstax.org/books/precalculus-2e/pages/1-introduction-to-functions.