' *** BIN_CHNC.LST *** 2nd GFA-Manual, page 6-9 FUNCTION binomial_chance(number,chance#,n) ' ' *** Two alternatives are possible: U1 and U2 (e.g. heads and tails) ' *** Experiment is done a number& of times (e.g. coin is tossed 100 times) ' *** Chance that U1 occurs is chance# (0-1; e.g. 0.5 for heads) ' *** Chance is returned of n& occurrences of U1 (e.g. 60 times heads) ' *** Function returns 0 if n&>number& ' ' *** Function: Faculty ' LOCAL comb#,n1#,n2#,n3# IF n<=number n1#=@faculty(number) n2#=@faculty(n) n3#=@faculty(number-n) comb#=(n1#/n2#)/n3# RETURN comb#*((chance#)^n)*((1-chance#)^(number-n)) ELSE RETURN 0 ENDIF ENDFUNC ' ***** '