 |
Interval
Interval[
min
,
max
] represents the range of values between min and max. Interval[
,
,
,
, ... ] represents the union of the ranges to , to , ....
You can perform arithmetic and other operations on Interval objects. Example: Interval[
1, 6
] + Interval[
0, 2
] . Min[
interval
] and Max[
interval
] give the end points of an interval. For approximate machine- or arbitrary-precision numbers x, Interval[
x
] yields an interval reflecting the uncertainty in x. In operations on intervals that involve approximate numbers, Mathematica always rounds lower limits down and upper limits up. Interval can be generated by functions such as Limit. Relational operators such as Equal and Less yield explicit True or False results whenever they are given disjoint intervals. See the Mathematica book: Section 3.6.8. See also: Range.
Further Examples
You can use Max and Min to find the endpoints of intervals.
In[1]:= 
Out[1]= 
You can take the union and intersection of the two or more intervals.
In[2]:= 
Out[2]= 
Using IntervalMemberQ, you can check if an interval is contained in another.
In[3]:= 
Out[3]= 
You can also check if a point belongs to an interval.
In[4]:= 
Out[4]= 
You can do interval arithmetic with many functions. For example, this command reflects the fact that the square of any real number between -2 and 5 lies between 0 and 25.
In[5]:= 
Out[5]= 
Taking the reciprocal gives two distinct intervals.
In[6]:= 
Out[6]= 
You can use intervals in many kinds of functions.
In[7]:= 
Out[7]= 
Some functions automatically generate intervals.
In[8]:= 
Out[8]= 
WIth ordinary machine-precision arithmetic, this gives an incorrect result.
In[9]:= 
Out[9]= 
The interval generated here, however, correctly includes the point 0.
In[10]:= 
Out[10]= 
Interval arithmetic is useful in obtaining or proving bounds. Here we define a function , which depends on two parameters . We then show that this function is monotonically nonincreasing in for all values of the parameter.
In[11]:= 
Out[11]= 
In[12]:= 
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT. SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION. | | | |
 | |
|