Free Republic
Browse · Search
News/Activism
Topics · Post Article

To: Alamo-Girl
Because the random function with a seed constant of 1 gives results from 0 to .99999999 the statement [X = INT (26 * RND (1)) + 1] can only generate a number from 1 to 26 from which the results are cherry picked in order (by alphabet position and in sequence) as you say!

Well, actually, that statement is producing a "random" pointer into the alphabet. It then uses that random number and compares it to the pointer in the alphabet for the letter it is seeking. For instance "T" is the 20th letter, "O" is the 15th letter, so on. If it matches it prints the letter and goes on to the next letter. If it does not match it loops and gets another number. The consequence is that each letter is preselected and only a "random" period is generated until the letter is printed.

721 posted on 10/10/2002 10:10:55 AM PDT by AndrewC
[ Post Reply | Private Reply | To 718 | View Replies ]


To: AndrewC
Exactly! We are making the same observation, just using different jargon.

The only variable on each run of the program is the number of attempts required to get the desired pointer (or index number) for the character in a sequential, predetermined, position.

And the odds are merely 1 in 26 for each attempt!

724 posted on 10/10/2002 10:23:03 AM PDT by Alamo-Girl
[ Post Reply | Private Reply | To 721 | View Replies ]

Free Republic
Browse · Search
News/Activism
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson