Stok 

Stok is a package for handling stochastic variables in a HP48g calculator. For every variable it is possible to calculate the expected value, the variance, the probability that the variable will have some value x.

download 

Make a new variable

Put the necessary parameters of the variable onto the stack and the press the appropiate costructor in the CST.
 
Example 1
#
User input
Stack
removed
from stack at
1 'a' 'a' 3
2 'b' 'b' 3
3 uni { "uni" a b }
 

Calculate the expected value

Put the variable onto the stace and press 'E' (the fifth element in the CST).
 
Example 2
#
User input
Stack
removed 
form stack at
1 a b nor { "nor" a b } 2
2 E a
 

Calculate the probability that a variable will take a certain value x.

Put the vaule that you are interested in onto the stack (this value may be a symbol). Put the variable onto the stack and press 'f' (the third element inte the CST).
 
Example 3
#
User input
Stack
removed
from stack at
1 'X' 'X' 3
2 a b uni { "uni" a b } 3
3 f 'IFTE(a<X and X<b, 1/(b-a), 0)
 
 

Stucture of the CST

 
Common functions getInterval var f F E comment
Constructors for discrete variables geo po mul bil ber mgeo
Constructors for continous variables nor uni exp gamma
Constructors for compund variables const.mul const.add fun sq interval.make Min
Processes poProc compPoProc
Misc CST stok toNor
 
By: Patricio Patrickson - md93-ppa@nada.kth.se