AI 100 | Chapter 4 Concept Deck
McCulloch-Pitts Neurons & Finite Automata
From one binary decision to a machine that remembers a sequence.
Use the arrow keys, Space, or the buttons to navigate
Mental model
Three levels of computational power
Boolean circuit
Question: What output follows from the current input?
Memory: None
Neural analogy: Feedforward network
Finite automaton
Question: What state follows from the old state and current symbol?
Memory: One of finitely many states
Neural analogy: Recurrent network
Turing machine
Question: What can be computed with writable external memory?
Memory: Unbounded tape
Relation: Automaton + external memory
Prerequisite
Boolean logic is the neuron’s vocabulary
| A | B | AND | OR | XOR |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 |
- AND: all required conditions are true.
- OR: at least one condition is true.
- NOT: flips 0 and 1.
- XOR: inputs differ.
- {AND, OR, NOT} is complete: together they can express every Boolean function.
McCulloch-Pitts neuron
A weighted vote followed by a threshold
Inputs xi
Binary facts: each is 0 or 1.
Weights wi
Positive encourages firing; negative inhibits it.
Threshold θ
The minimum weighted sum needed to output 1.
Calculation routine
Never guess: use the same four steps
- Multiply each input by its weight.
- Add the products to obtain s.
- Compare using s ≥ θ.
- Return the binary output y.
Worked example
x1=0, x2=1; w1=w2=1; θ=1
Canonical neuron 1
AND requires both votes
The maximum sum is 2. Therefore, the neuron fires only when both inputs are 1.
| x1 | x2 | s | s ≥ 2? | y |
|---|---|---|---|---|
| 0 | 0 | 0 | No | 0 |
| 0 | 1 | 1 | No | 0 |
| 1 | 0 | 1 | No | 0 |
| 1 | 1 | 2 | Yes | 1 |
Canonical neurons 2-3
OR needs one vote; NOT uses inhibition
OR
Any single input of 1 reaches the threshold.
00 → 0; 01, 10, 11 → 1
NOT
x=0: s=0 ≥ -0.5 ⇒ y=1
x=1: s=-1 < -0.5 ⇒ y=0
Threshold behavior
A 2-of-3 majority neuron
| Inputs | Sum | Output |
|---|---|---|
| 000 | 0 | 0 |
| 001, 010, 100 | 1 | 0 |
| 011, 101, 110 | 2 | 1 |
| 111 | 3 | 1 |
The threshold divides all possible inputs into two groups:
- Weighted sum below 2 → output 0
- Weighted sum at least 2 → output 1
Limitation
Why one neuron cannot compute XOR
| x1 | x2 | XOR |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
A single threshold unit creates one straight decision boundary.
For XOR, the two positive points are diagonally opposite. No one line separates them from both negative points.
Networks
Multiple neurons solve what one neuron cannot
Layer 1A
Compute x1 OR x2.
Layer 1B
Compute NOT(x1 AND x2).
Layer 2
AND the two intermediate results.
Neuron question checkpoint
What the official questions are testing
Finite automata
A machine with a small, fixed memory
- Begin in the start state.
- Read one input symbol.
- Follow that symbol’s transition.
- Repeat until the entire finite string is read.
- Accept iff the final state is accepting.
The state is the memory
The machine does not store the whole input. Its current state summarizes only the past information relevant to the task.
Diagram language
Read the symbols before tracing
Start
An arrow from nowhere marks the start state.
Accept
A double/concentric circle marks an accepting state.
Transition
The edge label tells which input causes the move.
Core example
Remember whether the number of 1s is odd
Reading 1 toggles: even becomes odd; odd becomes even.
Reading 0 loops: it does not change the number of 1s.
Trace, do not eyeball
Does the odd-1s machine accept 11010?
| Read | Old state | New state |
|---|---|---|
| 1 | Even | Odd |
| 1 | Odd | Even |
| 0 | Even | Even |
| 1 | Even | Odd |
| 0 | Odd | Odd (accept) |
Language and termination
What does the machine accept?
Language
The language is the set of all strings accepted by the machine.
Odd-1s examples: 1, 10, 01, 111, 11010.
Finite-automaton languages are called regular languages.
Infinite ordinary input
The machine decides only when the input ends.
If the string never ends, it continues changing states and never produces the ordinary final accept/reject decision.
Counting with finite state
Multiples of 3 require only three states
Let each state remember the number of 0s modulo 3:
- q0: remainder 0 — accepting
- q1: remainder 1
- q2: remainder 2
Reading 0 advances q0→q1→q2→q0. Reading 1 loops.
How to identify the language
- Determine what each state summarizes.
- See which symbols change that summary.
- Interpret the accepting state.
Counting progress
At least three a’s
States 0,1,2 record progress. State 3 means “at least three a’s have occurred.”
Designing an automaton
Accept exactly 101 — and nothing else
Each state means “this much of 101 has been matched.”
- q0: nothing matched
- q1: matched 1
- q2: matched 10
- qA: matched exactly 101
The missing piece: sink state
Every wrong symbol goes to a rejecting sink qD.
Any extra symbol after qA also goes to qD.
qD loops on both 0 and 1.
Official tracing questions
Use a state table for Review Q39-41
Review Q39
Trace input 100101 from start A.
Final: C, accepted.
Review Q40
Test each candidate until one finishes in D.
Accepted: 0100101.
Review Q41
A and B accept; D is a rejecting trap.
Accepted: 1010.
Limits of finite memory
What finite automata can and cannot remember
Can recognize
- Odd/even count
- Count modulo 3
- Ends with 01
- Contains 101
- At least three a’s
Cannot generally recognize
- Arbitrarily balanced parentheses
- 0n1n for arbitrary n
- Arbitrary palindromes
- Exact unbounded counts
A finite number of states can remember only a finite set of summaries.
From finite automaton to Turing machine
External writable memory changes the model
Finite automaton
Reads one symbol at a time and changes finite state.
Cannot rewrite input or revisit arbitrary stored information.
Turing machine
Adds an effectively infinite tape and a read/write head.
Can write symbols and move left or right.
The conceptual bridge
How neurons implement an automaton
Use one neuron (or bit pattern) to represent each state:
- Et=1: currently even
- Ot=1: currently odd
- It: current input symbol
Complete exam map
Every relevant official question
Final checklist
What you should be able to do without notes
McCulloch-Pitts
- Compute s=Σwixi
- Apply s ≥ θ
- Construct AND, OR, NOT
- Explain why XOR needs a network
Finite automata
- Identify start and accept states
- Trace one transition per symbol
- Describe the accepted language
- Design progress and sink states