+10 XP

Vector Addition

WHY: A real neuron doesn't receive input from just one source. Your visual cortex receives signals from your left eye AND your right eye. Both arrive and add together. That combining IS vector addition.

When adding two vectors, you add corresponding components — component by component:

Left eye input: [10, 5, 2]
Right eye input: [3, 8, 1]
Total input: [13, 13, 3]

Geometrically, vector addition is tip-to-tail. In essence, you are moving the second vector so its base is at the tip of the first — without changing its direction. The resulting vector goes from the origin to where you end up.

Diagram showing two vectors added tip-to-tail. The second vector is moved so its base sits at the tip of the first, and the result is the vector from the origin to the final tip.

Tip-to-tail: slide the second arrow to start where the first one ends. The sum is the shortcut from start to finish.

python
import numpy as np

left_eye  = np.array([10, 5, 2])
right_eye = np.array([3, 8, 1])

total_input = left_eye + right_eye
print(total_input)  # [13, 13,  3]

NumPy addition is component-wise. No loops needed — Python handles it automatically.