Link to home
Start Free TrialLog in
Avatar of camper12
camper12

asked on

express min function as max

Hi,

I am unable to understand how we can derive: (S,K and cap are positive integers)

3*( max(S-K,0) – max(S – (K+Cap/3),0))

from

3* min(max((S – K,0), Cap/3)

From plugging values in 3* min(max((S – K,0), Cap/3) , I can see that it is equivalent. But how do i think about this?

Thanks
Avatar of ozo
ozo
Flag of United States of America image

Since Cap is a positive integer,
max(Cap/3, 0) = Cap/3
so
max(S-K,Cap/3) = max(S-K, max(Cap/3, 0)) = max(Cap/3,max(S-K,0))
Avatar of phoffric
phoffric

>> 3* min(max((S – K,0), Cap/3)
Invalid expression since there are 3 left parens but only 2 right parens
  3*( max(S-K,0) – max(S – (K+Cap/3) ,0) )
= 3*( max(S-K,0) – max(S – K - Cap/3 ,0) )
= 3*( max( (S-K) , 0) – max( (S – K) - Cap/3 , 0) )

Case 1) Suppose S - K > 0, then
   = 3*(      (S-K)      – max( (S – K) - Cap/3 , 0) )

   Case 1a) And Suppose (S – K) - Cap/3 > 0
   = 3*(      (S-K)      – (S – K) + Cap/3
   = 3 * Cap/3

   Case 1b) And Suppose (S – K) - Cap/3 <= 0
   = 3*(      (S-K)      – 0 )
   = 3*(S-K)
   

Case 2) Suppose S - K <= 0, then
   = 3*( max( (S-K) , 0) – max( (S – K) - Cap/3 , 0) )
   = 3*(          0      – max(  a negative number , 0) )
   = 0

Open in new window


3* min(   max(S – K,0)  , Cap/3 ) 

Case 1) Suppose S - K > 0, then
= 3* min(   (S – K)  , Cap/3 ) 

   Case 1a) And Suppose (S – K) - Cap/3 > 0; i.e., (S – K) > Cap/3
   = 3* min(   (S – K)  , Cap/3 ) 
   = 3* Cap/3
   
   Case 1b) And Suppose (S – K) - Cap/3 <= 0; i.e., (S – K) <= Cap/3
   = 3* min(   (S – K)  , Cap/3 )
   = 3* (S – K)
   
Case 2) Suppose S - K <= 0, then
= 3* min(   0  , Cap/3 )
= 0

Open in new window

This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.