Linear programming problem with absolute value

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












Problem: Maximize $|x|$ under conditions $$-x+yleq 1\ x+yleq2\ygeq0$$



My solution: So we can write $x$ as $x=x_1-x_2$ and $|x| = x_1+x_2$, where $x_1 = x$ whenever $xgeq0$ and $x_1=0$ whenever $x<0$, and $x_2=-x$ whenever $x<0$ and $x_2=0$ whenever $xgeq 0$.



Hence we get this inequalities after introducing slack variables:
$$-x_1+x_2+y+x_3=1\x_1-x_2+y+x_4=2\y,x_1,x_2 geq 0\z-x_1-x_2=0$$
Hence we create a tableu
beginarrayc
hline
x_1& x_2 & x_3 & x_4& y & z& b \ hline
-1&1 &1 &0&1&0&1\ hline
1&-1&0&1&1&0&2\ hline
-1& -1&0 &0&0&1&0
endarray



Hence we look on the last row and we see that smalles negative value is $-1$. Hence it does not matter if we take $x_1$ or $x_2$(Am i right?). So lets say choose $x_1$, then we look on indicators and see that smalles non negative indicator will be $2$, hence the second row. So the pivot variable will be equal to $1$. However now i have no idea what to do since it is already $1$, because i do not need to make row operations to turn it into 1.



My question: Did i had a mistake till now? If not, could anyone just give a hint about how to proceed next?







