computer production of punched paper tapes for controlling experiments

Post on 09-Dec-2016

212 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Computer production of punched paper tapesfor controlling experiments

from previous program runs. When allrequired punch sets have been defined,the user types an exclamation point tomove on to the next section of theprogram.

WALTER vom SAAL*, Princeton University, Princeton, New Jersey 08540and

ROBERT vom SAAL, Gibbs and Cox, Inc., New York, New York 10006

Controlling experiments with paper-tape readers often requires the productionof complex paper tapes. A program was written to allow automatic productionand checking of complex punched paper tapes using a small computer. The userfirst defines the punches or punch sets to be used. He then specifies, for eachsuccessive block of tape to be punched, the number of punch sets of each tYPE)to occur and whether those punch sets should be copied in order orautomatically randomized. The specified tape is then produced using a two-passprocedure, after which the tape may be automatically checked for punchingerrors if desired. The program has facilities for retention or modification of usercommands from previous runs, simplifying the production of a large number oftapes with similar characteristics.

Many scientific laboratories employcontrol equipment utilizing punchedpaper-tape readers. For example, alarge number of psychologicallaboratories use relay or solid-stateequipment to present experimentalevents, with the sequence and timingof these events controlled by apaper-tape reader. As the complexityof experiments and the sophisticationof control equipment has increased, amajor limitation on the sorts ofexperiment that can be run hasbecome the feasibility of producingand checking paper tapes of the lengthand complexity required. In manylaboratories, paper tapes are punchedone character at a time using a punchkept for that purpose, a method that islaborious, prone to error, and simplyimpossible to use when tapes ofconsiderable complexity are required.

One solution to the problem ofmaking complex paper tapes is tomake them with the aid of acomputer. Small computers that candirectly punch paper tape arebecoming more and more common,and many laboratories could gainoccasional access to such a computer.The present article describes a programwritten to allow the automaticproduction and checking of complexpaper tapes by such a computer.

FACILITIESThe program may be run on Digital

Equipment Corporation PDP-8 orPDP-12 computers. Only the basiccomputer with Teletype is required,but program options allow the use of ahigh-speed paper-tape reader and/orhigh-speed paper-tape punch ifavailable.

*Requests for reprints should be sent toWalter vom Saal , Department ofPsychology, Princeton University,Princeton, New Jersey 08540.

PROGRAM OPERATIONThe program is best described by

summarizing the several steps involvedin using it. Mter loading the program,the user must (1) define the requiredpunch sets, (2) enter the set-ordercommands, (3) produce the specifiedtape in two passes, and (4) check thetape if desired.

Defining Punch SetsIn this section of the program, the

user defines the punch sets he will use.As the computer types out eachconsecutive set name (AA, AB, etc.),the user responds with one or moreoctal numbers specifying the punchesto occur in that set, followed by acarriage return after the last octalnumber. For example, suppose theuser wants to repeatedly use a set ofthree punches, the first punch having ahole in Column 1, the second havingholes in Columns 1 and 2, and thethird having holes in Columns 1, 2,and 3. In this case, when the computertypes "AA," the user types "1, 3, 7[carriage return]." In the next sectionof the program, each time the userwants this particular punch set to bepunched, he refers to it by the name"AA."

Each punch in a punch set isdefined by typing a single octalnumber so that punches are notrestricted to ASCII characters. Apunch set may contain from 1 to morethan 100 separate punches, and up to120 punch sets may be defined. Thereis a restriction, however, on the totalnumber of punches that may bespecified in this section of theprogram.

This section of the program may beomitted if definitions from previousprogram runs are to be retained. Inaddition, a number of specialcommands allow the user to cancelincorrectly entered definitions, retain,or partially modify certain definitions

Entering Set-Order CommandsIn this section the user enters

commands indicating the punch setsthat should be punched in successiveblocks of tape. He also indicateswhether or not to randomize thepunch sets in each block. For example,to randomize 5 Type AA punch setsand 10 Type AB punch sets, the usertypes:

5AA, 10AB, * (carriage return).

To punch directly 5 Type AA punchsets followed by 10 Type AB punchsets, the user types:

5AA, 10AB, (carriage return).

Successive blocks of punch sets maybe of different length and may containdifferent punch sets, and each blockmay be either randomized or copieddirectly.

This section of the program may beomitted if previous set-ordercommands are to be retained. This isuseful, for instance, in producingseveral tapes with the same blocks ofrandomized punch sets, but withdifferent random orders. After allset-order commands have beenentered, the user types an exclamationpoint to move on to the next sectionof the program.

Producing TapesAt this point, the program produces

two tapes. The first contains acomplete list of all punch sets in thefinal randomized order. As this firsttape is produced, the set names aretyped on the Teletype as a record ofthe random orders that have beengenerated. When the first tape isfinished, it is read back into thecomputer and used by the program toproduce a second tape containing theactual punch sets in the orderspecified.

Checking TapesThe program has facilities to check

both tapes for punching errors. Thefirst tape is automatically checked forthe correct total number of punch setsof each type when it is read back in toproduce the second tape. The secondtape may be fully checked if desiredby reading it back in along with thefirst tape in a final pass of theprogram.

Example of Program UseTo illustrate use of the program, the

Teletype output of a sample run and

Behav. Res. Meth. & Instru., 1971, Vol. 3 (6) 319

3AAI

OBJECT TAPE ON H OR L PCH? L

