Hello. Last lesson treated a workflow component as a function: it receives an input and produces an output according to a named rule. Real AI systems rarely make only one call or one calculation. A harness may score many candidates, make several model calls, accumulate token costs, or expand branches over several stages.
This lesson gives you two compact ways to write those repeated calculations:
- summation notation for repeated addition;
- product notation for repeated multiplication.
They are common in ML papers because they describe an operation over many items without listing every term individually.
Two symbols for repeated work

Suppose a workflow makes calls, and call uses tokens. The total token use is:
Read this aloud as:
“ equals the sum of , as runs from through .”
The large symbol , capital Greek sigma, means “add a collection of terms.” Its parts have precise jobs:
| Part | Meaning in the token example |
|---|---|
| Add the terms | |
| The index: a counter identifying the current call | |
| Start at call 1 | |
| Stop at call | |
| The token count for the current call | |
| The resulting total token count |
The bounds are inclusive. Therefore,
There are four terms, including both the first index value and the final value .
The corresponding notation for repeated multiplication is capital Greek pi:
Read it as:
“ equals the product of , as runs from through .”
Here means multiply rather than add:
The layout is deliberately parallel: the lower limit, upper limit, and index work the same way in sums and products. Only the operation changes.
The sum and product of finite sequences
Watch “The sum and product of finite sequences” by Dr. Trefor Bazett for a visual introduction to both notations. It establishes the common structure first, then contrasts adding terms with multiplying them.
Watch summation notation to see the index, starting limit, ending limit, and general term unpacked. Then watch product notation for the same structure applied to multiplication. Focus less on the particular sequence in the example and more on the repeated procedure: substitute each permitted index value, then add or multiply the resulting terms.
Summation: totals across calls, candidates, or steps
A sum represents an accumulated total. In system analysis, it is often the right notation whenever each item makes an additive contribution to a whole.
Suppose an agent runs four model calls with token counts:
Instead of writing the full expansion in the system specification, write:
To evaluate it, expand the index one value at a time:
So the workflow used tokens in total.
This notation scales. Whether a workflow makes four calls or four thousand, the structure remains:
The number does not need to be known when you first write the model. It may be an input, a configuration limit, or an output of routing logic. The expression says: take every call that occurred, identify its token use, and add those values.
A more realistic cost model
Token usage alone is not always the quantity you ultimately care about. Let:
- be input tokens on call ;
- be output tokens on call ;
- be input-token price for call ;
- be output-token price for call .
Then total cost can be modeled as:
The parentheses matter. For each call , first calculate its input cost plus output cost. Then sum the costs over all calls.
This is a good example of why an index is useful. The index identifies the call whose quantities belong together:
The summation accumulates those per-call costs.
A unit check confirms the model:
Each parenthesized term is measured in dollars, so their sum is also measured in dollars.
The index changes; other quantities do not
The most frequent reading mistake is substituting into every letter in the expression. Only the symbol named below the summation sign changes.
For example:
has index . During the expansion, remains fixed while changes:
If is a common fixed price per token, you may factor it outside the sum:
This compactly states a useful system fact: under a fixed price, total cost is price per token times total token count.
If calls use different models or different prices, retain the call-specific price :
Now each call may have its own token price.
Summation notation (also called sigma notation) (article)
Read Khan Academy’s “Summation notation” to reinforce how an index is substituted through its full inclusive range, and how to avoid confusing the index with another variable.
In “Unpacking the meaning of summation notation,” read the worked example beginning with the expansion. Notice that the index takes one integer value at a time. Then, later in the article, find the paragraph beginning “Some summation expressions have variables other than the index.” Read the index distinction through the key takeaway. In the workflow formulas above, compare its fixed k with a fixed price such as p, while the index i is the quantity that changes.
When a sum is and is not appropriate
A sum of latencies is valid when calls occur sequentially:
where is the latency of call .
But do not automatically sum latency when calls run in parallel. If three retrieval calls launch together, end-to-end waiting time depends primarily on the slowest branch, not on the sum of all three branch times. The notation should follow the system’s actual execution structure, rather than merely count the components. You will model dependency and execution order explicitly in the next lesson.
Product notation: repeated scaling or branching
A product represents a quantity built by multiplying successive factors. This appears when each stage scales, filters, or expands what came from the preceding stage.
Suppose a recursive workflow branches by a different fixed factor at each of three depths:
- depth 1: each active task produces child tasks;
- depth 2: each child produces more;
- depth 3: each produces more.
Let the branching factors be:
The number of tasks at the third depth is:
Expand it:
This is not a total of all calls throughout the workflow. It is the number of terminal tasks produced after all three multiplicative expansion stages. A total across depths usually requires a sum as well; later, geometric series will provide a compact way to model that situation.
A workflow retention example
Products also model repeated retention or reduction. Imagine that a pipeline applies three filters to a candidate pool:
- relevance filter retains ;
- policy filter retains ;
- deduplication retains .
Write the retention fractions as:
The overall retained fraction is:
Thus the pipeline retains of the original candidates. If it begins with candidates, the simplified model predicts:
candidates after all filters.
The product expresses an important systems intuition: several seemingly modest reductions can combine into a substantial overall reduction. Conversely, repeated branching factors can produce rapid growth.
Choosing the notation from the workflow meaning
The notation is compact, but it should never hide what is being calculated. Before writing a sigma or product sign, state the per-item quantity in a sentence.
| If the workflow asks… | Typical notation | Meaning |
|---|---|---|
| “What is the total across calls?” | Add each call’s contribution | |
| “How many tokens were used?” | Add token counts | |
| “What is total cost with varying prices?” | Add per-call costs | |
| “How much does each stage multiply the count?” | Multiply scaling factors | |
| “What fraction survives every filter?” | Multiply retention fractions |
There is one further distinction worth keeping clear: multiplying outputs is not the same as executing functions in sequence.
If a workflow stage transforms a state, a sequential pipeline might be described by:
These equations mean that the output of one function becomes the input to the next. By contrast,
means multiply the numerical factors , , and . Product notation is appropriate only when multiplication is the meaningful operation.
A reliable reading procedure for either notation is:
- Identify the operation: does the large symbol mean add or multiply?
- Find the index and bounds: which values does the index take, including both endpoints?
- Write the first two terms and the last term: this checks that the pattern and limits are understood.
- Keep all non-index symbols fixed while expanding.
- Interpret the final unit: tokens, dollars, candidates, or a unitless fraction.
Wrap-up
Summation and product notation are compact descriptions of repeated work:
- means add a term for every index value in an inclusive range.
- means multiply a factor for every index value in an inclusive range.
- The index changes; other symbols remain fixed unless they also carry that index.
- Sums naturally model totals such as tokens, costs, and sequential work.
- Products naturally model repeated scaling, branching, and retention.
- The notation must match the workflow’s actual structure, particularly when parallel work is involved.
Next, you will turn a group of workflow equations into a dependency graph, then use that graph to determine which values can be computed first and which outputs depend on them.
Can't find a good explanation? Sign up and we'll make it for you
Sign up