randomness on a micro

2
Randomness on a micro Author(s): David Myers Source: The Mathematics Teacher, Vol. 76, No. 6 (September 1983), p. 398 Published by: National Council of Teachers of Mathematics Stable URL: http://www.jstor.org/stable/27963573 . Accessed: 18/07/2014 07:27 Your use of the JSTOR archive indicates your acceptance of the Terms & Conditions of Use, available at . http://www.jstor.org/page/info/about/policies/terms.jsp . JSTOR is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range of content in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new forms of scholarship. For more information about JSTOR, please contact [email protected]. . National Council of Teachers of Mathematics is collaborating with JSTOR to digitize, preserve and extend access to The Mathematics Teacher. http://www.jstor.org This content downloaded from 129.130.252.222 on Fri, 18 Jul 2014 07:27:26 AM All use subject to JSTOR Terms and Conditions

Upload: david-myers

Post on 30-Jan-2017

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Randomness on a micro

Randomness on a microAuthor(s): David MyersSource: The Mathematics Teacher, Vol. 76, No. 6 (September 1983), p. 398Published by: National Council of Teachers of MathematicsStable URL: http://www.jstor.org/stable/27963573 .

Accessed: 18/07/2014 07:27

Your use of the JSTOR archive indicates your acceptance of the Terms & Conditions of Use, available at .http://www.jstor.org/page/info/about/policies/terms.jsp

.JSTOR is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range ofcontent in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new formsof scholarship. For more information about JSTOR, please contact [email protected].

.

National Council of Teachers of Mathematics is collaborating with JSTOR to digitize, preserve and extendaccess to The Mathematics Teacher.

http://www.jstor.org

This content downloaded from 129.130.252.222 on Fri, 18 Jul 2014 07:27:26 AMAll use subject to JSTOR Terms and Conditions

Page 2: Randomness on a micro

mn, , y, and for angles of 135? and 150?.

I share Moore's interest in help ing students to develop facility in the use of formulas by using num bers that do not distract students from the essentials of the manipu lations. Calculators have a vital role to play in mathematics class

rooms, but their use is best cur tailed on some occasions. The teacher's judgment will play an im

portant role?as it always has.

Joseph Budnitsky Bayonne High School

Bayonne, NJ 07002

Randomness on a micro A limitation of Applesoft BASIC is illustrated in Betty Collis's programs in "Simulations and the Micro

computer : An Approach to Teaching Probability" (October 1982). The diffi

culty is that each time the Apple II is turned on, the same sequence of pseu dorandom numbers is generated by successive RND commands. There

fore, if a class of students were to run

the same program, turning off the

computer before each new use, they would all obtain identical results?

hardly a good illustration of random

processes. Unfortunately, Applesoft has no

RANDOMIZE instruction to remedy the situation. In many other machines, RANDOMIZE "seeds" the machine's

pseudorandom number-generating routine with an initial value that is

relatively unpredictable?such as the number of milliseconds after the cur rent second on the computer's internal clock. The Apple has such a mecha nism available; whenever the machine is waiting for input from the keyboard (the cursor is blinking), the machine is

counting from 0 to 255, then over

again from 0 to 255, and so on. This

happens quite rapidly, so that when the user strikes a key, thus interrupt ing the count, the number the com

puter stops at is essentially a random

integer between 0 and 255, inclusive. The location of the counter is memory location 78. The random number gen erated by the RND command is stored in locations 201 through 205

(the same initial value is always auto

matically stored in these locations when the machine is turned on). To

RANDOMIZE, then, it is sufficient to

include, in an early part of a program (to be executed exactly once), the com mand POKE(203), PEEK(78). This command will alter the "seed" to one of 256 possible initial values in essen

tially a random way. Should more

than 256 possible initial values be de

sired, one could do the POKE above, then have the program input anything at all from the user, which will alter

unpredictably the contents of location

78, then POKE 204, PEEK(78). The result of the two POKES will be 2562, or 65 536 possible sequences of pseu dorandom numbers.

David Myers The Winsor School

Boston, MA 02215

Betty Collis responds : I am aware

of the "nonrandom" nature of Ap plesoft BASIC'S random-number gen erator. I did not accommodate for it in my October article's programs for three practical reasons: (1) my ap proach was conceptualized around one classroom microcomputer and thus the likelihood of a class remem

bering initial random numbers from one day to the next is small ; (2) the nature of the programs is such that randomness is not essential, since

multiple runs in the same lesson (with out turning off the machine) will gen erate different pseudorandom se

quences after the nonrandom start; (3) I attempted to make the program list

ings as simple and accessible as possi ble for novice computer users and thus decided to avoid PEEK and POKE statements.

I appreciate your comments and the simplicity of the solution to the

problem. An interesting and fuller dis cussion can be found in Sparks, D., "RND is fatally flawed," Call? A.P.P.L.E. 6 (January 1983):29-32.

Corrections The first person to call our atten tion to the incorrect answer to the

problem printed for 20 October

(Mathematics Calendar in Septem ber 1983) was Gloria Smith, Bata via High School, New Richmond, OH 45157.

The information on the math ematics calendar for 21 November

regarding the longest single-span bridge can now be updated to the

bridge in Hull, England, whose

single span measures 2.2 km. Also, the solution to the 23 December

problem was 17 576 000 (Alan Hay ashi, Channel Islands High School, Oxnard, CA 93030).

The letter by Kenny Pruitt, "Fi bonacci formulae" (March 1983, p. 164), contained an error. The second line for the expression for

* +1

i= 1

should have read

1 - <* -2

-.*".)]

In the March 1983 Activity, "Microcomputer Unit: Graphing Straight Lines," the program should contain a line between 60 and 70 so that the graph will

appear on the screen. One possi bility is

65 HCOLOR = 3, which results in a white graph (Lee S. Musgrave, Northside Junior

High School, Norfolk, VA 23503). At the top of sheet 3, the first line should read as follows :

QUIT the program SLOPE and

type this new program line :

410 IF = 1 THEN 80

(Anne Primrose, Bryn Mawr

School, Baltimore, MD 21210).

?guideunes for ' evaluating

computerized . instructional i materials

for users and creators of educational software with sample evaluation instruments by an international organization dedicated to the improvement of mathematics instruction

981 ISBN 0-87353-176-0 #122 $3.00

i-1 NATIONAL COUNCIL OF E TEACHERS OF MATHEMATICS

lOEjI Association Drive Reston. Virginia 22091

See NCTM Materials Order Fon in New Publications"

398 Mathematics Teacher

This content downloaded from 129.130.252.222 on Fri, 18 Jul 2014 07:27:26 AMAll use subject to JSTOR Terms and Conditions