Code Experiment

Post on 25-Dec-2015

212 views 0 download

description

How to creating a document using latex

Transcript of Code Experiment

Listing 1: Some Code

#This func t i on w i l l f i nd the value o f x f o r a g iven p a r t i c u l a r va lue s o f : CDF, x min , x max , p , where p = p r obab i l i t y o f su c c e s s .# We have used np . around ( ) to round the x value to the nea r e s t i n t e g e r .

de f f i n d v a l u e o f x ( cdf , x min , x max , p ) :

alpha = f i nd a lpha ( x min , x max , p)part1 = x min − 1part2 = np . l og (1 − ( cd f / alpha ) )part3 = np . l og (1 − p)x = part1 + ( part2 / part3 )x rounded = np . f l o o r ( x )

re turn x rounded

# x= [ ln { (1−p x )∗∗ x min − ( F x (x )/ alpha ) } / ln (1 −p x ) ]

1