# Computing composite functions

This may not be strictly a computer science question but is related.

Whenever there is some function that computes more than two elements, is it possible that all elements are computed at once? Or is computing in composite/series a required limitation of the brain?

For instance, to add three numbers, we add two and then and the third to the result of the first addition. Is it possible for the brain to take all three numbers and process them at once with no intermediate step? Is it possible for machines? Is it possible with quantum computing?

In the case of the brain's inability to make this computation, is it because we are trained to compute in a certain way or is it an inherent limitation?

• What do you mean by "at once". Afaik, even sophisticated hardware cannot make additions of two numbers in a single step, I mean going through a single level of logical gates. I am no hardware specialist, but my guess is that going through 2 levels of gates takes twice the time. And nothing is instantaneous, even in the human brain. So I do not understand what you mean. Oct 8, 2014 at 13:43
• When adding two large numbers (say 26459897+138974), do you consider this a single step? You need to go through all digits from right to left. Adding a third number is neither more nor less difficult than inserting more digits at the front. Sep 6, 2016 at 8:54
• Please improve your title: 1) it should be the question you're asking and 2) to me, a composite function is a function created by chaining other functions together: e.g. h(x) = f(g(x) for all x. Sep 12, 2016 at 21:02
• For the brain part - it is a vast network of parallel networks, contrary to common sense the parallel operations are more natural, so it comes almost exclusively from the whole school experience, where people are trained in serial manner and convergent thinking (it supresses creativity and makes misbeliefs about limits). But to perform some task with exact result you have to know algorithm and be proficient at it, then comes the training. Second problem is usefulness of such operation, people the most of the time aim at optimizing task they focus at, so little experience from everyday tasks...
– Evil
Sep 12, 2016 at 23:01
• @babou, no motion is instantaneous, because motions occur across a time span. A motion can begin instantaneously with another motion. Also thought may be instantaneous, even though the impingement of thought upon the material universe (whether via the brain, electronic gadgetry or telekinesis) to bring about motion, implicitly involves time. Sep 14, 2016 at 1:21

Definitely possible for a computer, since three-input logic gates exist. Possible for humans too, at least as far as conscious operations are concerned. If you show me a partition of 13 into no more than 4 parts (e.g. 5+3+4+1), I can recognize it without any intermediate calculation simply from long experience playing bridge.

Whenever there is some function that computes more than two elements, is it possible that all elements are computed at once? [...] For instance, to add three numbers, we add two and then and the third to the result of the first addition.

If your question is, "is it possible to add numbers in parallel?" then the answer is yes, since addition is associative. I.e., the serial approach would be (a+(b+(c+...))), and one parallel approach could be (a+b)+(c+d), in which a+b and c+d can be computed independently before being added together.

If your question is, "can I add three numbers in such a way that I begin operating on the third number before I'm done operating on the first two?" then the answer is yes, since addition typically works from the least towards the most significant digit. Once the least significant digits of the first two numbers have been added, and the result has been carried, the least significant digit of the third number can be added, and the result likewise carried.

Or is computing in composite/series a required limitation of the brain? [...] Is it possible for the brain to take all three numbers and process them at once with no intermediate step? Is it possible for machines? Is it possible with quantum computing?

I'm not sure if your question really relates to adding numbers, inherent properties of computation, or analogies between modern-day computers and human brains. I'm also not sure what you mean by "no intermediate step". Are you?

The brain is indeed a parallel processor. Unfortunately, you have reached the wrong forum for such a question, although I can tell you that slapping "quantum" onto an ill-understood problem does not make it more solvable, so don't do that. ;-) See for example the question/answer Difference between parallel processing done by human brain and by computers on the Cognitive Sciences Stack Exchange.

In the case of the brain's inability to make this computation, is it because we are trained to compute in a certain way or is it an inherent limitation?

We do compute in certain ways, in part because of training. I don't know if anyone has ever practiced adding numbers in parallel, but I imagine one approach would be visual/geometric, like this trick for multiplying:

I think this is partly a matter of definition: what sorts of processes are we willing to call "a computation"?

Let's suppose we're charged with the task to compute, given any natural number $n$, the $n$th Fibonacci number. It is defined as follows: if $F(n)$ stands for the $n$th Fibonacci number, then $F(1) = F(2) = 1$ and $F(n) = F(n-1) + F(n-2)$ for all $n > 2$.

We could actually define it that way in most programming languages. For instance, in C:

int fibonacci(int n)
{
if (i < 2)
{
return 1;
}
else
{
return fibonacci(n-1) + fibonacci(n-2);
}
}


This is a valid (and inefficient) way to compute Fibonacci numbers in C.

But does it define a computation to compute the $n$th Fibonacci number? You tell me.

In C, the order of evaluation of arguments of + is undefined. One implementation may always evaluate the left operand first, then the right. Another may choose an evaluation order depending on the weather. Yet another may evaluate them in parallel (I do believe this is valid). C programs mostly run in multiprocessing environments, so a parallel implementation could actually be implemented most of the time.

Let's suppose you use such a parallel implementation. It is certainly a way to compute the $n$th Fibonacci number. But is it "a computation"? I'm not sure. I think for most of us, a computation is a stepwise process, executed by a single processor strictly sequentially, one step at a time. Not because computation must be done that way (that isn't the case) but because we don't call the process "a computation" otherwise.

Modern computers and the human brain don't quite work strictly sequentially. It's our conception of computation, an abstraction of what really happens, that does. We say a computer or a human brain performs computation when it does something that is equivalent to what that abstraction does - even when how it actually does it deviates from that.

This is part of why the human brain finds it difficult to come to terms with inherently concurrent or parallel computational processes. We're trained to think of computation as a strictly sequential single-processor process.

If you want to meet a different perspective on computation, familiarize yourself with dataflow processing, e.g. Unix pipes, or typical setups for signal processing, such as audio and video processing. What those systems do is computation, and it is a pretty mainstream way of using computers, but it is not adequately described by Turing machines.

• I mean when you think to add 3 numbers in your head, are you adding 2 of them first and then the third one or can you add all 3 simultaneously without an intermediate value.
– Mars
Sep 27, 2016 at 16:14
• I think it depends on the numbers. 1 + 1 + 1 is immediate for me. Sep 27, 2016 at 17:21