Deep Learning · TEE · section
R23 Q1e
Re examination January 2023 fully solved
Question
Question (4 marks). Design a perceptron network for inputs 00 → 0,10 → 0,01 → 0,11 → 1; choose suitable weights.
Answer — step by step
Given
Truth table: 00→0,10→0,01→0,11→1.
Weights and bias are to be designed.
To find
Choose a perceptron that implements AND and show its four outputs.
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
Choose weights w₁ = w₂ = 1 and bias −1.5. Use output 1 for z ≥ 0.
Input (0, 0)
Step 1: multiply input 1 by its weight.
1(0)=0Step 2: multiply input 2 by its weight.
1(0)=0Step 3: add the two products.
s=0+0=0Step 4: add the bias once.
z=0+(-1.5)=-1.5Step 5: apply the stated threshold.
z = -1.5; output = 0 because output is 1 exactly when z ≥ 0.
Input (0, 1)
Step 1: multiply input 1 by its weight.
1(0)=0Step 2: multiply input 2 by its weight.
1(1)=1Step 3: add the two products.
s=0+1=1Step 4: add the bias once.
z=1+(-1.5)=-0.5Step 5: apply the stated threshold.
z = -0.5; output = 0 because output is 1 exactly when z ≥ 0.
Input (1, 0)
Step 1: multiply input 1 by its weight.
1(1)=1Step 2: multiply input 2 by its weight.
1(0)=0Step 3: add the two products.
s=1+0=1Step 4: add the bias once.
z=1+(-1.5)=-0.5Step 5: apply the stated threshold.
z = -0.5; output = 0 because output is 1 exactly when z ≥ 0.
Input (1, 1)
Step 1: multiply input 1 by its weight.
1(1)=1Step 2: multiply input 2 by its weight.
1(1)=1Step 3: add the two products.
s=1+1=2Step 4: add the bias once.
z=2+(-1.5)=0.5Step 5: apply the stated threshold.
z = 0.5; output = 1 because output is 1 exactly when z ≥ 0.
Final answer: outputs are [0, 0, 0, 1] for inputs 00, 01, 10, 11: exactly AND.
A hidden layer is unnecessary for this linearly separable truth table.