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
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
>> 3* min(max((S – K,0), Cap/3)
Invalid expression since there are 3 left parens but only 2 right parens
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
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
This question needs an answer!
Become an EE member today
7 DAY FREE TRIALMembers 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.
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))