# Biological neurons and the McCulloch-Pitts model

Subject: Deep Learning

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/#tee/read/4/tee-c4-s21

Canonical: https://deep-learning-study-room.vercel.app/read/dl/tee/section/tee-c4-s21/

**Definition.** An artificial neuron is a simplified computational model inspired by the collection, combination and transmission of signals in biological neurons. This analogy motivates weighted inputs and an output response; it is not a full simulation of a living neuron.

### Biological and artificial components

| Biological component | Simplified artificial counterpart | Function in the analogy |
| --- | --- | --- |
| Dendrites | Input connections | Receive incoming signals |
| Synapses | Connection weights | Influence how strongly each incoming signal contributes |
| Cell body or soma | Aggregation stage | Combines the weighted signals |
| Firing behavior | Threshold or activation function | Determines the model's output response |
| Axon | Output connection | Passes the resulting signal onward |

For an artificial threshold unit, a threshold θ on the weighted sum can be written as a bias b = −θ, followed by a threshold at zero. The equality convention must be preserved.



$$
\sum_i w_ix_i\ge\theta\quad\Longleftrightarrow\quad\sum_i w_ix_i-\theta\ge0
$$



### McCulloch–Pitts model and perceptron

The McCulloch–Pitts model is an early binary threshold model. Its logical connections and threshold are prescribed to implement a desired behavior; it has no data-driven weight-update procedure. The original formulation also distinguishes excitatory inputs from inhibitory inputs, which can prevent firing. In elementary logic-gate examples using only excitatory inputs, a threshold on their sum is sufficient.

A perceptron introduces adjustable connection weights and a learning rule. It calculates a weighted sum, applies a threshold and updates parameters when its classification disagrees with the target. Both single threshold units have a linear decision boundary; neither single unit solves XOR in the original two-input space.

**Question. Implement AND and OR for binary inputs x₁, x₂ using the sum x₁ + x₂ and output 1 when the sum is at least θ. Use θ = 2 for AND and θ = 1 for OR.**

### Given

Implement AND and OR for binary inputs x₁, x₂ using the sum x₁ + x₂ and output 1 when the sum is at least θ.

Use θ = 2 for AND and θ = 1 for OR.

### To find

Write every row of the truth table and the requested network output.

### Formula — which one and why

**Threshold logic.** Compute the weighted sum for every binary input combination and apply the threshold rule exactly. Hidden neurons can provide separate threshold decisions before the output combines them.

step(z) returns 1 at or above zero unless the question specifies a strict inequality; otherwise it returns 0.



$$
z=\sum_iw_ix_i+b
$$





$$
\operatorname{step}(z)=\begin{cases}1&z\ge0\\0&z<0\end{cases}
$$



**Yaad rakhne ka cue:** Har input row ka sum nikalo, phir threshold lagao.

### Solution — step by step

Calculate the sum once for each input pair, then compare it with the relevant threshold.

### Binary input (0,0)

**Step 1: add the inputs.**



$$
s=0+0=0
$$



**Step 2: compare with AND threshold 2.**

0 ≥ 2 is false; AND output = 0.

**Step 3: compare with OR threshold 1.**

0 ≥ 1 is false; OR output = 0.

### Binary input (0,1)

**Step 1: add the inputs.**



$$
s=0+1=1
$$



**Step 2: compare with AND threshold 2.**

1 ≥ 2 is false; AND output = 0.

**Step 3: compare with OR threshold 1.**

1 ≥ 1 is true; OR output = 1.

### Binary input (1,0)

**Step 1: add the inputs.**



$$
s=1+0=1
$$



**Step 2: compare with AND threshold 2.**

1 ≥ 2 is false; AND output = 0.

**Step 3: compare with OR threshold 1.**

1 ≥ 1 is true; OR output = 1.

### Binary input (1,1)

**Step 1: add the inputs.**



$$
s=1+1=2
$$



**Step 2: compare with AND threshold 2.**

2 ≥ 2 is true; AND output = 1.

**Step 3: compare with OR threshold 1.**

2 ≥ 1 is true; OR output = 1.

### Truth-table summary

| x₁ | x₂ | x₁ + x₂ | AND: sum ≥ 2 | OR: sum ≥ 1 |
| --- | --- | --- | --- | --- |
| 0 | 0 | 0 + 0 = 0 | 0 | 0 |
| 0 | 1 | 0 + 1 = 1 | 0 | 1 |
| 1 | 0 | 1 + 0 = 1 | 0 | 1 |
| 1 | 1 | 1 + 1 = 2 | 1 | 1 |

The parameters have been chosen to implement the truth tables. This calculation is a logic-gate evaluation, not a perceptron training epoch.
