Using Assuming with Reduce
Clash 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?
equation-solving assumptions
add a comment |Â
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?
equation-solving assumptions
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
add a comment |Â
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?
equation-solving assumptions
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?
equation-solving assumptions
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
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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)) *)
add a comment |Â
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)) *)
add a comment |Â
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
add a comment |Â
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
add a comment |Â
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
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
answered Aug 10 at 12:27
kglr
157k8182379
157k8182379
add a comment |Â
add a comment |Â
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)) *)
add a comment |Â
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)) *)
add a comment |Â
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)) *)
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)) *)
edited Aug 10 at 14:54
answered Aug 10 at 13:13
rhermans
21.6k439103
21.6k439103
add a comment |Â
add a comment |Â
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)) *)
add a comment |Â
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)) *)
add a comment |Â
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)) *)
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)) *)
answered Aug 10 at 17:15
Michael E2
140k11190456
140k11190456
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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