Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

uncertainties, PROGRAMMING



SEE MY P.S. COMMENT AT THE END ! THE REST IS JUST AN ILLUSTRATION.
*******************************************************************


Date: Thu, 05 Mar 1998 "James W. Wheeler" <jwheeler@eagle.lhup.edu> wrote:

Spreadsheets allow a lot of "what if" scenarios too! Just copy the
spreadsheet and vary one measured value at a time!

A little traditional program or a spreadsheet? It depends on what is
desired. Look at the originally suggested problem:

... I want it to carry through error propagation calculations. Simple
example: If length = 3.0 +/- 0.2 m and width = 5.0 +/- 0.2 m then
area = 15 +/- 1 m^2

Suppose that for some reason the distributions of errors in L and W
are uniform, as indicated, and that I want to demonstrate the expected
"truncated-bell-shaped" distribution of A. I simulate 500,000 pairs of
L and W, calculate A, and produce the following histogram of the A
distribution. The listing of my True Basic program (19 lines) is shown
at the end. The execution time (on my 180 MHz Mac) was 50 seconds. What
would be involved in trying to get such an outcome with a spreadsheet?

bin 1 freq= 0 A= 13 to 13.2
bin 2 freq= 0 A= 13.2 to 13.4
bin 3 freq= 2946 A= 13.4 to 13.6 A=area, never below 13.44
bin 4 freq= 11818 A= 13.6 to 13.8
bin 5 freq= 20827 A= 13.8 to 14
bin 6 freq= 30062 A= 14 to 14.2
bin 7 freq= 38694 A= 14.2 to 14.4
bin 8 freq= 47444 A= 14.4 to 14.6
bin 9 freq= 50130 A= 14.6 to 14.8
bin 10 freq= 50269 A= 14.8 to 15
bin 11 freq= 49817 A= 15 to 15.2
bin 12 freq= 49634 A= 15.2 to 15.4
bin 13 freq= 44230 A= 15.4 to 15.6
bin 14 freq= 36420 A= 15.6 to 15.8
bin 15 freq= 28679 A= 15.8 to 16
bin 16 freq= 20762 A= 16 to 16.2
bin 17 freq= 12902 A= 16.2 to 16.4
bin 18 freq= 5208 A= 16.4 to 16.6
bin 19 freq= 158 A= 16.6 to 16.8 never above 16.64
bin 20 freq= 0 A= 16.8 to 17

.................................................................
READ L0,DL,W0,DW,N ! Length, width, number of trials
DATA 3, 0.2, 5, 0.2, 500000
DIM AREA(20) ! histogram of calculated areas
let AMIN=L0*W0-2 ! less than lowest possible area
let AMAX=AMIN+4 ! more than highest possible area
let SPREAD=AMAX-AMIN ! good enough for an illustration
let STEP=SPREAD/20 ! 20 equal bins between 13 and 17
RANDOMIZE
FOR i=1 to N
let L=L0-DL+2*RND*DL ! one random L
let W=W0-DW+2*RND*DL ! one random W
let A=L*W ! area for this trial
let k=1+INT((A-AMIN)/STEP) ! bin number for this trial
let AREA(k)=AREA(k)+1 ! new occurence in that bin
Next i
FOR i=1 TO 20
PRINT "bin ";i;" freq=";AREA(i);" A=";AMIN+(i-1)*STEP;" to ";AMIN+i*STEP
NEXT i
END

I would ask students to create little programs "to feel" the results.
Programming promotes quantitative thinking.
Ludwik Kowalski
P.S.

WOULD SOMEBODY BE WILLING TO SECOND THE FOLLOWING PROPOSAL? PERHAPS
IT CAN BE SENT TO LEADERS WHO SHAPE OUR EDUCATIONAL SYSTEM.

True Basic programming skill should be promoted as "a common
denominator" at all levels of learning. Mathematical programming
should become as natural to students as using a pencil. One
programming language for all (as a common starting point for some,
and as the only language for others) would be highly benficial.
Arguments supporting the "highly beneficial" nature of programming
can easilly be found and inserted. Unlike so-called "object-oriented"
languages, such as C++ and Java, True Basic is very close, in its
form, to ways in which problems have been traditionally discussed
by scientists and mathematicians. Reading a listing of a program
(by a person who knows the language) is very similar to reading of
a set of mathematical expressions. The logical structure of a
spreadsheet is not as transparent as that of symbolically written
program.

Programming is a written verbalization of thinking. Using a program
is a source of feedback and reinforcements. True Basic is an ideal
tool for doing this; it is very powerful, very simple and very
inexpensive. A student version of it, plus a manual, cost only $20.
True Basic, developed by great teachers, is already available for
many platforms. If it was up to me I would use the "ability to
program in T.B." as a test for graduating from a high school.

FEEL FREE TO REEDIT THIS PROPOSAL AND TO TURN IT INTO A PETITION.