Baseball Probability written in 8 different languages
Computes the probability that the 1st place team will beat the 2nd place team for the division title, assuming each has a 50-50 chance of winning any given future game. Uses a bivariate binomial distribution as a model.
For the programs the inputs are:
- GL1 = Games Left to play, 1st place team
- GL2 = Games Left to play, 2nd place team
- GE = Games to play each other
- GA = Games ahead = 0, 0.5, ...
The outputs are:
- MNT1 = Magic Number to tie for 1st place team
- MNW1 = Magic Number to win for 1st place team
- MNT2 = Magic Number to tie for 2nd place team
- MNW2 = Magic Number to win for 2nd place team
- P = Probability that 1st place team beats 2nd place team
- Q = Probability that 2nd place team beats 1st place team
- 1/Q = 1 / Probability that 2nd place team beats 1st place team
- Odds = P/Q : 1 (=1/Q - 1 : 1)
The source and object files are:
- BBallP.Pas, BBallP.Exe : Pascal version
- BBallC.C, BBallC.Exe : C version
- BBallCpp.Cpp, BBallCpp.Exe : C++ version
- BBallCpW.Cpp, BBallCpW.Exe : C++ for Windows version
- BBallQ.BAS, BBallQ.Exe : QBASIC version
- BBallB.BAS, BBallB.Exe : GWBASIC version
- BBallF.FOR, BBallF.Exe : FORTRAN version
- BBallA.Pkg, BBallA.Exe : ADA version
|