I am trying to find a function that compares two variables. When these two variables are equal, the function should equal 1. For any other value, the function should equal 0. Is there a way to do this without using logic arguments?
My naive attempt to do this uses floor and ceiling notation (possibly incorrectly) where I end up using logic to get my result. Here is my best attempt:
min[max[1+x-y,0],max[1+y-x,0]]
Is there a way to write this as a function without the floor/ceiling max/min logic?
$$f(x,y)=\begin{cases}1&x=y\\ 0&x\neq y \end{cases}$$