Example:
S = {r ∈ Q : r² < 2}
Let S be the set of all rational numbers whose squares are less than 2. It follows that 1 ∈ S, 4/3 ∈ S, but 3/2 doesn't ∈ S because 9/4 ≥ 2.
Thank you.
Example:
S = {r ∈ Q : r² < 2}
Let S be the set of all rational numbers whose squares are less than 2. It follows that 1 ∈ S, 4/3 ∈ S, but 3/2 doesn't ∈ S because 9/4 ≥ 2.
Thank you.
You can use ImplicitRegion to define this type of set.
Define your set.
\[ScriptCapitalR] = ImplicitRegion[r \[Element] Rationals && r^2 < 2, {r}];
Check that this works correctly on some rational and some irrational points.
Element[#, \[ScriptCapitalR]] & /@ {{1}, {4/3}, {3/2}, {\[Pi]}, {E}}
(* {True, True, False, False, False} *)
Define a larger set.
\[ScriptCapitalS] = ImplicitRegion[r \[Element] Rationals && r^2 < 3^2, {r}];
Compute the difference between the above 2 sets -- this is an "annular" region.
\[ScriptCapitalS]minus\[ScriptCapitalR] = RegionDifference[\[ScriptCapitalS], \[ScriptCapitalR]];
Check that this works correctly on some rational and some irrational points.
Element[#, \[ScriptCapitalS]minus\[ScriptCapitalR]] & /@ {{1}, {4/3}, {3/2}, {\[Pi]}, {E}}
(* {False, False, True, False, False} *)
ReduceorFindMinimum, etc., if searching for a particular value or range of values. Could you give some examples of what you are actually trying to accomplish? – Mr.Wizard Sep 18 '14 at 05:13