Re: SDL-News: how to generate a random number in SDL?

Subject: Re: SDL-News: how to generate a random number in SDL?
From: Rick Reed TSE (
Date: Tue Feb 18 2003 - 20:06:57 GMT

Become an SDL Forum Society member <>
The originator of this message is responsible for its content.
-----From Rick Reed TSE <> to sdlnews -----

Scott Shen at wrote on 17/02/2003 23:35:

> I am curious, SDL is very popular in telecom industry so why hasn't a "true"
> random number generator (with specified randomness) been officially supported?

Dear Scott,

This has been discussed in relation to the ANY expression.

There are two issues:

1. How can randomness be specified?

2. How can randomness be measured?

The two are related.

As far as I am aware so-called random number generators are of 2 kinds:

a) Those that use an algorithm with a seed number that generates a
pseudo-random sequence;

b) Those that use some non-deterministic input or physical property from
which the value is derived.

Obviously these can be combined.

Suppose we have a specification for randomness which requires each value in
a sequence to be chosen on a arbitrary basis. If there is only one element
in the sequence, there is no way of determining if this is random or not -
for example if ANY(Byte) is used to generate a "random" seed, but is only
ever used once - how can we determine this is random? Similarly if we
require a Poisson distribution of values centred around 10, with a variance
of 1, even if a generator seems to be statistically consistent with this for
the first 100 values, the next 10 values might all be 1 but then followed by
1000 values that correct this anomaly. Does this conform or not?

Despite this, I believe that the Z.100 definition of the ANY expression
could be improved. Personally I would suggest a statement something like:

Any two or more successive applications of an ANY expression should produce
values that have no obvious deterministic relationship to one another. and
If the number of applications is significantly more than the number of
values in the range, the value distribution should be flat in both frequency
and value within the range as far as can be reasonably determined.

If you have better ideas let me know.

Rick Reed -
Tel:+44 15394 88462 Mob.:+44 7970 50 96 50

--End text from Rick Reed TSE <> to sdlnews --- For extra SDL Forum Society benefits join at <>

This archive was generated by hypermail 2a23 : Thu May 09 2013 - 16:05:49 GMT