Using Assuming with Reduce

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











up vote
4
down vote

favorite












I have the following code that includes Assuming to cut through irrelevant detail, or so I had hoped.



Assuming[w > 1/2 && P < 1, Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]


To my detriment Mathematica generates an output whose first condition is $w<frac12$



How can I get Mathematica to use my assumptions to focus on only those values that apply within those assumptions?







share|improve this question
















  • 2




    Assuming[w > 1/2 && P < 1, FullSimplify@Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]?
    – kglr
    Aug 10 at 12:11










  • Oh dear. That was beautiful!
    – user120911
    Aug 10 at 12:17














up vote
4
down vote

favorite












I have the following code that includes Assuming to cut through irrelevant detail, or so I had hoped.



Assuming[w > 1/2 && P < 1, Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]


To my detriment Mathematica generates an output whose first condition is $w<frac12$



How can I get Mathematica to use my assumptions to focus on only those values that apply within those assumptions?







share|improve this question
















  • 2




    Assuming[w > 1/2 && P < 1, FullSimplify@Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]?
    – kglr
    Aug 10 at 12:11










  • Oh dear. That was beautiful!
    – user120911
    Aug 10 at 12:17












up vote
4
down vote

favorite









up vote
4
down vote

favorite











I have the following code that includes Assuming to cut through irrelevant detail, or so I had hoped.



Assuming[w > 1/2 && P < 1, Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]


To my detriment Mathematica generates an output whose first condition is $w<frac12$



How can I get Mathematica to use my assumptions to focus on only those values that apply within those assumptions?







share|improve this question












I have the following code that includes Assuming to cut through irrelevant detail, or so I had hoped.



Assuming[w > 1/2 && P < 1, Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]


To my detriment Mathematica generates an output whose first condition is $w<frac12$



How can I get Mathematica to use my assumptions to focus on only those values that apply within those assumptions?









share|improve this question











share|improve this question




share|improve this question










asked Aug 10 at 12:06









user120911

32417




32417







  • 2




    Assuming[w > 1/2 && P < 1, FullSimplify@Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]?
    – kglr
    Aug 10 at 12:11










  • Oh dear. That was beautiful!
    – user120911
    Aug 10 at 12:17












  • 2




    Assuming[w > 1/2 && P < 1, FullSimplify@Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]?
    – kglr
    Aug 10 at 12:11










  • Oh dear. That was beautiful!
    – user120911
    Aug 10 at 12:17







2




2




Assuming[w > 1/2 && P < 1, FullSimplify@Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]?
– kglr
Aug 10 at 12:11




Assuming[w > 1/2 && P < 1, FullSimplify@Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]?
– kglr
Aug 10 at 12:11












Oh dear. That was beautiful!
– user120911
Aug 10 at 12:17




Oh dear. That was beautiful!
– user120911
Aug 10 at 12:17










3 Answers
3






active

oldest

votes

















up vote
7
down vote



accepted










Assuming >> Details:



  • Assuming affects the default assumptions for all functions that have an Assumptions option.

Assumptions is not an option for Reduce:



Options[Reduce]



Backsubstitution -> False, Cubics -> False, GeneratedParameters -> C,
Method -> Automatic, Modulus -> 0, Quartics -> False,
WorkingPrecision -> ∞




You can wrap Reduce with FullSimplify:



Assuming[w > 1/2 && P < 1, FullSimplify@Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]



f (-1 + P + 2 w - 2 P w) < P







