Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.8K Views
|
5 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Two identical computations give different results?

Posted 1 year ago

I added a notebook but the preview looks unreadable. The notebook shows two seemingly identical computations giving different answers. I'm posting to see if the post is readable. If so, perhaps someone could comment.

Thanks, Leon

Attachments:
POSTED BY: Leon Fairbanks
5 Replies

You are very generous. I have you to thank for resolving this. Thank you.

POSTED BY: Leon Fairbanks
Posted 1 year ago

I am VERY impressed! I thought it might likely be the case that you would never be able to track down the real reason for this. You taught me and you and perhaps others one more thing to watch out for. Congratulations and thank you.

POSTED BY: Bill Nelson

I think I may know what caused the problem. Usually, I set the notebook's default context to "unique to this notebook". I left one notebook in global context. That notebook had a different formula for p(x) than the one in the new notebook.

POSTED BY: Leon Fairbanks

You were right. After restarting Mathematica and executing the Clear the two formulas agreed. I will continue to investigate. Thanks!

POSTED BY: Leon Fairbanks
Posted 1 year ago

Try a fresh restart of Mathematica to clear the hidden cache of previous work and then

In[1]:= Clear["`*"];
p0[i_]:=Sum[(-1)^j 2^(2j-2)(Binomial[i+j-2,2j-2](2i-1)/(2j-1)),{j,1,i}]
p[i_,x_]:=Sum[(-1)^j 2^(2j-2)(Binomial[i+j-2,2j-2](2i-1)/(2j-1))x^(2j-1),{j,1,i}]
p0[3]
p[3,1]

Out[4]= -1

Out[5]= -1

Check this very carefully to make certain I haven't made any mistake.

And then the hard part, see if you can remember and reproduce what you might have done to get the different result and figure out why that gave you the different result. IF you can successfully do that then that might help protect you in the future when it isn't as obvious that a result isn't what it should be. That is what the outcome of this really should be. I hope it works.

POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard