Question: To eliminate some entries of a list that are not close to other entries of the list

Let L=[a1,a2,...,an] be a list of positive real numbers. 

My Question:

How to write a procedure to find a minimal interval such as [b,c] 

provided that this interval covers entries of L which are close together. 

Example: 

let L:=[8.1 , 2.03 , 3.5 , 0.05 , 4.1]. Then the output of the procedure is the interval [2.03 , 4.1].

In fact we want to eliminate some entries of L that are not close to other entries of L.

Thanks in advance

Please Wait...