Suppose I have $X,Y$ that are equal to one or zero.
Is it possible to formulate a binary variable that is equal to $1$ if both $X,Y$ have the same value (i.e. $X=0$, $Y=0$ or $X=1$, $Y=1$) or equal to $0$ if they are different (i.e. $X=1$, $Y=0$ or $X=0$, $Y=1$)
Something like $(2X-1)(2Y-1)$ is kind of close but not there.
Thank you!