B Binary variables (Absolute values)

Click For Summary
The discussion centers on the formulation of absolute values using binary variables in mixed-integer programming (MIP). The user questions the significance of the bolded "2" in the MIP formulation, suggesting that the expected range of values should be between 0 and 1. They analyze the equations provided and conclude that the range appears to extend to 2 under certain conditions. The inquiry highlights confusion regarding the implications of the binary variables and their relationship to the absolute value calculations. Clarification is sought on whether the range indeed exceeds the expected limits.
Rev. Cheeseman
Messages
359
Reaction score
23
TL;DR
The value is from 0 to 1, but what do these 2s represent?
Hello,

According to https://www.fico.com/fico-xpress-op.../mipform/dhtml/chap2s1.html?scroll=ssecabsval the formula for absolute values are :

y = | x1 - x2| for two variables x1, x2 with 0 ≤ xi ≤ U

Introduce binary variables d1, d2 to mean
d1 : 1 if x1 - x2 is the positive value
d2 : 1 if x2 - x1 is the positive value

MIP formulation
0 ≤ xi ≤ U [1.i]
0 ≤ y - (x1-x2) ≤ 2 · U · d2 [2]
0 ≤ y - (x2-x1) ≤ 2 · U · d1 [3]
d1 + d2 = 1 [4]

Notice the bolded 2s above in the MIP formulation section, what do these 2s represent? I thought the range of the value is just 0 to 1.
 
Physics news on Phys.org
Consider <br /> y - (x_1 - x_2) = |x_1 - x_2| - (x_1-x_2) = \begin{cases}<br /> 0 &amp; x_1 \geq x_2\quad (d_2 = 0)\\<br /> 2|x_1 - x_2| &amp; x_1 &lt; x_2\quad (d_2 = 1).\end{cases} Therefore 0 \leq y - (x_1 - x_2) \leq 2Ud_2.
 
pasmith said:
Consider <br /> y - (x_1 - x_2) = |x_1 - x_2| - (x_1-x_2) = \begin{cases}<br /> 0 &amp; x_1 \geq x_2\quad (d_2 = 0)\\<br /> 2|x_1 - x_2| &amp; x_1 &lt; x_2\quad (d_2 = 1).\end{cases} Therefore 0 \leq y - (x_1 - x_2) \leq 2Ud_2.

Ok, I'm sorry if I sounds ignorant but the range of value is still 0 to 1, and not from 0 to 1 and then 2. Correct?
 
There is a nice little variation of the problem. The host says, after you have chosen the door, that you can change your guess, but to sweeten the deal, he says you can choose the two other doors, if you wish. This proposition is a no brainer, however before you are quick enough to accept it, the host opens one of the two doors and it is empty. In this version you really want to change your pick, but at the same time ask yourself is the host impartial and does that change anything. The host...

Similar threads

Replies
24
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
Replies
2
Views
4K
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K