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


Subject: RE: SDL-News: how to generate a random number in SDL?
From: Scott Shen (Scott.Shen#holleycomm.com)
Date: Tue Feb 18 2003 - 20:41:31 GMT


Hi Rick:

There are quite some random number generator algorithms available and
different applications (GSM/GPRS, CDMA, 802.11, etc) may want to choose
different ones for whatever reasons. However, I still believe in SDL there
should be a defined random number generator (e.g., improved ANY in Z.100)
and it will be quite useful for most of the applications, for most of the
time. Even if the random numbers generated by ANY may not have the exact
characteristics specified in cellular standards, it's still very useful for
higher level design and simulation.

FYI. I copy and paste the statements regarding random number from one of the
CDMA cellular standards, hope it helps:

2.6.7.2 Pseudorandom Number Generator
Where pseudorandom numbers are needed, a linear congruential generator shall
be used.
The mobile station shall implement the linear congruential generator defined
by:
  Z(n) = a Z(n-1) mod m
where a = 7 exp(5) = 16807 and m = (2 exp(31)) - 1 = 2147483647. Z(n) is the
output of the generator.

This generator has full period, ranging over all integers from 1 to m-1; the
values 0 and m are
never produced. Several suitable implementations can be found in Park,
Stephen K. and Miller, Keith
W., "Random Number Generators: Good Ones are Hard to Find," Communications
of the ACM, vol. 31,
no. 10, October 1988, pp. 1192-1201.

Of course the user of the Pseudorandom Number Generator has to init, or
'seed', Z(0).

Regards,
Scott

-----Original Message-----
From: Rick Reed TSE [mailto:rickreed#tseng.co.uk]
Sent: February 18, 2003 12:07 PM
To: Scott Shen; SDLnews
Subject: Re: SDL-news: how to generate a random number in SDL?

Scott Shen at Scott.Shen#holleycomm.com 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 - rickreed#tseng.co.uk
Tel:+44 15394 88462 Mob.:+44 7970 50 96 50

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

Hi Rick:

There are quite some random number generator algorithms available and different applications (GSM/GPRS, CDMA, 802.11, etc) may want to choose different ones for whatever reasons. However, I still believe in SDL there should be a defined random number generator (e.g., improved ANY in Z.100) and it will be quite useful for most of the applications, for most of the time. Even if the random numbers generated by ANY may not have the exact characteristics specified in cellular standards, it's still very useful for higher level design and simulation.


FYI. I copy and paste the statements regarding random number from one of the CDMA cellular standards, hope it helps:

2.6.7.2 Pseudorandom Number Generator
Where pseudorandom numbers are needed, a linear congruential generator shall be used.
The mobile station shall implement the linear congruential generator defined by:
  Z(n) = a Z(n-1) mod m
where a = 7 exp(5) = 16807 and m = (2 exp(31)) - 1 = 2147483647. Z(n) is the output of the generator.

This generator has full period, ranging over all integers from 1 to m-1; the values 0 and m are
never produced. Several suitable implementations can be found in Park, Stephen K. and Miller, Keith
W., "Random Number Generators: Good Ones are Hard to Find," Communications of the ACM, vol. 31,
no. 10, October 1988, pp. 1192-1201.


Of course the user of the Pseudorandom Number Generator has to init, or 'seed', Z(0).

Regards,
Scott


-----Original Message-----
From: Rick Reed TSE [mailto:rickreed#tseng.co.uk]
Sent: February 18, 2003 12:07 PM
To: Scott Shen; SDLnews
Subject: Re: SDL-News: how to generate a random number in SDL?


Scott Shen at Scott.Shen#holleycomm.com  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 - rickreed#tseng.co.uk
Tel:+44 15394 88462 Mob.:+44 7970 50 96 50

--End text from Scott Shen 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