Code Experiment

1
Listing 1: Some Code #This function will find the value of x for a given particular values of : CDF, # We have used np.around() to round the x value to the nearest integer . def find value of x (cdf , x min , x max , p): alpha = find alpha(x min , x max , p) part1 = x min - 1 part2 = np.log(1 - (cdf/alpha)) part3 = np.log(1 - p) x = part1 + (part2/part3) x rounded = np. floor(x) return x rounded # x= [ln { (1 - p x) ** x min - (F x(x)/ alpha) } / ln (1 -p x) ] 1

description

How to creating a document using latex

Transcript of Code Experiment

Page 1: 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