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: Mon Feb 17 2003 - 23:35:11 GMT


Hi Rick:

Thanks again. I tried the ANY approach and the result seems largely OK. I
tested the value of 5000 ANY integer (0:100) and the mean value was like
49.7 and the values generated didn't seem to have obvious pattern.

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?

Regards,
Scott

-----Original Message-----
From: Rick Reed TSE [mailto:rickreed#tseng.co.uk]
Sent: February 17, 2003 1:42 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 18:37:

> Hi:
>
> Random number is used intensively in communication protocols. Is there a
> stadardized way to generate a random number is SDL? Thanks,

Yes - and No.

The ANY expression, for example in

SYNTYPE Byte = INTEGER CONSTANTS (0:256) ENDSYNTYPE Byte;
DCL rb Byte;
rb:=ANY(Byte); /* a Byte value */

returns an unspecified value within the range of values of the specified
sort, constrained to the values of the syntype if a syntype is given. In
other words ANY(Byte) gives an unspecified value in the range 0 to 256.

However, there is no specification of the distribution of the values. Hence,
the following sequences are all consistent with the SDL definition of ANY:

1, 2, 3, 4, 5, 6, ...

10, 10, 10, 10, ...

234, 3, 155, 162, 93, 155 ...

Part of the issue is how to specify the randomness of the numbers.

--
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:

Thanks again. I tried the ANY approach and the result seems largely OK. I tested the value of 5000 ANY integer (0:100) and the mean value was like 49.7 and the values generated didn't seem to have obvious pattern.

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?

Regards,
Scott

-----Original Message-----
From: Rick Reed TSE [mailto:rickreed#tseng.co.uk]
Sent: February 17, 2003 1:42 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 18:37:

> Hi:
>
> Random number is used intensively in communication protocols. Is there a
> stadardized way to generate a random number is SDL? Thanks,

Yes - and No.

The ANY expression, for example in

SYNTYPE Byte = INTEGER CONSTANTS (0:256) ENDSYNTYPE Byte;
DCL rb Byte;
rb:=ANY(Byte); /* a Byte value */

returns an unspecified value within the range of values of the specified
sort, constrained to the values of the syntype if a syntype is given. In
other words ANY(Byte) gives an unspecified value in the range 0 to 256.

However, there is no specification of the distribution of the values. Hence,
the following sequences are all consistent with the SDL definition of ANY:

1, 2, 3, 4, 5, 6, ...

10, 10, 10, 10,  ...

234, 3, 155, 162, 93, 155 ...

Part of the issue is how to specify the randomness of the numbers.

--
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