<< bigaussianpdf Distribution Functions chisq >>

sci_gsl >> sci_gsl > Distribution Functions > binomial

binomial

Binomial Distribution

Syntax

y = binomial(p,n,k,c)

Parameters

y:

output

p:

probability of success

n:

Total number of independent trials. It takes only positive integer values.

k:

k is number of success. It can be only within the range 0 and n.

c = 1:

It will allow the user to generate a binomial random variate, the number of success in n independent trials with probability p. In this case the function is independent of k and hence any value of k can be set.

c = 2:

It will allow the user to compute the probability p(k) of obtaining k from a binomial distribution with parameters p and n.

c = 3:

It will allow the user to compute binomial cdf P(k)

c =>4:

It will allow the user to compute binomial cdf Q(k)

Description

This function is used to calculate binomial random variate, probability p(k) of obtaining k from a binomial distribution and cumulative distribution functions P(k), Q(k).

Examples

// probability p(k) of obtaining k=5 from binomial distribution with  p=0.5 and n=10
p=0.5
n=10
k=5
c=2
y = binomial(p,n,k,c)
disp(y)

Authors


Report an issue
<< bigaussianpdf Distribution Functions chisq >>