Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

A (k) =the closed interval [-10+Sin [k], 10+Sin [k]] How do I can create a list of the first 20 of such interval The find the intersection of the first 14 of them

share|improve this question
    
Is k integer? Use Range and IntervalIntersetcion[] –  belisarius Dec 1 '13 at 17:01
    
Yes k is an integer number –  mais Dec 1 '13 at 17:07
add comment

4 Answers

c = IntervalIntersection @@ (Array[ Interval[{-10 + Sin[#], 10 + Sin[#]}] &, {20}][[;; 14]])

Graphics[{Array[Line[{{-10 + Sin[#], #}, {10 + Sin[#], #}}] &, {14}], 
         Red, c /. Interval[{x_, y_}] -> Line@{{x, 0}, {y, 0}}}]

Mathematica graphics

share|improve this answer
add comment

The code

ak = N[Table[Interval[{-10 + Sin[k], 10 + Sin[k]}], {k, 1, 20}]];

computes the first 20 as intervals. Remove the N[ ] wrapper for the exact values. You can then compute the intersection of the first 14 as closed intervals with

IntervalIntersection @@ ak[[1;;14]]

Finally this is the correct intersection: Interval[{-9.00939, 9.00001}]

share|improve this answer
    
What's @ means? ? –  mais Dec 1 '13 at 17:14
    
@Nana @@ -Apply. Difference between @ and @@. –  Kuba Dec 1 '13 at 17:14
    
.. thank you :-) –  mais Dec 1 '13 at 17:18
    
I see the problem 1 sec –  J. W. Perry Dec 1 '13 at 17:20
    
I'm really confuse now... what is the corect code in this case? –  mais Dec 1 '13 at 17:21
show 3 more comments

We can use properties of Interval earlier:

f = Sin[#] + Interval[{-10, 10}]&;
IntervalIntersection @@ Array[f, 14] // N
Interval[{-9.00939, 9.00001}]
share|improve this answer
add comment

You can answer this question without knowing anything about interval functions: the intersection of all the intervals is the interval between (10-largest value of Sin) and (10+smallest value of Sin). With Sin assuming integer values between 1 and 14, this is:

{10 - Max[Sin[Range[14]]], 10 + Min[Sin[Range[14]]]}
{10 - Sin[14], 10 + Sin[11]}//N
{9.00939, 9.00001}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.