Let $X=(X_1,X_2) \in [0,1]×[0,1]$ and $Y \sim Bernoulli(p=X_1⋅X_2)$. The Bayes decision boundary $\{(x_1,x_2):P(Y=1|X=(x_1,x_2))=0.5\}$ in the regions $[0,1]×[0,1]$ whose points would be classified as $0$ and $1$.
The goal of this problem is to plot Bayes decision boundary and identify it in the above region.
I would appreciate it if someone will get me started on this problem.
I have been trying to do it in R (it is not necessarily using software) so I can visualize the problem, here is what I have so far:
n <- 10; a <- 0; b <- 1
x1 <- runif(n,a,b)
x2 <- runif(n,a,b)
p <- x1*x2
y <- ifelse(p > 0.50,1,0)
or should my x1 and x2 look like this :
n <- 10
x1 <- sample(0:1,n,replace = T)
x2 <- sample(0:1,n,replace = T)
p <- x1*x2
y <- ifelse(p > 0.50,1,0)


The bayes decision boundary is the set of points at which the probability of $Y=1$ given the values of $X_1, X_2$ is equal to 1/2:
$$P(Y=1 | X_1, X_2) = P(U>X_1X_2) = 1-X_1X_2$$
Where $U \sim Uni[0, 1]$ by the definition of $Y$. Set this equal to 1/2 and solve for $X_1$ in terms of $X_2$.
In python: