Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to generate random number sequences (in your head)

4,453 views
Skip to first unread message

Warren Shallcross

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to
Hello all.

Do you know of anyway of generating sequences of random numbers in your head
(without becoming predictable - ie no repeating patterns)? Especially
sequences of 3 possible numbers (0,1,2 perhaps) so that each term has a 1/3
probability of occurring.

No dice,coins,watches or other physical tools - although observing another
person's action may be acceptable and have potential.

One could do things like

Ri+1 = (ARi + B) mod N

using the like of A=317537 B=4378591 and N=3

but I'm looking for something that needs only moderate arithmetic computing
capability. ie in the head
And A & B smallish don't give very good results.

Warren


Main Night

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to
If pi is normal, then of course you just choose a random digit of that, and it
can be 10 possible values: 1,2,3,4,5,6,7,8,9,0. If it is 1,4,7, or 0, choose
random possibility #1. if 2,5, or 8, possibility #2. if 3,6, or 9, choose
possibility #3. if 0, pick again. but all this is assuming pi is normal...
Sam "Main Night" Alexander
Cast your vote for Freedom! ! !
(you must be 18 and a U.S. citizen to vote)

Ernest Lötter

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to
I'm not sure, but I think actual counts of the digits of pi up to 1 000 000
digits have shown that pi seems to be normal, although we have no proof of
it ... it is a very interesting question.

Is there any theorem which shows a relation between a number's normalcy to
base x and base y? I.e. : if a number is normal, using base 10, will it be
normal using any other base?

Ernest

Main Night <main...@aol.com> wrote in message
news:19990824061109...@ng-fx1.aol.com...

Warren Shallcross

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to
In article <19990824061109...@ng-fx1.aol.com>, main...@aol.com
says...

>
>If pi is normal, then of course you just choose a random digit of that, and it
>can be 10 possible values: 1,2,3,4,5,6,7,8,9,0. If it is 1,4,7, or 0, choose
>random possibility #1. if 2,5, or 8, possibility #2. if 3,6, or 9, choose
>possibility #3. if 0, pick again. but all this is assuming pi is normal...
>Sam "Main Night" Alexander
>Cast your vote for Freedom! ! !
>(you must be 18 and a U.S. citizen to vote)

Thanks for your thoughts.

But what I'm (essentially) trying to do, is find an "easy" way of finding a
sequence of "reasonably" random numbers when I don't have access to a computer,
books, or any other tools.

And remembering enough digits of PI is beyond my modest memory - and how do I
choose a random digit randomly!?

I suspect that the digits of pi would be close enough to draws from a uniform
distribution which is what's required.

Warren


David C. Ullrich

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to
Main Night wrote:

> If pi is normal, then of course you just choose a random digit of that,

That's silly. If you have the ability to choose a "random digit of pi"
you could just use the position of the digit you chose for your random
number - introducing pi adds nothing. Answers to "how can I choose a
random [whatever]" should probably not begin "choose a random..."

George Marsaglia

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to

Warren Shallcross wrote:

&&&&&&&&&&&&&&&&&&&&&&&&&&
Choose a 2-digit number, say 23, your "seed".

Form a new 2-digit number:
the 10's digit plus 6 times the units digit.

The example sequence is
23 --> 20 --> 02 --> 12 --> 13 --> 19 --> 55 --> 35 --> ...

and its period is the order of the multiplier, 6, in the group of
residues relatively prime to the modulus, 10. (59 in this case).

The "random digits" are the units digits of the 2-digit numbers,
ie, 3,0,2,2,3,9,5,... the sequence mod 10.
The arithmetic is simple enough to carry out in your head.

This is an example of my "multiply-with-carry"
random number generator, and it seems to provide quite satisfactory
sequences mod 2^32 or 2^64 , particularly well suited to
the way that modern CPU's do integer arithmetic.

You may choose various multipliers and moduli for examples of random
selection of the types you ask about.

A description of the multiply-with-carry method is in the postscript
file mwc1.ps, included in

The Marsaglia Random Number CDROM
with
The DIEHARD Battery of Tests of Randomness,

available at

http://stat.fsu.edu/pub/diehard/

George Marsaglia


John Bailey

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to
On 24 Aug 1999 08:52:35 GMT, fo...@uq.net.au (Warren Shallcross) wrote:

>Hello all.
>
>Do you know of anyway of generating sequences of random numbers in your head
>(without becoming predictable - ie no repeating patterns)? Especially
>sequences of 3 possible numbers (0,1,2 perhaps) so that each term has a 1/3
>probability of occurring.

In your head is a tough requirement. The only math I could do in my
head is to use a mnemonic as with pi: "see I have the rhyme
assisting, etc" counting the number of letters per word. Perhaps you
could do a word association sequence and count the letters as you go.
The tough part would be to match Benford's law.
See:
http://www.newscientist.com/ns/19990710/thepowerof.html
an article in New Scientist which discusses how the statistics of
usual numbers can be used to catch people who try to cook books.
Given that, another consideration might be to mix it up a bit, while
watching out for standard word length frequencies. Possibly,
something like count up for the first word, then count back down for
the second, etc.

John

Daniel Pilloff

unread,
Aug 24, 1999, 3:00:00 AM8/24/99
to
Hi, what does normal mean?

Thanks,

Dan Pilloff

Main Night <main...@aol.com> wrote in message
news:19990824061109...@ng-fx1.aol.com...

> If pi is normal, then of course you just choose a random digit of that,

David A Molnar

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
Warren Shallcross <fo...@uq.net.au> wrote:
> One could do things like
>
> Ri+1 = (ARi + B) mod N
>
> using the like of A=317537 B=4378591 and N=3

Just in passing, this is not particularly unpredictable. You would not
want to use such a linear congruential generator for anything where you're
worried about someone else predicting the output.


Gerry Myerson

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
In article <7pu24h$nem$1...@news.adamastor.ac.za>, "Ernest Lötter"
<1277...@narga.sun.ac.za> wrote:

> Is there any theorem which shows a relation between a number's normalcy to
> base x and base y? I.e. : if a number is normal, using base 10, will it be
> normal using any other base?

There are theorems, due to Wolfgang Schmidt, Andy Pollington, and others,
which say, roughly speaking, that given any two sets of bases, there are
numbers that are normal to all the bases in the first set and to none of
the bases in the other. The "roughly speaking" is to cover obvious
counterexamples when, e.g., one base is a power of another.

Gerry Myerson (ge...@mpce.mq.edu.au)

Gerry Myerson

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
In article <7ptmgj$jue$2...@bunyip.cc.uq.edu.au>, fo...@uq.net.au (Warren
Shallcross) wrote:

> Hello all.
>
> Do you know of anyway of generating sequences of random numbers in your head
> (without becoming predictable - ie no repeating patterns)? Especially
> sequences of 3 possible numbers (0,1,2 perhaps) so that each term has a 1/3
> probability of occurring.

How about using the base 3 analogue of Champernowne's number? Write the
numbers 1, 2, 3, ... in base 3, and concatenate:

121011122021221001011021101111121201211222002012022102112122202212221000...

For variety, instead of starting at 1, start at 100 (base 10, = 1201,
base 3):

120112021212121112121220122112222000200120022010201120122020....

Gerry Myerson (ge...@mpce.mq.edu.au)

Warren Shallcross

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
In article <37c2fbb0...@news.frontiernet.net>, jmb...@frontiernet.net
says...

>
>On 24 Aug 1999 08:52:35 GMT, fo...@uq.net.au (Warren Shallcross) wrote:
>
>>Hello all.
>>
>>Do you know of anyway of generating sequences of random numbers in your head
>>(without becoming predictable - ie no repeating patterns)? Especially
>>sequences of 3 possible numbers (0,1,2 perhaps) so that each term has a 1/3
>>probability of occurring.
>In your head is a tough requirement. The only math I could do in my
>head is to use a mnemonic as with pi: "see I have the rhyme
>assisting, etc" counting the number of letters per word. Perhaps you
>could do a word association sequence and count the letters as you go.
>The tough part would be to match Benford's law.
>See:
>http://www.newscientist.com/ns/19990710/thepowerof.html
>an article in New Scientist which discusses how the statistics of
>usual numbers can be used to catch people who try to cook books.
>Given that, another consideration might be to mix it up a bit, while
>watching out for standard word length frequencies. Possibly,
>something like count up for the first word, then count back down for
>the second, etc.
>
>John

John

Thanks for that.

I like the words idea; with a poem, perhaps, should be able to find a traversal
method for getting a reasonable sequence of numbers.

Regards
Warren


bri...@eisner.decus.org

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
In article <19990824061109...@ng-fx1.aol.com>, main...@aol.com (Main Night) writes:
> If pi is normal, then of course you just choose a random digit of that, and it
> can be 10 possible values: 1,2,3,4,5,6,7,8,9,0. If it is 1,4,7, or 0, choose
> random possibility #1. if 2,5, or 8, possibility #2. if 3,6, or 9, choose
> possibility #3. if 0, pick again. but all this is assuming pi is normal...

Of course, this scheme does not work. There is no uniform distribution
across a countably infinite set.

All we know is that if pi is normal then as the leading substring of pi
from which we randomly and uniformly select is extended without
bound, this scheme becomes arbitrarily good. But we have no guarantee
that the scheme is any good at all for any particular number of leading
digits of pi.

John Briggs vax...@alpha.tst.tracor.com

Jake Wildstrom

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
In article <7pv9hi$515$1...@moonbeam.aecom.yu.edu>,

Daniel Pilloff <pil...@aecom.yu.edu> wrote:
>Hi, what does normal mean?

A number (in particular an irrational number, since rational numbers never have
this property) is normal in base b iff in the base b expansion of the number,
every finite digit sequence appears at least one. As stated earlier in this
thread, the number 0.012345678901020304... is trivially normal base 10, but
not very useful. The normality of more commonly used irrational numbers is an
open question--normality is actually a very hard property to prove for numbers
not designed specifically for the purpose of being normal.

+--First Church of Briantology--Order of the Holy Quaternion--+
| A mathematician is a device for turning coffee into |
| theorems. -Paul Erdos |
+-------------------------------------------------------------+
| Jake Wildstrom |
+-------------------------------------------------------------+

r.e.s.

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
Jake Wildstrom <wil...@mit.edu> wrote ...

: Daniel Pilloff <pil...@aecom.yu.edu> wrote:
: >Hi, what does normal mean?
:
: A number (in particular an irrational number, since
: rational numbers never have this property) is normal
: in base b iff in the base b expansion of the number,
: every finite digit sequence appears at least [once].

Normality in base b requires much more than that;
specifically, each sequence of n digits (n=1,2,...)
must have the limiting relative frequency 1/b^n.
--
r.e.s.
rs...@mindspring.com


hol...@my-deja.com

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to

> The normality of more commonly used irrational numbers is an
> open question--normality is actually a very hard property to prove
> for numbers not designed specifically for the purpose of being normal.

Are there any results on density of normal irrationals? It's
interesting to find new (to me) dense sets of numbers that are
difficult to actually identify.

- James


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.

John Savard

unread,
Aug 25, 1999, 3:00:00 AM8/25/99
to
fo...@uq.net.au (Warren Shallcross) wrote, in part:

>Do you know of anyway of generating sequences of random numbers in your head
>(without becoming predictable - ie no repeating patterns)?

Quite difficult. I suppose you could try doing chain addition (which
isn't cryptosecure), which is sort of like a crude shift register:

start with a four digit number, add the first two digits mod 10, then
cross off the first digit and append the sum as the last digit.

But *no* method of generating a long sequence is likely to be carried
out perfectly in your head for that long...although that might just
help the randomness.

John Savard ( teneerf<- )
http://www.ecn.ab.ca/~jsavard/crypto.htm

Gerry Myerson

unread,
Aug 26, 1999, 3:00:00 AM8/26/99
to
In article <7q1g71$9s1$1...@nnrp1.deja.com>, hol...@my-deja.com wrote:

=> Are there any results on density of normal irrationals? It's
=> interesting to find new (to me) dense sets of numbers that are
=> difficult to actually identify.

Normal numbers (all of which are irrational, of course) are much more
than just dense; their complement has measure zero.

One might say it is easier to find a needle in this haystack
than it is to find a bit of the hay.

Gerry Myerson (ge...@mpce.mq.edu.au)

Mike Oliver

unread,
Aug 26, 1999, 3:00:00 AM8/26/99
to

Gerry Myerson wrote:
> Normal numbers (all of which are irrational, of course) are much more
> than just dense; their complement has measure zero.
>
> One might say it is easier to find a needle in this haystack
> than it is to find a bit of the hay.

Interestingly, though, in the sense of category it's the other
way around: Normal numbers are conull as you point out, but they're
also meager.

At first glance this is counterintuitive. You might say, "but then (in base 10 e.g.)
what value can the frequency of 7's take on a non-meager set, if not 1/10"?

The answer is that for almost all numbers (in the sense of category), the frequency
of 7's does not exist at all. On a comeager set of reals, for any value r in [0,1] and
any epsilon, there will be infinitely many places in the decimal expansion of the
chosen real such that the frequency of 7's up to that spot is within epsilon of r.

MILKY WAY

unread,
Aug 30, 1999, 3:00:00 AM8/30/99
to
It's impossible. It can't be done. There is no way you or anyone else
can generate anything that is random. Weather it is inside your head or
not. There is no such thing as "Random". The smarter you are the more
random things you understand. This is called intelligence.


Nicolas Bray

unread,
Aug 31, 1999, 3:00:00 AM8/31/99
to MILKY WAY


On Mon, 30 Aug 1999, MILKY WAY wrote:

> There is no such thing as "Random".

The result of any experiment in which quantum mechanical effects have a
significant role.


Mike Mccarty Sr

unread,
Sep 2, 1999, 3:00:00 AM9/2/99
to
In article <7ptmgj$jue$2...@bunyip.cc.uq.edu.au>,
Warren Shallcross <fo...@uq.net.au> wrote:
)Hello all.
)
)Do you know of anyway of generating sequences of random numbers in your head

Do you mean "random" or do you mean "pseudorandom"? For the first, there
is no known way.
--
----
char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
I don't speak for Alcatel <- They make me say that.

Damiano Mazza

unread,
Sep 2, 1999, 3:00:00 AM9/2/99
to

How can you prove that a number is normal? I thought about it for a
while, but I just wouldn't know where to start from.
Can anyone make an example?

Thank you,
damio :D
---------------------------------------------------------------------
This statement is true if it is at the beginning of a paragraph or
if it is preceded by a false statement; it is false if preceded by
itself. This statement is true if it is at the beginning of a
paragraph or if it is preceded by a false statement; it is false if
preceded by itself. This statement is true if it is at the beginning
of a paragraph or if it is preceded by a false statement; it is false
if preceded by itself.
---------------------------------------------------------------------


Gerry Myerson

unread,
Sep 3, 1999, 3:00:00 AM9/3/99
to
In article <37CE40B4...@tiscalinet.it>, Damiano Mazza
<da...@tiscalinet.it> wrote:

> How can you prove that a number is normal? I thought about it for a
> while, but I just wouldn't know where to start from.
> Can anyone make an example?

The first & simplest example is Champernowne's number, formed by
concatenating the numbers 1, 2, 3, etc, like so:

.123456789101112131415161718192021222324252627282930313233....

The proof of its normality is not super-hard but not trivial, either.
Why not take a crack at it?

0 new messages