═══ 1. Introduction ═══ This program is a calculator to compute the binomial function as applied to probability computations. Binomial calculations are useful in situations where there are a number of trials or events with some lesser number of successes. Help is available for the following topics... o Normal calculations. The overall probability of m events being true given n tials, each having a single event probability of p. o Inverse calculations. The single event probability given an overall probability of p with m events being true in n trials. General help for operating and installing the Binomial Probabilty calculator is available for the following topics. o General operation o Command line options o Main program window o Menus o Key pad o Pushbutton controls o Installation o Misc. and history ═══ 1.1. Normal calculations. ═══ When started, the calculator is able to compute several probability values based on a number of successes, m , occuring within n attempts or trials, with each single event having a probability p of being successful. Data input for the binomial calculations is by use of 3 data entry boxes near the top of the main window. These data input controls are: Single probability - Input of the individual probability of success, p, expected for each event. Sample size-events - Input of the total number of events, n, to be used in the calculation. Numb. of successes - Input of the number of successes, m, to be used in the calculation. Note that this number must be less than the sample size. The computed probabilities are shown in three output data boxes located under the heading Probability (Answers). The computed outputs are: == successes - The probability that exactly m successes were obtained in n attempts. <= successes - The probability that m or fewer successes were obtained in n attempts. >= successes - The probability that m or more successes were obtained in n attempts. When the calculator is operating in its normal mode, the window's title says: Binomial probability calculator. See calculator operation for further information regarding the operation of the calculator. Computation Mathematics The basic equation being solved in the program computes the probability of exactly m successes in n trials. This equation is: Where n = The number of trials or attempts. m = The number of sucesses. p = The single event probability. pm = The probability that exactly m successes will be achieved in n trials. This equation is calculated repeatedly to solve the other probabilities presented in the windows, i.e. <= successes and >= successes. ═══ 1.2. Inverse calculations ═══ Inverse operation of the calculator is started by either selecting the Mode toggle item from the menu or using the Mode toggle push button. When the calculator is in inverse operation, the window's title is changed to Inverse Binomial Probability, in additon to some other changes in appearance. In inverse mode, the calculator takes an overall final probability, p, the sample size, n, and the number of successes, m, to find a single event probability. The inverse computation is done on one of the following basis: 1. The number of successes is equal to or less than, <=, the number shown. 2. The number of successes is equal to or greater than, >=, the number shown. Selection of the computation basis is performed by the radio control buttons located to the left of the calculator's key pad. Note that these buttons are shown only when the calculator is operating in the inverse mode. The buttons are labeled <= and >= respectively. Data input for the inverse binomial calculations is by use of 3 data entry boxes near the top of the main window. These data input controls are: Overall probability - Input of the overall probability of success, p, expected. Sample size-events - Input of the total number of events, n, to be used in the calculation. Numb. of successes - Input of the number of successes, m, to be used in the calculation. Note that this number must be less than the sample size. The result, the single event probability required to fulfill the input conditions, is displayed in single data box in the middle of the calcuator. The label on this control is Single probability. See calculator operation for further information regarding the operation of the calculator. Computation Mathematics The basic equation being solved in the program computes the probability of exactly m successes in n trials. This equation is: Where n = The number of trials or attempts. m = The number of sucesses. p = The single event probability. pm = The probability that exactly m successes will be achieved in n trials. This equation is solved repeatedly to find the single event probability. ═══ 2. General operation ═══ Operation of the calculator requires 2 steps: o Data entry. Data entry is performed using the 3 data entry controls on the top half of the calculator. Data can be entered from the computer keyboard, the calculator's key pad, or pasting from the clipboard. o Result calculation. Results are calculated when the Enter pushbutton on the calculator's key pad is selected. Other information available on the calculator's operation are: o Change character size o Copy data to the clipboard o Paste data from the clipboard ═══ 2.1. Command line options ═══ The starting character size of the calculator can be forced to be smaller by using a /s or /S on the command line used to start the calculator. When operating the calculator's character size can be changed by using the Options/Font size menu item. ═══ 2.2. Data entry ═══ Data entry is performed using the 3 data entry controls on the top half of the calculator. The topmost control is used for entry of probability data. The second control from the top is used to enter the sample size data. The third control, the last one in the data entry area, is used to enter the number of successes. Selection of the active data entry control can be performed by using one of the following methods: 1. Clicking on the desired data entry control with the left mouse button. 2. Using pushbuttons on the calculator's key pad. These buttons are labeled Probability, Events, and Successes. 3. Use the Tab or Enter keys on the keyboard to move to the next data entry control. The current active data entry control is highlighted by a different (white) background color on the control's label. Once the desired active control has been selected, actual data entry can be performed by: 1. Typing the data from the keyboard. When typing information from the keyboard, the program allows only numeric data to be entered. 2. Using the numeric keys on the calculator's key pad. When using the key pad's keys, any text information that has been selected, shown by reverse video, is deleted before the before the new character is inserted. 3. Pasting data from the clipboard. Selecting the Paste option from either the menus or the Paste control button will replace all data in the active data entry window with data currently stored in the clipboard. Data limits The calculator tests all input data for acceptability before performing any results calculations. If the data is not acceptable, a message box is displayed indicating the type of error that has been found. The data limits for the various inputs are: o Probabilities. All input probabilities must be between the value of 0.0 and 1.0. Values equal to 0 or 1 are not acceptable. o Sample size (events). The sample size is an integer value that is greater than 1. The program has a maximum sample size limit of 1,750 to avoid overflow errors. Be aware however, that sample sizes over a few hundred can slow down result calculations. o Successes. As a general rule, the number of successes must be an integer value greater than 0 and less than the value used for the sample size. Error trapping for this parameter however, is set at less than 0 and greater than the sample size. ═══ 2.3. Result calculation ═══ The results are calculated by selecting the Enter push button on the calculator's key pad. Before performing computations, the calculator tests all the input data for acceptability. If any data entry errors are found, an appropriate error message box is displayed, giving the reason for the error. See Data entry for further information on the program's data checking capabilities and limits. ═══ 2.4. Copying data to clipboard ═══ To copy data to the OS/2 clipboard, perform the following operations: 1. Select the data entry/display control you wish to copy from by clicking it with the left mouse button. Note the this applies to the controls used for data output in addition to the controls that actually require input data. 2. Select the Copy menu item or the Copy push button to move the data from the selected control to the OS/2 clipboard. ═══ 2.5. Pasting data from clipboard ═══ To paste data from the OS/2 clipboard to one of the data entry controls, perform the following steps: 1. Select the input data entry control you wish to paste data to by clicking it with the left mouse button, using a key on the calculators key pad, or using the Enter or Tab key on the computer keyboard. 2. Select the Paste menu item or the Paste push button to move the data from the OS/2 clipboard to the active data entry control. Note that when pasting data from the clipboard to a data entry control, ALL of the data in the control is replaced. ═══ 3. Main program window ═══ The calculator's main window consists of: o Menu bar o Data input area o Data output area o Key pad o Control pushbuttons ═══ 3.1. Program menus ═══ The program's menu bar contains the following groupings and items: o Edit - Copy - Paste - Exit o Options - Mode toggle - Font size o Help - Help - About ═══ 3.1.1. Copy menu item ═══ Selecting the Copy menu item copies the data contained in the active data entry control into the OS/2 system clipboard. This function is also replicated by the Copy control push button. For further information on copying data to the clipboard, see: o Copying data ═══ 3.1.2. Paste menu item ═══ Selecting the Paste menu item pastes information from the OS/2 clipboard into the currently active data entry control. This function is replicated by the Paste control push button. For further information on pasting data from the clipboard, see: o Pasting data ═══ 3.1.3. Mode toggle menu item ═══ Selecting this menu item switches the operating mode of the calculator between normal and inverse. The Mode toggle menu item also replicates the Mode toggle push button. ═══ 3.1.4. Font size menu item ═══ Selecting this menu item switches the size of the characters used for display of information on the calculator's face. The calculator's normal default condition is large characters. When the calculator is used on system's that make use of a 1024x768 display resolution with large size system fonts, the text display must make use of a smaller font to properly display the information. The calculator's start-up character size can be forced to the smaller size by using a /s or /S parameter on the command line used to start the calculator. ═══ 3.1.5. Exit menu item ═══ Selecting the Exit menu item terminates execution of the program. ═══ 3.1.6. Help menu item ═══ Selecting the Help menu item displays user information for using the calculator program. The program's help conventions are standard with those generally used with OS/2 application programs. ═══ 3.1.7. About menu item ═══ Selecting the About menu item displays information about the program, including the version number and date. ═══ 3.2. Data input area ═══ The program's data input area consists of the 3 topmost data entry controls on the main program window and their labels. The label for the currently active data input control is highlighted with a different color (white) background. The data entry windows are: Probability. This control control is used to enter the base probability information required by the program. This is the single event probability when the calculator is operating in normal mode and the overall probability when the calculator is operating in its inverse mode. Note that the label for this control also changes with the operating mode. Sample size(events). This control is used to enter the total sample size to considered in the calculations. Numb. of successes. This control is used to enter the number of successes to be used in the calculations. The program does testing on the values to determine the potential correctness of the data that has been entered. See the data entry section for further information about the data validity tests as well as entry of data itself. ═══ 3.3. Data output area ═══ The program's data output area is located near the center of the calculator's main program window. When the calculator is operating in its normal mode, 3 output data controls and their labels are shown. The number of output data controls reduces to 1 when the calculator is operating in its inverse mode. Labeling of the ourput controls also changes with the calculator's operating mode. Although the output controls can receive the program's focus by clicking on them with the left mouse button, the controls cannot receive any input. The ability to receive the program's current focus is necessary to allow data to be copied from the control to the OS/2 clipboard. See copying data for further information. ═══ 3.4. Calculator Keypad ═══ The calculator's key pad is located on the bottom, right side of the main program window, and consists of multiple push button type controls which may be selected with the left button of the mouse. The keys and their functions are: Numeric keys 0-9. Selection of any one of these controls will add that number to the end of the data shown in the currently active data input window. Note that if the currently active data input control has selected text, shown by reverse video, the selected text is deleted and the new number added to the end of the remaining data. Enter. Selection of the Enter button forces an immediate calculation of results. It is necessary to make this selection after data has been entered or changed to have the output data be correct. Ce. (Clear entry) Selection of this key clears all of the data currently contained in the active data input entry control. Note that if the active control is for probability, the control is initialized with 0. characters. <-. (Clear last character) Selection of this button erases the last character displayed in the active data input entry control. Prob. Selection of this button forces the current active data input control to be probability data entry. Numbers to the right of the decimal point in the probability control are also selected for possible deletion when this button is depressed. Events. Selection of this button forces the current active data input control to be Sample size(events) data entry. Data currently in the control is selected for possible deletion when this button is depressed. Successes. Selection of this button forces the current active data input control to be Numb. of successes data entry. Data currently in the control is selected for possible deletion when this button is depressed. ═══ 3.5. Control pushbuttons ═══ The calculator has several control push buttons available. These buttons are: The Copy button. This button copies data from the curent active input or output control to the OS/2 clipboard. The pushbutton also replicates the Copy menu item function. For further instructions on copying data to the clipboard, see: Copying data. The Paste button. This button pastes data from the OS/2 clipboard to the current active data entry control. The pushbutton also replicates the Paste menu item function. For further instructions on pasting data from the clipboard, see: Pasting data. The Mode toggle button. This push button toggles the operating mode of the calculator between normal and inverse. The pushbutton also replicates the Mode toggle menu item. When the calculator is running in inverse mode, there are 2 radio buttons to the left of the keypad. These buttons are labeled <= and >=, and control the basis upon which the calculator decides the meaning of the overall probability data. For further information on this aspect of the calculator's operation, see Inverse calculations. ═══ 4. Installation ═══ As distributed, the program consists of 2 files plus a README file. The files are: PROBABIL.EXE - The executable program. PROBABIL.HLP - The program's Help file. The suggested program installation consists of copying both files to the same directory. Copy a program object from the Templates folder on your desktop to the desired folder for execution, then insert the proper drive and directory information into the object's setup notebook. Note that both the Path and file name and Working directory entries on the notebook have to be set to the same drive and directory for the program to find the help directory. This program makes no entries in the OS/2 .INI files. ═══ 5. Misc. Information ═══ The following misc. information is available: o License o Warranty o Support o Program history ═══ 5.1. License ═══ This program has been placed into the public domain by the author, and may be freely distributed and copied, provided no charge is made. It maybe included in collections of software etc. in which the distributor makes a nominal charge for the media it is distributed on. ═══ 5.2. Warranty ═══ There is no warranty of any kind, either expressed or implied, associated with this program. Use of the program is at the sole risk of the user. ═══ 5.3. Support ═══ I am interested in learning about bugs, enhancement suggestions etc. that you may have. Please remember that all support is strictly subject to the availability of my time etc. The program was originally written in support of my normal job, for which ver. 1.00 was fully adequate. Address all questions etc. via Internet e-mail to: nelson@radar.nrl.navy.mil ═══ 5.4. Program history ═══ Version 1.10 - 10/31/93. Added the ability to change the character size used by the calculator. This was done to correct a problem with the standard text being to large when the program was run on systems using 1024x768 resolution with large system character fonts. The character size can be forced to small characters by using a /s argument on the command line or from the new Options/ Font size menu item. Version 1.01 - 10/16/93. First public release of the program.