You are on page 1of 1

Listing 1: Some Code

#This f u n c t i o n w i l l f i n d t h e v a l u e o f x f o r a g i v e n p a r t i c u l a r v a l u e s o f : CDF,
# We have used np . around ( ) t o round t h e x v a l u e t o t h e n e a r e s t i n t e g e r .
d e f f i n d v a l u e o f x ( cdf , x min , x max , p ) :
a l p h a = f i n d a l p h a ( x min , x max , p )
p a r t 1 = x min 1
p a r t 2 = np . l o g ( 1 ( c d f / a l p h a ) )
p a r t 3 = np . l o g ( 1 p )
x = part1 + ( part2 / part3 )
x rounded = np . f l o o r ( x )
r e t u r n x rounded
# x=

[ l n { (1 p x ) x min ( F x ( x ) / a l p h a ) }

l n ( 1 p x ) ]