NEW SET ORDER? (Y OR N) Y

10ABI 10ACI *

sequence in the sense that theparticular event occurring on each trialcould not be predicted from the eventsthat happened on previous trials.However, it would have the possibledisadvantage that the number ofevents of each type would not be fixedbut would fluctuate from onesequence to the next. If the E wantedto have 50 As and 50 Bs in eachsequence, he would use the secondgeneral randomization procedure,which is simply to select 50 As and 50Bs and rearrange them into a randomorder. This procedure is equivalent torandom sampling from a pool of 50 Asand 50 Bs, without replacement. Whenit is used, the occurrence of aparticular event on Trial n is notindependent of previous events: on theaverage, long runs of events of onetype will be followed by an increasedprobability of events of the othertype, and a S keeping track of whatevents occurred on the first 99 trialscould predict perfectly what wouldoccur on the 100th trial (if he knewthe characteristics of the sequence).However, a sequence produced byusing this procedure is still random inthe sense that the particular permu­tation of events used is sampledat random from all the possiblepermutations. It was this secondgeneral randomization procedure thatwas used in the present program.

One technique sometimes used torandomize the order of N items in acompute.program is to (1) list the Nitems in one memory bank,(2) generate a random numberassociated with each item and listthese in a second memory bank, andthen (3) copy the original N items intoa third memory bank in a new orderdetermined by ranking the randomnumbers associated with each item.The disadvantage of this procedure isthat 3N memory locations arerequired. The "random swapping"procedure used in the present programwas slightly more complicated, butrequired only N memory locations.This procedure involved randomsampling without replacement from acontinually shrinking list. For eachitem, i, between 1 and N, a randomnumber, r, between i and N wasgenerated and Item r was exchangedwith Item i. The value of i was thenincremented, and the processcontinued. At each point in thisprocess, the items between i and Nwere the items remaining in theoriginal list, and the random number,r, indicated which of those items wassampled. By exchanging Item r withItem i at each point, it was possible tostore the new list of items in the spaceabandoned as the original list wasreduced in size, so that a total of onlyN memory locations was required.

•••• ••

E wants to present either Event A orEvent B on each trial, randomly, for atotal of 100 trials. The first procedurehe could use would be to select eitherEvent A (with probability .5) orEvent B (with probability .5) on eachtrial, and repeat this for 100 trials.This would produce a random

•••••••

••••••

AAI AAI AAI

ABI ACI ACI ACI ARI ABI AS, AC, tiC, AC,ABI ABI A.81 ABI AC, AC, A8, AC, AC, AU,

AD, AD, AD,

AA=01 11 31 '7 •Al3=40.-AC=200·,AD=71 31 11 0!

NEW DEFINITION OF SETS? (Y OR ~) Y

SET-ORDER TAPF. ON H OR L PCH? L

SET-ORDER TAPE ON H OR L RDR? L

••• ••• ••• ••• ••• ••••• •• •• •• •• ••• • • • • •• • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • • •

RANDOMIZATIONThere are two general procedures by

which a series of events may berandomized. Consider a case where an

the final tape produced are shown inFig. 1. User responses on the Teletypeare underlined.

Fig. 1. Teletype output illustrating use of the program. User responses areunderlined. The final tape produced is shown beneath the Teletype output.

320 Behav. Res. Meth. & Instru., 1971, Vol. 3 (6)

Each time a user commandindicated that randomization was tooccur in the present program, thisrandom swapping procedure wasrepeated 16 times on the list of punchsets specified. Repetition of theswapping procedure was intended toreduce the effect of whatever biasesmight exist in the random numbergenerating program. The randomnumber generator was based on onedescribed by Brady (1965) and foundto perform satisfactorily according toa number of statistical tests (Brady,1965; Griffith, 1969). Brady'sprogram was modified to run on thePDP-8 and to transform the numbersgenerated by his program intonumbers between 1 and k, where kcould be set to any desired value.

In order to avoid the production ofidentical sequences from identical

startups, it is necessary to prime therandom number generator. In thepresent program, this is accomplishedby having the user type in an arbitraryfour-digit number on the first use ofthe program each time it has beenreloaded. The random numbergenerator is then primed by beingcalled repeatedly as many times as thenumber that was typed.

CONCLUSIONSThis program is currently being used

in three different psychologicallaboratories to produce punched papertapes to control experiments. Thereare probably many other laboratorieswhere such a program would be veryuseful if a small computer, such as thePDP-B, were available for occasionaluse. The ability to produce complexpaper tapes using such a program can

significantly increase the capacity andversatility of existing controlequipment.1

REFERENCESBRADY. P. T; A pseudo random number

generator. Digital Equipment ComputerUsen Society Program No. 5-25, 1965.Digital Equipment Computer UselllSociety, 146 Main Street, Maynard.Massachusetts 01754.

GRIFFITH, G. A. A pseudo randomnumber generator for the PDP-8 for usewith FOCAL. Digital EquipmentComputer Usellt Society Program No.FOCAL-1, 1969. Digital EquipmentComputer Usem Society, 146 MainStreet, Maynard. Massachusetts 01754.

NOTE1. The binary tapes required for running

this program and an operating manual areavailable from the first author at theDepartment of PSYchology, PrincetonUniversity. Princeton. New Jersey 08540.

Behav. Res. Meth. & Instru., 197)., Vol. 3 (6) 321

top related