Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Truly random?

Reply
Thread Tools

Truly random?

 
 
Thad Smith
Guest
Posts: n/a
 
      12-07-2005
Mogens Heller Jensen wrote:

> "Alvin" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) oups.com...
>
>>Well, I'm developing a Tetris game in SDL, but when it comes to
>>deciding the next block, I'm stuck. It's random, but when I try
>>something like seeding the randomizer with the time,
>> ...

>
> The ideal solution (which, however, requires an internet connection) is to
> connect to www.random.org and download some random bytes...
>
> They are truly random, since they come from *sampling backgound noise in the
> atmosphere* (how cool is that?!).


Practically speaking, a reasonable PRNG would be more suitable. If you
needed secrecy (such as for high-stakes gambling), you wouldn't want to
connect to an external source with a non-secure connection, and even if
you secured the pipe, you would need reasonable assurances that the data
wasn't leaked (intentionally or otherwise) on the other end.

--
Thad

 
Reply With Quote
 
 
 
 
lawrence.jones@ugs.com
Guest
Posts: n/a
 
      12-07-2005
Jordan Abel <(E-Mail Removed)> wrote:
>
> And it is marginally on-topic, because the code of a PRNG with IIRC
> characteristics like those you describe appears in the text of the C
> standard.


No, the code in the standard generates a result whose low-order bits are
just as random as the high-order bits (its internal state has 16 more
bits than its return values).

-Larry Jones

Why is it you always rip your pants on the day everyone has to
demonstrate a math problem at the chalkboard? -- Calvin
 
Reply With Quote
 
 
 
 
Jordan Abel
Guest
Posts: n/a
 
      12-07-2005
On 2005-12-07, http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> wrote:
> Jordan Abel <(E-Mail Removed)> wrote:
>>
>> And it is marginally on-topic, because the code of a PRNG with IIRC
>> characteristics like those you describe appears in the text of the C
>> standard.

>
> No, the code in the standard generates a result whose low-order bits are
> just as random as the high-order bits (its internal state has 16 more
> bits than its return values).


IIRC even though the shifting makes the low-order bits sufficiently
random to be useful, the higher ones are even more random - i.e. the
"randomness" [specifically, the length of the repeat period] is a
continuously increasing function as you go from lower to higher bits.

I don't know much about this, this is just how it was explained to me.

> -Larry Jones
>
> Why is it you always rip your pants on the day everyone has to
> demonstrate a math problem at the chalkboard? -- Calvin

 
Reply With Quote
 
Tim Rentsch
Guest
Posts: n/a
 
      12-28-2005
(E-Mail Removed) writes:

> Jordan Abel <(E-Mail Removed)> wrote:
> >
> > And it is marginally on-topic, because the code of a PRNG with IIRC
> > characteristics like those you describe appears in the text of the C
> > standard.

>
> No, the code in the standard generates a result whose low-order bits are
> just as random as the high-order bits (its internal state has 16 more
> bits than its return values).


My tests[*] show the low-order bits to be significantly less
random than the high-order bits.
[*] Based on a version of the simplified poker test given in
Knuth volume 2.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A truly uninstantiable class? Ian Pilcher Java 19 10-16-2005 03:58 PM
Truly Sign out a user Chris Kettenbach ASP .Net 2 10-15-2005 03:13 AM
[OT] Truly an MCNGP? T-Bone Microsoft Certification 0 11-05-2004 02:43 PM
Prospect of MCSE truly frightening Julian Ford MCSE 14 04-05-2004 04:57 PM
Re: truly abstract (platform independent) pathnames Harald Hein Java 9 08-17-2003 01:01 PM



Advertisments