---
title: "McCulloch-Pitts network, AND, XOR"
subject: "Artificial Intelligence"
chapter: 6
key: "semester_6/artificial_intelligence:mcculloch-pitts-and-xor"
source: https://www.bctengineer.com/q/semester_6/artificial_intelligence/mcculloch-pitts-and-xor
site: BCT Engineering
---

# McCulloch-Pitts network, AND, XOR

Artificial Intelligence · Chapter 6: Machine Learning

- Asked in: 2075 Baisakh, 8 marks
- Video: [6. Implement XOR function using McCulloch–Pitts neuron Soft Computing Machine Learning Mahesh Huddar](https://www.youtube.com/watch?v=zcusbLaYj7Y) — Mahesh Huddar
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/artificial_intelligence/mcculloch-pitts-and-xor
- Whole chapter: https://www.bctengineer.com/md/semester_6/artificial_intelligence/chapter-6

## Question

What is a McCulloch/Pitts neural network? Explain it with reference to AND gate. Justify that it cannot be applied to Exclusive OR gate.

## Short answer

The McCulloch-Pitts neuron has binary inputs, fixed weights, and a threshold; it fires if net sum >= θ. For AND, use w1=w2=1, θ=2. XOR is not linearly separable, so a single M-P neuron cannot implement it; a multilayer network is needed.

## Answer

The **McCulloch-Pitts (M-P) neuron** (1943) is the first mathematical neuron model. Inputs and output are binary (0/1). Each input has a fixed weight (excitatory +, inhibitory −). The neuron fires (y = 1) if the net input Σ wᵢxᵢ is at least the threshold θ, otherwise y = 0. Weights and threshold are set by design, not learned.

```text
 x1 --(w1)-->\
              ( net ≥ θ ? )--> y
 x2 --(w2)-->/
```

#### AND gate with M-P neuron
Take w1 = w2 = 1 and θ = 2.

| x1 | x2 | net = x1 + x2 | y (net ≥ 2) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 2 | 1 |

This matches the AND truth table.

#### Why XOR cannot be done by a single M-P neuron
XOR must give: (0,0)→0, (0,1)→1, (1,0)→1, (1,1)→0. This needs
1. 0 < θ
2. w2 ≥ θ
3. w1 ≥ θ
4. w1 + w2 < θ

From (2) and (3) with θ > 0: w1 + w2 ≥ 2θ > θ, which contradicts (4). So no choice of weights and threshold works.

Geometrically, a single neuron separates the plane by one straight line; the XOR points (0,0),(1,1) and (0,1),(1,0) lie on opposite diagonals and no single line separates them (not linearly separable).

#### Solution
XOR can be built with two layers: XOR = (x1 AND NOT x2) OR (NOT x1 AND x2), i.e. M-P neurons for the hidden terms (weights +1, −1, θ = 1) combined with an OR neuron. So XOR needs a multilayer network.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. How does an M-P neuron work?
   A. It learns its weights by back-propagation
   B. It outputs the net input directly
   C. It fires when net input is below theta
   D. It fires (1) if the net input sum wi*xi is at least the threshold theta, with fixed weights
   Answer: D. Weights and threshold are designed, not learned. (Key point: M-P neuron)

2. Which setting gives AND?
   A. w1 = w2 = 1 and theta = 2
   B. w1 = w2 = 1 and theta = 1
   C. w1 = w2 = 0 and theta = 2
   D. w1 = w2 = 2 and theta = 0
   Answer: A. Only (1,1) reaches net = 2. (Key point: AND design)

3. How is XOR shown impossible?
   A. w1 + w2 must be negative
   B. w1 >= theta and w2 >= theta imply w1 + w2 >= 2 theta > theta, contradicting w1 + w2 < theta
   C. theta must be zero
   D. XOR has only one valid input
   Answer: B. The four conditions are inconsistent. (Key point: XOR proof)

4. What is the geometric reason?
   A. XOR points lie on one line
   B. XOR has too many inputs
   C. XOR points are not linearly separable by a single line
   D. XOR points are all equal
   Answer: C. Opposite diagonals cannot be separated by one line. (Key point: Geometric reason)

## Related in Artificial Intelligence

- [Perceptron; neural network as XOR gate](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Aperceptron-xor-gate) — Artificial Intelligence, chapter 6, asked 2×
- [Perceptron; neural network as OR gate](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Aperceptron-or-gate) — Artificial Intelligence, chapter 6, asked 2×
- [Role of perceptron in neural network](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Aperceptron-role) — Artificial Intelligence, chapter 6, asked 2×
- [Neural network; supervised vs unsupervised](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Ann-supervised-unsupervised) — Artificial Intelligence, chapter 6
- [Neural network; back-propagation](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Aneural-network-bp-algorithm) — Artificial Intelligence, chapter 6
- [Neural network, back-propagation, perceptron](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Ann-bp-perceptron) — Artificial Intelligence, chapter 6

## Related in other subjects

- [XOR gate using minimum NAND gates](https://www.bctengineer.com/question.md?key=semester_3%2Fdigital_logic%3Axor-using-nand-only) — Digital Logic, chapter 2, asked 2×
- [Short note: Neural network, perceptron rule](https://www.bctengineer.com/question.md?key=semester_7%2Fdata_mining%3Aneural-network-perceptron-note) — Data Mining, chapter 3
