|
We're glad you came by, but you might find what you're looking for elsewhere. TI-Basic Developer is not the site it once was. While its information on commands and other calculator features remains almost second-to-none, its forum, archives, and even hosting service, Wikidot, have been decaying for years. The calculator community would love to see what you're working on, or help you in your next coding adventure, but TI-Basic Developer is no longer the place to do it. Instead, you should head over to Cemetech (primarily American) or TI-Planet (primarily international). Both are active, well-established forums with their own archives, chatrooms, reference material, and abundant coding tools and resources. We'll see you there, we hope. |
Generates a random normally-distributed number with specified mean and standard deviation.
randNorm(µ,σ,[n])
Press:
- MATH to access the math menu.
- LEFT to access the PRB submenu.
- 6 to select randNorm(, or use arrows.
TI-83/84/+/SE
2 bytes
randNorm(µ,σ) generates a normally-distributed pseudorandom number with mean µ and standard deviation σ. The result returned will most probably be within the range µ±3σ. randNorm(µ,σ,n) generates a list of n normally-distributed pseudorandom numbers with mean µ and standard deviation σ.
seed→rand affects the output of randNorm(.
0→rand
0
randNorm(0,1)
-1.585709623
randNorm(0,1,3)
{-1.330473604 1.05074514 -.0368606663}Although a theoretical normally distributed variable could take on any real value, numbers on a calculator have a limited precision, which leads to a maximum range of approximately µ±7.02σ for values of randNorm(.
Optimization
When the mean is 0 and the standard deviation 1, invNorm(rand) and invNorm(rand(N)) save space over randNorm(0,1) and randNorm(0,1,N) respectively.
Formulas
The value of randNorm( for a given seed can be expressed in terms of rand:
randNorm(µ,σ)=µ-σinvNorm(randThis is identical to the output of randNorm( in the sense that for the same seed, both expressions will generate the same random numbers.
The following formula can be used to get a target interval where A and B are two real intervals.
µ=(A+B)/2
σ=(-A+B)/6Related Commands
.