Message Boards Message Boards

0
|
1439 Views
|
3 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Simplify the FractionalPart of an expression including variables

Posted 1 year ago

See my following testing:

In[199]:= Assuming[{n1,n2,n3}\[Epsilon] Integers, FractionalPart[n1 + 2 n2 - 3 n3 ]]
FullSimplify[FractionalPart[n1 + 2 n2 - 3 n3], {n1,n2,n3}\[Epsilon] Integers ]

Out[199]= FractionalPart[n1 + 2 n2 - 3 n3]

Out[200]= FractionalPart[n1 + 2 n2 - 3 n3]

Why can't I simplify the results, that is, return the correct results 0?

Regards, Zhao

POSTED BY: Hongyi Zhao
3 Replies
Posted 1 year ago

Assuming does not affect evaluation of every type of its second argument. Its scope is limited. From documentation:

enter image description here

In[23]:= Assuming[Element[{n1, n2, n3}, Integers], FractionalPart[n1 + 2 n2 - 3 n3] // Simplify]

Out[23]= 0

Or:

In[25]:= Assuming[Element[_Symbol, Integers], FractionalPart[n1 + 2 n2 - 3 n3] // Simplify]

Out[25]= 0
POSTED BY: Hans Milton
Posted 1 year ago

In[5]:= Assuming[Element[{n1, n2, n3}, Integers], FractionalPart[n1 + 2 n2 - 3 n3 ]] Simplify[FractionalPart[n1 + 2 n2 - 3 n3], Element[{n1, n2, n3}, Integers]]

Out[5]= FractionalPart[n1 + 2 n2 - 3 n3]

Out[6]= 0

Why does the "Assuming" approach not work?

You have used the infix form [Epsilon], it should be [Element].

Thank you for pointing out my misuse of mathematical symbols. The shapes of these two symbols are so similar that I really didn't notice their differences.

POSTED BY: Hongyi Zhao
Posted 1 year ago
In[13]:= Simplify[FractionalPart[n1 + 2 n2 - 3 n3], Element[{n1, n2, n3}, Integers]]

Out[13]= 0

You have used the infix form \[Epsilon], it should be \[Element].

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

Group Abstract Group Abstract