The n-th smallest term for any finite sequence of real numbers
aa r X i v : . [ m a t h . HO ] J u l THE N-TH SMALLEST TERM FOR ANY FINITE SEQUENCE OF REALNUMBERS.
JOSIMAR DA SILVA ROCHA
Abstract.
In this paper we find the formula that gives the n th smallest term in a given finitesequence { x k } Nk =1 of real numbers. In the literature, we can find many algorithms to ordination, such that Quicksort, Shellsort,Buble sort, Heapsort, Merge Sort and others. Any these algorithms can be founded in [3].It is easy to see that these algorithms can be changed to find the n-th smallest term in afinite sequence of real numbers. However, in the recent literature, we hasn’t found a formulathat gives us the n-th smallest term for any finite sequence of real numbers.The purpose of this paper will be to define a function that gives us the n-th smallest termfor any finite sequence of real numbers with N terms.In order to introduce the notation, if { x k } Nk =1 is a finite sequence of real numbers with N terms, then we denote by { x ( j ) k } N − k =1 the subsequence of { x k } Nk =1 obtening by elimination of j -thterm of { x k } Nk =1 , that is x ( j ) k = ( x k , if k < jx k +1 , if k ≥ j and k < N In general, x ( j,t ) k = ( x ( j ) k ) ( t ) and x ( j ,j , ··· ,j t ) k = (cid:16) x ( j , ··· ,j t − ) k (cid:17) ( j t ) . Proposition 1.
Let { x k } Nk =1 be a finite sequence of real numbers with N terms. Let σ be apermutation on { , , · · · , N } with x σ ≤ x σ ≤ · · · ≤ x N σ . MSC(2010): Primary: 00A05; Secondary: 06A75.Keywords: General Mathematics, Finite Sequences, n-th least term.1 JOSIMAR DA SILVA ROCHA If n is a positive integer such that ≤ n ≤ N, then there is j ∈ { , , . . . , N − n + 2 } such that x n σ ∈ { x ( j ) k } N − k =1 . Proof.
In fact, if A = { , · · · , N − n + 2 } and B = { σ , σ , . . . , ( n − σ } , by Inclusion-ExclusionPrinciple, we have | A ∩ B | = | A | + | B | − | A ∪ B | = ( N − n + 2) + ( n − − | A ∪ B | = N + 1 − | A ∪ B | ≥ N + 1 − N = 1 . Consequently, A ∪ B = ∅ and there is j ∈ A ∩ B such that x n σ ∈ { x ( j ) k } N − k =1 . (cid:3) Remark 1.
The function that affords us the greatest element in a finite sequence of real numbersis given by following recursive formula: max { x , x } = x + x + | x − x | { x , x , · · · , x N } = max { max { x , x , · · · , x N − } , x N } This function can be changed to calculate the smallest element in a finite sequence of realnumbers by the following recursive formula min { x , x } = − max {− x , − x } = x + x − | x − x | { x , · · · , x n } = min { min { x , · · · , x N − } , x N } These functions was used to demonstrate the
Stone-Weierstrass Theorem in [1, 2, 4] . Example 1.
For three and four terms, we have min { x , x , x } = min { min { x , x } , x } = min { x , x } + x − | min { x , x } − x | x + x −| x − x | + x − (cid:12)(cid:12)(cid:12) x + x −| x − x | − x (cid:12)(cid:12)(cid:12) x + x + 2 x − | x − x | − | x + x − x − | x − x || HE N-TH SMALLEST TERM FOR ANY FINITE SEQUENCE OF REAL NUMBERS. 3 min { x , x , x , x } = min { min( x , x , x } , x } = x + x +2 x −| x − x |−| x + x − x −| x − x || + x − (cid:12)(cid:12)(cid:12) x + x +2 x −| x − x |−| x + x − x −| x − x || − x (cid:12)(cid:12)(cid:12) x + x +2 x +4 x −| x − x |−| x + x − x −| x − x ||−| x + x +2 x − x −| x − x |−| x + x − x −| x − x ||| Theorem 1.
Let { x k } Nk =1 be a finite sequence of real numbers with N terms and let a positiveinteger n such that n ≤ N, then T ( n, { x k } Nk =1 ) = max N − n +2 [ j =1 n T (cid:16) n − , { x ( j ) k } N − k =1 (cid:17)o , if n ≥ { x , · · · , x N } , if n = 1 satisfies T ( n, { x k } Nk =1 ) = x n σ , where σ is a permutation on { , , · · · , N } such that x σ ≤ x σ ≤· · · ≤ x N σ . Proof. If n = 1 , then T (1 , { x n } Nk =1 ) = min { x , · · · , x n } = x σ . If N = 1 , then T (1 , { x n } k =1 ) = x = x σ . If N = 2 , then T (1 , { x n } k =1 ) = x σ and T (2 , { x n } k =1 ) = max { x , x } = x σ . Suppose, by induction on n and N that T ( n − , { x ( j ) k } N − k =1 ) = ( x ( n − σ , if j
6∈ { σ , σ , · · · , ( n − σ } x ( n ) σ , if j ∈ { σ , σ , · · · , ( n − σ } , As T ( n, { x k } Nk =1 ) = max N − n +2 [ j =1 { T ( n − , { x ( j ) k } N − k =1 ) } , by Proposition 3, we have T ( n, { x k } Nk =1 ) = max N − n +2 [ j =1 { T ( n − , { x ( j ) k } N − k =1 ) } = max { x ( n − σ , x n σ } = x n σ . (cid:3) In Statistics, we can use the following Corollary to calculate the Mediane for any finitesequence of real numbers:
JOSIMAR DA SILVA ROCHA
Corollary 1.
The formula above affords us to calculate the Mediane
M d for any finite sequence { x n } Nk =1 of real numbers with N terms: M d = T (cid:0) N +12 , { x n } Nk =1 (cid:1) , if n is odd T ( N , { x n } Nk =1 ) + T ( N +1 , { x n } Nk =1 ) , if n is even Example 2.
The following formulas affords us the n-th smallest term in a finite sequence ofreal numbers for N ∈ { , , , } :For N = 1 : T (1 , { x k } k =1 ) = x For N = 2 : T (1 , { x k } k =1 ) = min { x , x } T (2 , { x k } k =1 ) = max { x , x } For N = 3 : T (1 , { x k } k =1 ) = min { x , x , x } T (2 , { x k } k =1 ) = max { min { x , x } , min { x , x } , min { x , x }} T (3 , { x k } k =1 ) = max { max { x , x } , max { x , x }} For N = 4 : T (1 , { x k } k =1 ) = min { x , x , x , x } T (2 , { x k } k =1 ) = max { min { x , x , x } , min { x , x , x } , min { x , x , x }} T (3 , { x k } k =1 ) = max max { min { x , x } , min { x , x } , min { x , x }} , max { min { x , x } , min { x , x } , min { x , x }} , max { min { x , x } , min { x , x } , min { x , x }} T (4 , { x k } k =1 ) = max { max { max { x , x } , max { x , x }} , max { max { x , x } , max { x , x }}} HE N-TH SMALLEST TERM FOR ANY FINITE SEQUENCE OF REAL NUMBERS. 5
References [1] Robert G. Barthe,
The Elements of Real Analysis,
John Wiley & Sons, New York, 1964.[2] Serge Lang,
Analysis I,
Addison - Wesley, Reading, Mass., 1968.[3] Jeffrey J. McConnell,
Analysis of Algorithms: An Active Learning Approach,
Jones and Bartlett, Ontario,2008.[4] Walter Rudin,
Principles of Mathematical Analysis,
McGraw-Hill, New York, 1976.
Josimar da Silva Rocha