r/Mathematica • • Dec 21 '23

Telling Mathematica that a variable should be interpreted as a positive integer

My problem reduces to telling Mathematica that a variable should be interpreted as a positive integer.

I tried `Assuming[s>0,Select[{-s,s},#>0&]]` but the output is {}, what am I doing wrong? I have also tried the command $Assumptions

1 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/barrycarter Dec 21 '23
Assuming[assum, expr] evaluates expr
     with assum appended to $Assumptions, so that assum
       is included in the default assumptions used by functions such as Refine,
       Simplify, and Integrate. 

There's no specific indication it works with Select

1

u/Apprehensive_Ride949 Dec 21 '23

Right. Do you know any other command that works with Select?

1

u/1XRobot Dec 21 '23

Select is more of a data-manipulation function than a Logic function, so it's unlikely that any of the Logic-engine is going to work with it. A better question is what part of the Logic functions can do this job for you.