Related question: Tell Wolfram Alpha that a variable is a natural number
I want to do the following in Wolfram Alpha:
Minimise
$$z = (y_1-x_1)+(x_2-y_2)+(1/2)(x_3)$$
s.t.
$$0 \le x_1 \le y_1$$
$$y_2 \le x_2 \le 2y_2$$
$$2y_3 \le x_3 \le 3y_3$$
$$y_1+y_2+y_3=1$$
$$y_1, y_2, y_3 \in \{0,1\}$$
$$x_1,x_2,x_3 \ge 0$$
It seems pretty long so I kind of converted
$$0 \le x_1 \le y_1$$
$$y_2 \le x_2 \le 2y_2$$
$$2y_3 \le x_3 \le 3y_3$$
$$y_1, y_2, y_3 \in \{0,1\}$$
$$x_1,x_2,x_3 \ge 0$$
into
$$0 \le x_1 \le y_1 \le 1$$
$$\color{red}{0 \le} y_2 \le x_2 \le 2y_2 \color{red}{\le 2}$$
$$\color{red}{0 \le} 2y_3 \le x_3 \le 3y_3 \color{red}{\le 3}$$
$$\color{red}{y_1, y_2, y_3 \ \text{is an integer}}$$
Anyway, I typed
minimize (y1-x1)+(x2-y2)+(1/2)*(x3), 0 <= x1 <= y1 <= 1, 0 <= y2 <= x2 <= 2*y2 <=2, 0 <= 2*y3 <= x3 <= 3*y3 <= 3, y1+y2+y3=1
That works but this
minimize (y1-x1)+(x2-y2)+(1/2)*(x3), 0 <= x1 <= y1 <= 1, 0 <= y2 <= x2 <= 2*y2 <=2, 0 <= 2*y3 <= x3 <= 3*y3 <= 3, y1+y2+y3=1, $\color{red}{\text{y1 is an integer}}$
doesn't work.
Help please.