# Reductions (Computer Science)
A reduction in computer science (`reduce` in python) is most easily explained via the following example:
```python
x = 5
funcs = [x, x**2, x**3]
>> reduce(lambda val, func: func(val), funcs, x)
15,625
# In detail
output1 = funcs[0](5) >> 5
output2 = funcs[1](5) >> 25
output1 = funcs[2](25) >> 15,625
```
`reduce` starts with an initial value, `x` - the third argument, and then it loops over a list of functions, `funcs` - the second argument. It iteratively passes the output of a function to the next functions, whose output it subsequently passed forward.
---
Date: 20230918
Links to:
Tags:
References:
* [Lesson 14: Deep Learning Foundations to Stable Diffusion - YouTube](https://youtu.be/veqj0DsZSXU?t=1536)