share|cite|improve this question
























    up vote
    0
    down vote

    favorite












    Problem: Maximize $|x|$ under conditions $$-x+yleq 1\ x+yleq2\ygeq0$$



    My solution: So we can write $x$ as $x=x_1-x_2$ and $|x| = x_1+x_2$, where $x_1 = x$ whenever $xgeq0$ and $x_1=0$ whenever $x<0$, and $x_2=-x$ whenever $x<0$ and $x_2=0$ whenever $xgeq 0$.



    Hence we get this inequalities after introducing slack variables:
    $$-x_1+x_2+y+x_3=1\x_1-x_2+y+x_4=2\y,x_1,x_2 geq 0\z-x_1-x_2=0$$
    Hence we create a tableu
    beginarrayc
    hline
    x_1& x_2 & x_3 & x_4& y & z& b \ hline
    -1&1 &1 &0&1&0&1\ hline
    1&-1&0&1&1&0&2\ hline
    -1& -1&0 &0&0&1&0
    endarray



    Hence we look on the last row and we see that smalles negative value is $-1$. Hence it does not matter if we take $x_1$ or $x_2$(Am i right?). So lets say choose $x_1$, then we look on indicators and see that smalles non negative indicator will be $2$, hence the second row. So the pivot variable will be equal to $1$. However now i have no idea what to do since it is already $1$, because i do not need to make row operations to turn it into 1.



    My question: Did i had a mistake till now? If not, could anyone just give a hint about how to proceed next?







    share|cite|improve this question






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Problem: Maximize $|x|$ under conditions $$-x+yleq 1\ x+yleq2\ygeq0$$



      My solution: So we can write $x$ as $x=x_1-x_2$ and $|x| = x_1+x_2$, where $x_1 = x$ whenever $xgeq0$ and $x_1=0$ whenever $x<0$, and $x_2=-x$ whenever $x<0$ and $x_2=0$ whenever $xgeq 0$.



      Hence we get this inequalities after introducing slack variables:
      $$-x_1+x_2+y+x_3=1\x_1-x_2+y+x_4=2\y,x_1,x_2 geq 0\z-x_1-x_2=0$$
      Hence we create a tableu
      beginarrayc
      hline
      x_1& x_2 & x_3 & x_4& y & z& b \ hline
      -1&1 &1 &0&1&0&1\ hline
      1&-1&0&1&1&0&2\ hline
      -1& -1&0 &0&0&1&0
      endarray



      Hence we look on the last row and we see that smalles negative value is $-1$. Hence it does not matter if we take $x_1$ or $x_2$(Am i right?). So lets say choose $x_1$, then we look on indicators and see that smalles non negative indicator will be $2$, hence the second row. So the pivot variable will be equal to $1$. However now i have no idea what to do since it is already $1$, because i do not need to make row operations to turn it into 1.



      My question: Did i had a mistake till now? If not, could anyone just give a hint about how to proceed next?







      share|cite|improve this question












      Problem: Maximize $|x|$ under conditions $$-x+yleq 1\ x+yleq2\ygeq0$$



      My solution: So we can write $x$ as $x=x_1-x_2$ and $|x| = x_1+x_2$, where $x_1 = x$ whenever $xgeq0$ and $x_1=0$ whenever $x<0$, and $x_2=-x$ whenever $x<0$ and $x_2=0$ whenever $xgeq 0$.



      Hence we get this inequalities after introducing slack variables:
      $$-x_1+x_2+y+x_3=1\x_1-x_2+y+x_4=2\y,x_1,x_2 geq 0\z-x_1-x_2=0$$
      Hence we create a tableu
      beginarrayc
      hline
      x_1& x_2 & x_3 & x_4& y & z& b \ hline
      -1&1 &1 &0&1&0&1\ hline
      1&-1&0&1&1&0&2\ hline
      -1& -1&0 &0&0&1&0
      endarray



      Hence we look on the last row and we see that smalles negative value is $-1$. Hence it does not matter if we take $x_1$ or $x_2$(Am i right?). So lets say choose $x_1$, then we look on indicators and see that smalles non negative indicator will be $2$, hence the second row. So the pivot variable will be equal to $1$. However now i have no idea what to do since it is already $1$, because i do not need to make row operations to turn it into 1.



      My question: Did i had a mistake till now? If not, could anyone just give a hint about how to proceed next?









      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Aug 21 at 9:09









      MariyaKav

      1909




      1909




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote













          I don't see how do you ensure that $x_1=x$ whenever $x ge 0$ and $x_1=0$ otherwise.



          Usually the trick works for minimizing the absolute value, not maximizing it. In fact, the problem is not convex.



          From $x+y le 2$ and $y ge 0$, we have $x le 2$.



          Also, from $y le 1+x$ and $y ge 0$, we have $x ge -1$.



          Also $(2,0)$ satisfies the constraints, hence the optimal value is $2$.






          share|cite|improve this answer




















            Your Answer




            StackExchange.ifUsing("editor", function ()
            return StackExchange.using("mathjaxEditing", function ()
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            );
            );
            , "mathjax-editing");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "69"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );








             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2889647%2flinear-programming-problem-with-absolute-value%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            1
            down vote













            I don't see how do you ensure that $x_1=x$ whenever $x ge 0$ and $x_1=0$ otherwise.



            Usually the trick works for minimizing the absolute value, not maximizing it. In fact, the problem is not convex.



            From $x+y le 2$ and $y ge 0$, we have $x le 2$.



            Also, from $y le 1+x$ and $y ge 0$, we have $x ge -1$.



            Also $(2,0)$ satisfies the constraints, hence the optimal value is $2$.






            share|cite|improve this answer
























              up vote
              1
              down vote













              I don't see how do you ensure that $x_1=x$ whenever $x ge 0$ and $x_1=0$ otherwise.



              Usually the trick works for minimizing the absolute value, not maximizing it. In fact, the problem is not convex.



              From $x+y le 2$ and $y ge 0$, we have $x le 2$.



              Also, from $y le 1+x$ and $y ge 0$, we have $x ge -1$.



              Also $(2,0)$ satisfies the constraints, hence the optimal value is $2$.






              share|cite|improve this answer






















                up vote
                1
                down vote










                up vote
                1
                down vote









                I don't see how do you ensure that $x_1=x$ whenever $x ge 0$ and $x_1=0$ otherwise.



                Usually the trick works for minimizing the absolute value, not maximizing it. In fact, the problem is not convex.



                From $x+y le 2$ and $y ge 0$, we have $x le 2$.



                Also, from $y le 1+x$ and $y ge 0$, we have $x ge -1$.



                Also $(2,0)$ satisfies the constraints, hence the optimal value is $2$.






                share|cite|improve this answer












                I don't see how do you ensure that $x_1=x$ whenever $x ge 0$ and $x_1=0$ otherwise.



                Usually the trick works for minimizing the absolute value, not maximizing it. In fact, the problem is not convex.



                From $x+y le 2$ and $y ge 0$, we have $x le 2$.



                Also, from $y le 1+x$ and $y ge 0$, we have $x ge -1$.



                Also $(2,0)$ satisfies the constraints, hence the optimal value is $2$.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Aug 21 at 9:25









                Siong Thye Goh

                80.2k1453100




                80.2k1453100






















                     

                    draft saved


                    draft discarded


























                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2889647%2flinear-programming-problem-with-absolute-value%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    這個網誌中的熱門文章

                    How to combine Bézier curves to a surface?

                    Mutual Information Always Non-negative

                    Why am i infinitely getting the same tweet with the Twitter Search API?