binomcdf

From DavinciWiki
Jump to: navigation, search

Citation

1.10

Description

Binomial distribution cumulative probability distribution function

Arguments and Return Values

Arguments: Numbers specifying the total number of trials (n) and the probability of success in each trial (p), and arrays specifying the number of successes for which the probability is to be computed (k1 and k2)

Return Value: The probability of having between k1 and k2 (inclusive) successes in n trials

If no arguments are input, binomcdf() prints its description, as shown below.

Usage

Syntax: binomcdf(n=n, k1=k1, k2=k2, p=p)

'n' - the total number of trials; must be scalar (1x1x1)

'k1' - the minimum number of successes

'k2' - the maximum number of successes

Either k1 or k2 (but not both) can be arrays.

'p' - the probability of success in any single trial (which is the same for all trials in a binomial distribution); p must be scalar, between zero and one; if p is omitted, the function will default to 0.5

So, to find the probability of getting at least 6 heads when flipping a coin 10 times, use binomcdf(n=10, k1=6, k2=10, p=0.5)

The arguments don't have to be in a specific order, but they all MUST be passed by reference.

Examples

dv> binomcdf()

Binomial distribution cumulative distribution function
binomcdf(n=n, k1=k1, k2=k2, p=p)
You MUST pass all arguments by reference (not by value)
n is the number of trials
k1 and k2 are the number of successes
p is the probability of success in each trial
n and k must be positive integers
p must be a real number 0 <= p <= 1
If p is omitted, this function will use p = 0.5
n and p must be scalar
Either k1 or k2 (but not both) can be an array
Returns the probability of k1 to k2 (inclusive) successes in n trials
binomcdf(n, k1, k2, p) = sum(binompmf(n, k1:k2, p))
S.Marshall 02-11-2008

0
dv> binomcdf(n=5, k1=create(6), k2=5)
6x1x1 array of float, bsq format [24 bytes]
1.00000 0.968750        0.812500        0.500000        0.187500        0.0312500

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Library Changes

Created On: 02-19-2008
Modified On: 02-19-2008

Personal tools