share|improve this answer



























    up vote
    2
    down vote













    As mentioned by @kglr (+1) Reduce will ignore the conditions in Assuming but FullSimplify will use them.



    Composition[
    MemberQ[Assumptions],
    Keys,
    Options
    ] /@ Reduce, FullSimplify
    (* False, True *)


    Another option would have been to incorporate your assumptions into the expression to Reduce.



    Reduce[
    And @@
    P + f (-1 + P) (-1 + 2 w) > 0,
    w > 1/2,
    P < 1

    ]
    (* w > 1/2 && P < 1 && f < -(P/(1 - P - 2 w + 2 P w)) *)





    share|improve this answer





























      up vote
      0
      down vote













      There is a warning in the docs for FullSimplify:




      Some of the transformations used by FullSimplify are only generically correct.




      It's also true for Simplify (e.g. Simplify[Sin[Pi x]/x == 0, x ∈ Integers]). Often one uses Reduce to avoid such little errors.



      One way to get assumptions into Reduce is to include them as constraints:



      Assuming[w > 1/2 && P < 1, 
      Reduce[$Assumptions && P + f (-1 + P) (-1 + 2 w) > 0]]
      (* w > 1/2 && P < 1 && f < -(P/(1 - P - 2 w + 2 P w)) *)





      share|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: "387"
        ;
        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: false,
        noModals: false,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: null,
        bindNavPrevention: true,
        postfix: "",
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













         

        draft saved


        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f179820%2fusing-assuming-with-reduce%23new-answer', 'question_page');

        );

        Post as a guest






























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes








        up vote
        7
        down vote



        accepted










        Assuming >> Details:



        • Assuming affects the default assumptions for all functions that have an Assumptions option.

        Assumptions is not an option for Reduce:



        Options[Reduce]



        Backsubstitution -> False, Cubics -> False, GeneratedParameters -> C,
        Method -> Automatic, Modulus -> 0, Quartics -> False,
        WorkingPrecision -> ∞




        You can wrap Reduce with FullSimplify:



        Assuming[w > 1/2 && P < 1, FullSimplify@Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]



        f (-1 + P + 2 w - 2 P w) < P







        share|improve this answer
























          up vote
          7
          down vote



          accepted










          Assuming >> Details:



          • Assuming affects the default assumptions for all functions that have an Assumptions option.

          Assumptions is not an option for Reduce:



          Options[Reduce]



          Backsubstitution -> False, Cubics -> False, GeneratedParameters -> C,
          Method -> Automatic, Modulus -> 0, Quartics -> False,
          WorkingPrecision -> ∞




          You can wrap Reduce with FullSimplify:



          Assuming[w > 1/2 && P < 1, FullSimplify@Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]



          f (-1 + P + 2 w - 2 P w) < P







          share|improve this answer






















            up vote
            7
            down vote



            accepted







            up vote
            7
            down vote



            accepted






            Assuming >> Details:



            • Assuming affects the default assumptions for all functions that have an Assumptions option.

            Assumptions is not an option for Reduce:



            Options[Reduce]



            Backsubstitution -> False, Cubics -> False, GeneratedParameters -> C,
            Method -> Automatic, Modulus -> 0, Quartics -> False,
            WorkingPrecision -> ∞




            You can wrap Reduce with FullSimplify:



            Assuming[w > 1/2 && P < 1, FullSimplify@Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]



            f (-1 + P + 2 w - 2 P w) < P







            share|improve this answer












            Assuming >> Details:



            • Assuming affects the default assumptions for all functions that have an Assumptions option.

            Assumptions is not an option for Reduce:



            Options[Reduce]



            Backsubstitution -> False, Cubics -> False, GeneratedParameters -> C,
            Method -> Automatic, Modulus -> 0, Quartics -> False,
            WorkingPrecision -> ∞




            You can wrap Reduce with FullSimplify:



            Assuming[w > 1/2 && P < 1, FullSimplify@Reduce[P + f (-1 + P) (-1 + 2 w) > 0]]



            f (-1 + P + 2 w - 2 P w) < P








            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 10 at 12:27









            kglr

            157k8182379




            157k8182379




















                up vote
                2
                down vote













                As mentioned by @kglr (+1) Reduce will ignore the conditions in Assuming but FullSimplify will use them.



                Composition[
                MemberQ[Assumptions],
                Keys,
                Options
                ] /@ Reduce, FullSimplify
                (* False, True *)


                Another option would have been to incorporate your assumptions into the expression to Reduce.



                Reduce[
                And @@
                P + f (-1 + P) (-1 + 2 w) > 0,
                w > 1/2,
                P < 1

                ]
                (* w > 1/2 && P < 1 && f < -(P/(1 - P - 2 w + 2 P w)) *)





                share|improve this answer


























                  up vote
                  2
                  down vote













                  As mentioned by @kglr (+1) Reduce will ignore the conditions in Assuming but FullSimplify will use them.



                  Composition[
                  MemberQ[Assumptions],
                  Keys,
                  Options
                  ] /@ Reduce, FullSimplify
                  (* False, True *)


                  Another option would have been to incorporate your assumptions into the expression to Reduce.



                  Reduce[
                  And @@
                  P + f (-1 + P) (-1 + 2 w) > 0,
                  w > 1/2,
                  P < 1

                  ]
                  (* w > 1/2 && P < 1 && f < -(P/(1 - P - 2 w + 2 P w)) *)





                  share|improve this answer
























                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    As mentioned by @kglr (+1) Reduce will ignore the conditions in Assuming but FullSimplify will use them.



                    Composition[
                    MemberQ[Assumptions],
                    Keys,
                    Options
                    ] /@ Reduce, FullSimplify
                    (* False, True *)


                    Another option would have been to incorporate your assumptions into the expression to Reduce.



                    Reduce[
                    And @@
                    P + f (-1 + P) (-1 + 2 w) > 0,
                    w > 1/2,
                    P < 1

                    ]
                    (* w > 1/2 && P < 1 && f < -(P/(1 - P - 2 w + 2 P w)) *)





                    share|improve this answer














                    As mentioned by @kglr (+1) Reduce will ignore the conditions in Assuming but FullSimplify will use them.



                    Composition[
                    MemberQ[Assumptions],
                    Keys,
                    Options
                    ] /@ Reduce, FullSimplify
                    (* False, True *)


                    Another option would have been to incorporate your assumptions into the expression to Reduce.



                    Reduce[
                    And @@
                    P + f (-1 + P) (-1 + 2 w) > 0,
                    w > 1/2,
                    P < 1

                    ]
                    (* w > 1/2 && P < 1 && f < -(P/(1 - P - 2 w + 2 P w)) *)






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Aug 10 at 14:54

























                    answered Aug 10 at 13:13









                    rhermans

                    21.6k439103




                    21.6k439103




















                        up vote
                        0
                        down vote













                        There is a warning in the docs for FullSimplify:




                        Some of the transformations used by FullSimplify are only generically correct.




                        It's also true for Simplify (e.g. Simplify[Sin[Pi x]/x == 0, x ∈ Integers]). Often one uses Reduce to avoid such little errors.



                        One way to get assumptions into Reduce is to include them as constraints:



                        Assuming[w > 1/2 && P < 1, 
                        Reduce[$Assumptions && P + f (-1 + P) (-1 + 2 w) > 0]]
                        (* w > 1/2 && P < 1 && f < -(P/(1 - P - 2 w + 2 P w)) *)





                        share|improve this answer
























                          up vote
                          0
                          down vote













                          There is a warning in the docs for FullSimplify:




                          Some of the transformations used by FullSimplify are only generically correct.




                          It's also true for Simplify (e.g. Simplify[Sin[Pi x]/x == 0, x ∈ Integers]). Often one uses Reduce to avoid such little errors.



                          One way to get assumptions into Reduce is to include them as constraints:



                          Assuming[w > 1/2 && P < 1, 
                          Reduce[$Assumptions && P + f (-1 + P) (-1 + 2 w) > 0]]
                          (* w > 1/2 && P < 1 && f < -(P/(1 - P - 2 w + 2 P w)) *)





                          share|improve this answer






















                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            There is a warning in the docs for FullSimplify:




                            Some of the transformations used by FullSimplify are only generically correct.




                            It's also true for Simplify (e.g. Simplify[Sin[Pi x]/x == 0, x ∈ Integers]). Often one uses Reduce to avoid such little errors.



                            One way to get assumptions into Reduce is to include them as constraints:



                            Assuming[w > 1/2 && P < 1, 
                            Reduce[$Assumptions && P + f (-1 + P) (-1 + 2 w) > 0]]
                            (* w > 1/2 && P < 1 && f < -(P/(1 - P - 2 w + 2 P w)) *)





                            share|improve this answer












                            There is a warning in the docs for FullSimplify:




                            Some of the transformations used by FullSimplify are only generically correct.




                            It's also true for Simplify (e.g. Simplify[Sin[Pi x]/x == 0, x ∈ Integers]). Often one uses Reduce to avoid such little errors.



                            One way to get assumptions into Reduce is to include them as constraints:



                            Assuming[w > 1/2 && P < 1, 
                            Reduce[$Assumptions && P + f (-1 + P) (-1 + 2 w) > 0]]
                            (* w > 1/2 && P < 1 && f < -(P/(1 - P - 2 w + 2 P w)) *)






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Aug 10 at 17:15









                            Michael E2

                            140k11190456




                            140k11190456



























                                 

                                draft saved


                                draft discarded















































                                 


                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f179820%2fusing-assuming-with-reduce%23new-answer', 'question_page');

                                );

                                Post as a guest













































































                                Comments

                                Popular posts from this blog

                                What does second last employer means? [closed]

                                Installing NextGIS Connect into QGIS 3?

                                One-line joke