How to write an equation that's nested?

201 Views Asked by At

Let's say I have an equation that's nested:

$$ \displaystyle x = f\left(f\left(f\left(f\left(f\left(i, a_4\right), a_3\right), a_2\right), a_1\right), a_0\right) $$

If I wanted to write this equation where it's nested from $a_k$ to $a_0$ without writing out all the terms, how would I denote it?

3

There are 3 best solutions below

0
On

I can think of two possibilities. One is

$$ x = f(f(\cdots f(f(i, a_k), a_{k-1}), \ldots, a_1), a_0) $$

and the other is

$$ x = b_0 $$

where

$$ b_j = f(b_{j+1}, a_j) \qquad 0 \leq j < k $$ $$ b_k = f(i, a_k) $$

4
On

You could write e.g. write $x = f(\ldots f(f(i,a_k),a_{k-1})\ldots ,a_0)$

or alternatively define $g_n (y) := f(y,a_n)$ and write the equation as $$x = \left(\bigcirc_{n=0}^k g_n\right)(i)$$

0
On

Depending on the audience (if they're coming from a slightly more computer-scientific background), treating as the function foldl could perhaps be the clearest. See also How to write a functional fold in mathematics?