Skip to content

Maximum and Minimum

MthwRobinson edited this page Dec 21, 2014 · 1 revision

Maximum and Minimum

The Maximum and Minimum procedures compute the distribution of the maximum and minimum of a series of random variables. These procedures can accept a variable number of arguments. For instance, Maximum(X,Y) can be entered to compute the maximum of two random variables and Maximum(W,X,Y,Z) can be entered to compute the maximum of four random variables. MaximumIID(X,n) and MinimumIID(X,n) can be used to compute the maximum or minimum of n IID random variables.

Syntax and Behavior

Maximum(X,Y,...,Z)
Minimum(X,Y,...,Z)
MaximumIID(X,n)
MinimumIID(X,n)

Examples

In [34]: X=TriangularRV(Rational(2),Rational(4),Rational(6))

In [35]: Y=TriangularRV(Rational(3),Rational(5),Rational(7))

In [36]: Z=TriangularRV(Rational(4),Rational(5),Rational(9))

In [37]: # Compute the maximum of two random variables

In [38]: A=Maximum(X,Y)

In [39]: A.display()
continuous pdf
for 3 <= x <= 4
---------------------------2          ⎞             ⎛ 2          ⎞
(2x - 6)⋅⎝x  - 4x + 4⎠   (2x - 4)⋅⎝x  - 6x + 9⎠
──────────────────────── + ────────────────────────
           64                         64           
---------------------------
 
 
for 4 <= x <= 5
---------------------------2          ⎞             ⎛ 2            ⎞
  (2x - 12)⋅⎝x  - 6x + 9⎠   (2x - 6)⋅⎝x  - 12x + 28- ───────────────────────── - ──────────────────────────
              64                          64            
---------------------------
 
 
for 5 <= x <= 6
---------------------------2            ⎞              ⎛ 2            ⎞
(2x - 14)⋅⎝x  - 12x + 28⎠   (2x - 12)⋅⎝x  - 14x + 41⎠
─────────────────────────── + ───────────────────────────
             64                            64            
---------------------------
 
 
for 6 <= x <= 7
---------------------------
  x   7
-+4   4
---------------------------
 

In [40]: # Compute the minimum of three random variables 

In [41]: B=Minimum(X,Y,Z)

In [42]: B.display()
continuous pdf
for 2 <= x <= 3
---------------------------
x   1-4   2
---------------------------
 
 
for 3 <= x <= 4
---------------------------
x   1-4   2
---------------------------
 
 
for 4 <= x <= 5
---------------------------4       3       2           ⎞   ⎛ 2           ⎞ ⎛   3       2     
(2x - 8)⋅⎝x  - 10x  + 21x  + 20x - 4⎠   ⎝x  - 8x + 11⎠⋅⎝4x  - 30x  + 42
───────────────────────────────────────── + ──────────────────────────────────
                   320                                         320            

       ⎞
⋅x + 20⎠
────────
        
---------------------------
 
 
for 5 <= x <= 6
---------------------------4       3       2           ⎞   ⎛ 2            ⎞ ⎛   3       2 
  (2x - 18)⋅⎝x  - 10x  + 21x  + 20x - 4⎠   ⎝x  - 18x + 81⎠⋅⎝4x  - 30x  
- ────────────────────────────────────────── - ───────────────────────────────
                     1280                                          1280+ 42x + 20⎠
────────────
            
---------------------------
 

In [43]: # Compute the maximum of 3 IID random variables

In [44]: C=MaximumIID(X,3)

In [45]: C.display()
continuous pdf
for 2 <= x <= 4
---------------------------4      3       2            ⎞   ⎛ 2          ⎞ ⎛   3       2      
(2x - 4)⋅⎝x  - 8x  + 24x  - 32x + 16⎠   ⎝x  - 4x + 4⎠⋅⎝4x  - 24x  + 48⋅
───────────────────────────────────────── + ──────────────────────────────────
                   512                                         512x - 32⎠
───────
       
---------------------------
 
 
for 4 <= x <= 6
---------------------------4       3        2              ⎞   ⎛ 2            ⎞ ⎛   3     
  (2x - 12)⋅⎝x  - 24x  + 200x  - 672x + 784⎠   ⎝x  - 12x + 28⎠⋅⎝4x  - 72
- ────────────────────────────────────────────── - ───────────────────────────
                       512                                              512   

  2              ⎞
⋅x  + 400x - 672⎠
──────────────────
                  
---------------------------
Clone this wiki locally