TransWikia.com

Finding variable values to make equations behave like boolean gate

Data Science Asked by anir on July 14, 2021

I came across following problem:

Consider the following simple perceptron, for which the inputs are the always $1$ feature and two binary features $x_1 ∈ {0, 1}$ and $x_2 ∈ {0, 1}$. The output $y ∈ {0, 1}$.
$$y=begin{cases}
1, & text{if $w_0+w_1.x_1+w_2.x_2>0$ }
0, & text{otherwise}
end{cases}$$

Choose all the correct option below that the weights $w_0,w_1,w_2$ should satisfy such that $y=(x_1 text{ AND } x_2 )$.
(A) $w_0>0$ (b) $w_0≤0$ (c) $w_1>0$ (d) $w_2>0$

I tried to solve the problem and came up with following:

enter image description here

(Eqn# stands for Equation# in above table)
Eqn#4 $= w_0≤0$ (Option B)
Eqn#2 $→w_0≤-w_1$ (Eqn#5)
Eqn#3 $→w_0≤-w_2$ (Eqn#6)
Eqn#1 $→ 0>-w_1-w_2-w_0$
$→ 0>-w_1+(non-ve)$ … from Eqn#3
$→ -(non-ve)>-w_1$
$→ -ve>-w_1$
$→ w_1>0$ (Option C)
Similarly from Equation 4 and 2, it can be proven that $w_2>0$ (Option D)

But I feel something is wrong with above. I feel option B contradicts with both option C and option D. For example, option C and Eqn#5 makes $w_0=0$ impossible which is allowed by option B. Where did I made mistake? I feel its incorrect to directly conclude $w_0leq 0$ from Eqn#4 and "stop". What I mean is that I have to continuously keep checking if all facts that I conclude lead to desired effect "together". For example, once I got that option (c) is correct, I have to combine Option C fact with Eqn#4 fact to conclude that $w_0<0$. So finding solution to such problems is kind of continuous process till we get all equations which satisfy each other and target goal (AND gate here). Q1. Am I correct with this? Or I am unnecessarily making things difficult and there is simpler and more importantly "straight forward" way (not involving continuously checking if all equations satisfy each other) to find such solutions?

Q2. This does also mean that Option B should have $<$ instead of $leq$. Am I correct with this too?

PS:

After getting confused like me, some of my friends have started saying it should be $geq$ instead of $gt$:

$$y=begin{cases}
1, & text{if $w_0+w_1.x_1+w_2.x_2color{red}{geq}0$ }
0, & text{otherwise}
end{cases}$$

But I dont feel so as I can still find correct answer with given problem with conclusion that option B should have $<$ instead of $leq$. Also I dont feel its correct for a function to interpret $0$ as $True$. Q3. Am I correct with this too? (problem doesnt need correction, but option B)

One Answer

You can only have $w_0 < 0$. If $w_0 = 0$, then eq 1,2,3 imply that $$ 0 < w_{1,2} leq 0 $$ which is a contradiction. Hence option b) is incorrect.

Answered by Benoit Descamps on July 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP