Are these expressions not equal? Mathematica output is ambiguous
$begingroup$
The following plot indicates that the first expression equals the second. But how can I use Mathematica to show that is true:
Plot[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), {P, 0, 1}]
An attempt to simplify indicates the expressions are not equal:
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]
That gives the following answer:
(Log[-1 + 1/P] + Log[-(P/(-1 + P))])/Log[10]

plotting simplifying-expressions
$endgroup$
add a comment |
$begingroup$
The following plot indicates that the first expression equals the second. But how can I use Mathematica to show that is true:
Plot[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), {P, 0, 1}]
An attempt to simplify indicates the expressions are not equal:
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]
That gives the following answer:
(Log[-1 + 1/P] + Log[-(P/(-1 + P))])/Log[10]

plotting simplifying-expressions
$endgroup$
3
$begingroup$
Add the optionAssumptions -> 0 < P < 1toFullSimplifyand it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value ofPand the two equations are not generally equal due to branch cuts.
$endgroup$
– Sjoerd Smit
Mar 22 at 10:29
1
$begingroup$
In addition to what Sjoerd said: EvaluatingFullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1]reveals that the expressions are not equal for arbitrary realP. So Mathematica would have lied if she had simplifiedFullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]to0.
$endgroup$
– Henrik Schumacher
Mar 22 at 10:41
1
$begingroup$
Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tellFullSimplifywhat you know aboutP, so of course you get a general result.
$endgroup$
– J. M. is slightly pensive♦
Mar 22 at 11:48
add a comment |
$begingroup$
The following plot indicates that the first expression equals the second. But how can I use Mathematica to show that is true:
Plot[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), {P, 0, 1}]
An attempt to simplify indicates the expressions are not equal:
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]
That gives the following answer:
(Log[-1 + 1/P] + Log[-(P/(-1 + P))])/Log[10]

plotting simplifying-expressions
$endgroup$
The following plot indicates that the first expression equals the second. But how can I use Mathematica to show that is true:
Plot[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), {P, 0, 1}]
An attempt to simplify indicates the expressions are not equal:
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]
That gives the following answer:
(Log[-1 + 1/P] + Log[-(P/(-1 + P))])/Log[10]

plotting simplifying-expressions
plotting simplifying-expressions
asked Mar 22 at 10:25
user120911user120911
75128
75128
3
$begingroup$
Add the optionAssumptions -> 0 < P < 1toFullSimplifyand it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value ofPand the two equations are not generally equal due to branch cuts.
$endgroup$
– Sjoerd Smit
Mar 22 at 10:29
1
$begingroup$
In addition to what Sjoerd said: EvaluatingFullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1]reveals that the expressions are not equal for arbitrary realP. So Mathematica would have lied if she had simplifiedFullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]to0.
$endgroup$
– Henrik Schumacher
Mar 22 at 10:41
1
$begingroup$
Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tellFullSimplifywhat you know aboutP, so of course you get a general result.
$endgroup$
– J. M. is slightly pensive♦
Mar 22 at 11:48
add a comment |
3
$begingroup$
Add the optionAssumptions -> 0 < P < 1toFullSimplifyand it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value ofPand the two equations are not generally equal due to branch cuts.
$endgroup$
– Sjoerd Smit
Mar 22 at 10:29
1
$begingroup$
In addition to what Sjoerd said: EvaluatingFullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1]reveals that the expressions are not equal for arbitrary realP. So Mathematica would have lied if she had simplifiedFullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]to0.
$endgroup$
– Henrik Schumacher
Mar 22 at 10:41
1
$begingroup$
Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tellFullSimplifywhat you know aboutP, so of course you get a general result.
$endgroup$
– J. M. is slightly pensive♦
Mar 22 at 11:48
3
3
$begingroup$
Add the option
Assumptions -> 0 < P < 1 to FullSimplify and it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value of P and the two equations are not generally equal due to branch cuts.$endgroup$
– Sjoerd Smit
Mar 22 at 10:29
$begingroup$
Add the option
Assumptions -> 0 < P < 1 to FullSimplify and it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value of P and the two equations are not generally equal due to branch cuts.$endgroup$
– Sjoerd Smit
Mar 22 at 10:29
1
1
$begingroup$
In addition to what Sjoerd said: Evaluating
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1] reveals that the expressions are not equal for arbitrary real P. So Mathematica would have lied if she had simplified FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])] to 0.$endgroup$
– Henrik Schumacher
Mar 22 at 10:41
$begingroup$
In addition to what Sjoerd said: Evaluating
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1] reveals that the expressions are not equal for arbitrary real P. So Mathematica would have lied if she had simplified FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])] to 0.$endgroup$
– Henrik Schumacher
Mar 22 at 10:41
1
1
$begingroup$
Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tell
FullSimplify what you know about P, so of course you get a general result.$endgroup$
– J. M. is slightly pensive♦
Mar 22 at 11:48
$begingroup$
Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tell
FullSimplify what you know about P, so of course you get a general result.$endgroup$
– J. M. is slightly pensive♦
Mar 22 at 11:48
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
You can ask Mathematica when this expression is zero, assuming we work on the reals:
Reduce[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]) == 0, P, Reals]
(* 0 < P < 1 *)
FullSimplify will confirm that result.
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]
(* 0 *)
$endgroup$
add a comment |
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',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193756%2fare-these-expressions-not-equal-mathematica-output-is-ambiguous%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You can ask Mathematica when this expression is zero, assuming we work on the reals:
Reduce[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]) == 0, P, Reals]
(* 0 < P < 1 *)
FullSimplify will confirm that result.
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]
(* 0 *)
$endgroup$
add a comment |
$begingroup$
You can ask Mathematica when this expression is zero, assuming we work on the reals:
Reduce[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]) == 0, P, Reals]
(* 0 < P < 1 *)
FullSimplify will confirm that result.
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]
(* 0 *)
$endgroup$
add a comment |
$begingroup$
You can ask Mathematica when this expression is zero, assuming we work on the reals:
Reduce[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]) == 0, P, Reals]
(* 0 < P < 1 *)
FullSimplify will confirm that result.
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]
(* 0 *)
$endgroup$
You can ask Mathematica when this expression is zero, assuming we work on the reals:
Reduce[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]) == 0, P, Reals]
(* 0 < P < 1 *)
FullSimplify will confirm that result.
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10]), 0 < P < 1]
(* 0 *)
answered Mar 22 at 10:29
SzabolcsSzabolcs
163k14447944
163k14447944
add a comment |
add a comment |
Thanks for contributing an answer to Mathematica Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f193756%2fare-these-expressions-not-equal-mathematica-output-is-ambiguous%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
$begingroup$
Add the option
Assumptions -> 0 < P < 1toFullSimplifyand it will tell you they are the same on that domain. Without assumptions, Mathematica will try to solve the equation for every possible complex value ofPand the two equations are not generally equal due to branch cuts.$endgroup$
– Sjoerd Smit
Mar 22 at 10:29
1
$begingroup$
In addition to what Sjoerd said: Evaluating
FullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/ Log[10]), P > 1]reveals that the expressions are not equal for arbitrary realP. So Mathematica would have lied if she had simplifiedFullSimplify[(-(Log[(1 - P)/P]/Log[10])) - (Log[-(P/(-1 + P))]/Log[10])]to0.$endgroup$
– Henrik Schumacher
Mar 22 at 10:41
1
$begingroup$
Always remember: Mathematica always assumes variables are complex-valued unless told otherwise. You did not tell
FullSimplifywhat you know aboutP, so of course you get a general result.$endgroup$
– J. M. is slightly pensive♦
Mar 22 at 11:48