_____________ intro ¯¯¯¯¯¯¯¯¯¯¯¯¯ Many functions for a TI-89 calculator are provided. The goal of these functions is to give all the basic and some not-so-basic distributions used within probability. I do not include distributions that are TOO basic such as uniform distributions. This file uses the following terminology... • CDF - cumulative distribution function • PDF - probablity distribution function, by which I mean (1) a probability mass function (pmf) for discrete random variables or (2) a probability density function (pdf) for continuous random variables Note that, for reasonably-bizarre inputs, my functions will give reasonable outputs. A pmf will return zero if the input has a decimal part. A PDF will equal 0 as its input approaches negative infinity or infinity. A CDF will equal 0 as its input approaches negative infinity or will equal 1 as its input approaches infinity. The CDF associated with a pmf will not be dependent on the decimal part of the input. With that said, unreasonably-bizarre inputs (such as a binomial distribution of 3.2 trials) can very likely give unreasonable results. The TI-89 uses the convention that 0^0 is undefined. This is okay, but the distributions use the convention that 0^0 = 1. The simple way to get around this is to never use p=0 or p=1. If you use either value for p, your TI-89 might give you an undefined answer, but this is okay since these results are trivial. Inputs to these functions cannot be lists except with mhgpdf(K list,x list) and multipdf(p list,x list), in which case both lists must have the same length. A list is a comma-separated sequence of values surrounded by curly brackets. For example, {0.1,0.3,0.2} is a list. None of my functions are interdependent. If you do not want some of the functions, do not copy them to your calculator! _____________ files ¯¯¯¯¯¯¯¯¯¯¯¯¯ The following 17 functions are included... • binomcdf(n,p,x) - binomial distribution CDF • binompdf(n,p,x) - binomial distribution PDF/pmf • exponcdf(λ,x) - exponential distribution CDF • exponpdf(λ,x) - exponential distribution PDF/pdf • geomcdf(p,x) - geometric distribution CDF* • geompdf(p,x) - geometric distribution PDF/pmf* • hgeomcdf(N,K,n,x) - hypergeometric distribution CDF • hgeompdf(N,K,n,x) - hypergeometric distribution PDF/pmf • mhgpdf(K list,x list) - multivariate hypergeometric distribution PDF/pmf • multipdf(p list,x list) - multinomial distribution PDF/pmf • nbincdf(r,p,x) - negative binomial distribution CDF** • nbinpdf(r,p,x) - negative binomial distribution PDF/pmf** • normcdf(low,high,μ,σ) - normal distribution CDF*** • norminv(F,μ,σ) - normal distribution inverse CDF**** • normpdf(x,μ,σ) - normal distribution PDF/pdf • poisscdf(λ,x) - Poisson distribution CDF • poisspdf(λ,x) - Poisson distribution PDF/pmf *The input x is the number of trials needed to get one success. Sometimes, the geometric distribution is of the number of trials BEFORE the first success, so I wanted to be clear. **The negative binomial is, in my experience, rarely defined in the same way. My definitions are... • p = probability of trial being success • r = number of successes • x = number of trials until success r or equivalently... • p = probability of trial being failure • r = number of failures • x = number of trials until failure r After you choose which set of definitions you want based on how you want x to be defined, figuring out the values for p, r, and x is quite simple if you keep in mind that... • probability of success = 1 - probability of failure • number of trials = number of failures + number of successes ***This uses the nInt function, so it is approximate (yet still highly accurate) and can take some time to run. Also, this is not a true CDF, but is CDF(high) - CDF(low), which equals the CDF if you choose -∞ to be the low value. ****This approximates the error function using elementary functions. I am quite surprised by its accuracy. Also, this function can take some time to run. _____________ more info ¯¯¯¯¯¯¯¯¯¯¯¯¯ These functions are under the BSD-new license, so feel free to modify and distribute as long as you abide by license.txt (basically, you have to give me, Bradley Knockel, some credit). If you find bugs or have any questions, please feel free to contact me at www.BradleyKnockel.com