Back to Home Page

Program Index


All rights involving use, publication, etc, of this code are reserved by the author. Permission is given to use any of this code for non-profit/educational purposes. (I would appreciate your giving me credit for the code in some way visible to the user.) For commercial use, please contact me.
I compiled the .c files on our system with "gcc -o outputfile inputfile.c [-lm]" (where the -lm is only required if the source includes math.h.)
The .cpp files were compiled with "g++ -o outputfile inputfile.cpp [-lm]"
I intend to write some documentation; however, except perhaps for ccalc.c and sat.c, it should be fairly easy to just look at the source code. Many of the programs return usage info if they are executed with no (or the wrong number of) arguments. Some wait for data to be typed in after the program begins executing (e.g. the program "mean".) For these, input redirection from a file is then possible (e.g. you can type "mean<filename" where filename is a file of data values); if data is typed in manually, the end of the data should be signalled by the appropriate end-of-file character on a line by itself. (For Unix this is ctrl-d, and for DOS it is ctrl-z.)
  • F_norm.c [Computes cumulative Normal Distribution]
  • allqres.c [Computes all quadratic residues mod m]
  • ccalc.c [Calculator with LOTS of functions; programmable]
  • ccalc.doc [Doc file for calculator]
  • d.c [Computes number of divisors]
  • day.c [Computes day of the week given a date]
  • dec2bin.c [Converts decimal to binary]
  • f_n.c [Computes cdf of Normal; uses function in "stats.uti"]
  • gcd.c [Computes greatest common divisor]
  • gr.c [My version of "grep"]
  • lcong.c [Computes solutions of linear congruences]
  • ldiop.c [Computes solutions of linear diophantine equations]
  • mean.c [Computes mean of sample]
  • mod.c [Computes a^k (mod m)]
  • number.uti [Include file for the number theory functions]
  • ord.c [Computes order of a (mod m)]
  • pfac.c [Computes prime factorization]
  • phi.c [Euler phi function]
  • primrt.c [Computes primitive roots]
  • qres.c [Computes quadratic residues of a (mod m)]
  • sat.c [A game in which the satisfiability problem must be solved]
  • satgen.c [Generates data for the above]
  • satgen3.c [Ditto]
  • sieve.c [Sieves to produce primes <= 10000]
  • sigma.c [Sum of divisors function]
  • stats.uti [Include file for some of the statistical functions]
  • string.uti [Include file]
  • svar.c [Computes sample variance; n-1 in denom.]
  • var.c [Computes variance]
  • gamma.c [Computes gamma function. Good accuracy for arguments between .5 and 9; quite good for integer and integer+.5 arguments. Recall that gamma(n)=(n-1)! for integer argument.]
  • f_gamma.c [Computes cdf of gamma distribution]
  • f_chisqr.c [Computes cdf of chisquare distribution]
  • f_t.c [Computes cdf of t distribution]
  • f_f.c [Computes cdf of F distribution]
  • count.c [Counts data values and finds min and max, or counts data values in an
    interval (a, b]; Usage: count<filename or count a b <filename.]
  • makernd.c [Writes a file, data.rnd, of random numbers in [0,1].]
  • programs.zip [Zipped executables of all of the above programs for DOS. ***Doesn't include doc files.]
  • mort.cpp [Computes mortgage payment and will make a monthly schedule listing amount of payment towards interest and principal.]
    The programs in this section are parts of a general statistical package I am writing. It is only partially completed, but the current version runs and does useful calculation; e.g., values of the cdf and percentage point values for many common distributions are computed, linear regression in up to 10 independent variables is implemented, etc. The file statshlp lists the commands presently available. Suggestions on additions, modifications or other comments are appreciated.
  • stats.cpp [The main program]
  • stats2.uti [Utilities; include file for stats.cpp]
  • statsrc [File read by stats.cpp at startup]
  • statshlp [Help file]
  • stat.zip [Zipped files for stats program together with a DOS executable. May not be as up to date as the version above.]

  • C.Friedman
    Math.Dept. RLM 8-100
    University of Texas
    Austin, TX 78712
    Phone(Office): 512-471-5161
  • Comments, suggestions, improvements? Email me:
  • [an error occurred while processing this directive]