Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #95355 > unrolled thread

Fair, truly random random number generator

Started by"Mr. Man-wai Chang" <toylet.toylet@gmail.com>
First post2016-10-28 20:31 +0800
Last post2016-10-31 18:42 +0800
Articles 20 on this page of 68 — 21 participants

Back to article view | Back to comp.lang.c


Contents

  Fair, truly random random number generator "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-10-28 20:31 +0800
    Re: Fair, truly random random number generator "Osmium" <r124c4u102@comcast.net> - 2016-10-28 07:48 -0500
      Re: Fair, truly random random number generator "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-10-28 21:07 +0800
        Re: Fair, truly random random number generator Richard Heathfield <rjh@cpax.org.uk> - 2016-10-28 14:21 +0100
          Re: Fair, truly random random number generator Gareth Owen <gwowen@gmail.com> - 2016-10-28 16:22 +0100
            Re: Fair, truly random random number generator Richard Heathfield <rjh@cpax.org.uk> - 2016-10-28 16:30 +0100
              Re: Fair, truly random random number generator Gareth Owen <gwowen@gmail.com> - 2016-10-28 16:32 +0100
          Re: Fair, truly random random number generator "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-10-29 23:11 +0800
            Re: Fair, truly random random number generator Richard Heathfield <rjh@cpax.org.uk> - 2016-10-31 11:17 +0000
              Re: Fair, truly random random number generator "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-10-31 20:14 +0800
                Re: Fair, truly random random number generator Melzzzzz <Melzzzzz@zzzzz.com> - 2016-10-31 12:32 +0000
                  Re: Fair, truly random random number generator Richard Heathfield <rjh@cpax.org.uk> - 2016-10-31 12:48 +0000
                    Re: Fair, truly random random number generator "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-11-01 15:30 +0800
                Re: Fair, truly random random number generator Richard Heathfield <rjh@cpax.org.uk> - 2016-10-31 12:47 +0000
        Re: Fair, truly random random number generator "Osmium" <r124c4u102@comcast.net> - 2016-10-28 09:32 -0500
    Re: Fair, truly random random number generator "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-10-28 07:14 -0700
      Re: Fair, truly random random number generator "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-10-28 18:07 -0700
        Re: Fair, truly random random number generator "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-11-01 17:45 -0700
          Re: Fair, truly random random number generator "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-01 18:57 -0700
            Re: Fair, truly random random number generator David Brown <david.brown@hesbynett.no> - 2016-11-02 10:06 +0100
              Re: Fair, truly random random number generator "Osmium" <r124c4u102@comcast.net> - 2016-11-02 04:46 -0600
              Re: Fair, truly random random number generator "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-02 05:06 -0700
                Re: Fair, truly random random number generator David Brown <david.brown@hesbynett.no> - 2016-11-02 13:43 +0100
                  Re: Fair, truly random random number generator "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-02 06:02 -0700
                    Re: Fair, truly random random number generator David Brown <david.brown@hesbynett.no> - 2016-11-02 16:08 +0100
                      Re: Fair, truly random random number generator "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-02 08:21 -0700
                Re: Fair, truly random random number generator Mark Storkamp <mstorkamp@yahoo.com> - 2016-11-02 08:20 -0500
            Re: Fair, truly random random number generator "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-11-03 17:56 -0700
              Re: Fair, truly random random number generator Keith Thompson <kst-u@mib.org> - 2016-11-03 18:16 -0700
                Re: Fair, truly random random number generator "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-11-03 18:48 -0700
                Re: Fair, truly random random number generator supercat@casperkitty.com - 2016-11-04 09:17 -0700
                Re: Fair, truly random random number generator raltbos@xs4all.nl (Richard Bos) - 2016-11-04 17:59 +0000
                  Re: Fair, truly random random number generator Keith Thompson <kst-u@mib.org> - 2016-11-04 11:55 -0700
                    Re: Fair, truly random random number generator "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-11-04 12:43 -0700
                  Re: Fair, truly random random number generator "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-11-04 12:40 -0700
              Re: Fair, truly random random number generator "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-04 12:49 -0700
                Re: Fair, truly random random number generator "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-11-04 13:23 -0700
                  Re: Fair, truly random random number generator "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-04 13:32 -0700
                    Re: Fair, truly random random number generator ImperiusDamian <damianblack.wolf@gmail.com> - 2016-11-05 18:48 -0400
                      Re: Fair, truly random random number generator "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-05 16:03 -0700
                        Re: Fair, truly random random number generator "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-11-05 16:50 -0700
                        Re: Fair, truly random random number generator ImperiusDamian <damianblack.wolf@gmail.com> - 2016-11-05 19:52 -0400
                          Re: Fair, truly random random number generator "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-05 17:06 -0700
      Re: Fair, truly random random number generator "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-10-29 23:13 +0800
        Re: Fair, truly random random number generator Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2016-10-29 12:12 -0400
          Re: Fair, truly random random number generator "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-10-30 00:22 +0800
          Re: Fair, truly random random number generator Lew Pitcher <lew.pitcher@digitalfreehold.ca> - 2016-10-29 12:26 -0400
          Re: Fair, truly random random number generator supercat@casperkitty.com - 2016-10-29 09:44 -0700
            Re: Fair, truly random random number generator Tim Rentsch <txr@alumni.caltech.edu> - 2016-11-01 08:13 -0700
              Re: Fair, truly random random number generator supercat@casperkitty.com - 2016-11-01 08:31 -0700
                Re: Fair, truly random random number generator Tim Rentsch <txr@alumni.caltech.edu> - 2016-11-02 12:58 -0700
        Re: Fair, truly random random number generator "James R. Kuyper" <jameskuyper@verizon.net> - 2016-10-29 12:37 -0400
        Re: Fair, truly random random number generator Keith Thompson <kst-u@mib.org> - 2016-10-29 11:57 -0700
        Re: Fair, truly random random number generator David Brown <david.brown@hesbynett.no> - 2016-10-30 17:13 +0100
          Re: Fair, truly random random number generator "Osmium" <r124c4u102@comcast.net> - 2016-10-30 11:07 -0600
            Re: Fair, truly random random number generator supercat@casperkitty.com - 2016-10-30 12:20 -0700
        Re: Fair, truly random random number generator Richard Heathfield <rjh@cpax.org.uk> - 2016-10-31 11:18 +0000
        Re: Fair, truly random random number generator Ed Prochak <edprochak@gmail.com> - 2016-11-03 10:39 -0700
          Re: Fair, truly random random number generator "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-03 11:13 -0700
            [OT] gigawatts = gigaseconds correlation? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-11-04 02:36 +0800
              Re: [OT] gigawatts = gigaseconds correlation? "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-03 12:07 -0700
                Re: [OT] gigawatts = gigaseconds correlation? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-11-04 12:02 +0800
            Re: Fair, truly random random number generator gazelle@shell.xmission.com (Kenny McCormack) - 2016-11-03 19:56 +0000
            Re: Fair, truly random random number generator "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2016-11-03 16:21 -0700
    Re: Fair, truly random random number generator luser droog <luser.droog@gmail.com> - 2016-10-29 14:49 -0700
      Re: Fair, truly random random number generator jameskuyper@verizon.net - 2016-10-29 15:29 -0700
    Re: Fair, truly random random number generator Quadibloc <jsavard@ecn.ab.ca> - 2016-10-29 19:09 -0700
    Thank you all for the replies! "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2016-10-31 18:42 +0800

Page 1 of 4  [1] 2 3 4  Next page →


#95355 — Fair, truly random random number generator

From"Mr. Man-wai Chang" <toylet.toylet@gmail.com>
Date2016-10-28 20:31 +0800
SubjectFair, truly random random number generator
Message-ID<nuvgeh$2fm$1@dont-email.me>
Anyone got an existing and truly random random number generator function 
for me to copy? :)

-- 
   @~@   Remain silent! Drink, Blink, Stretch! Live long and prosper!!
  / v \  Simplicity is Beauty!
/( _ )\ May the Force and farces be with you!
   ^ ^   (x86_64 Ubuntu 9.10)  Linux 2.6.39.3
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa

[toc] | [next] | [standalone]


#95356

From"Osmium" <r124c4u102@comcast.net>
Date2016-10-28 07:48 -0500
Message-ID<e7gvprFlun1U1@mid.individual.net>
In reply to#95355
"Mr. Man-wai Chang"

> Anyone got an existing and truly random random number generator function 
> for me to copy? :)

I assume that the :) at the end indicates that your think the preceding 
sentence is humorous.  Do you really expect even one person in the world to 
chuckle or smile? 

[toc] | [prev] | [next] | [standalone]


#95357

From"Mr. Man-wai Chang" <toylet.toylet@gmail.com>
Date2016-10-28 21:07 +0800
Message-ID<nuvihi$9ea$2@dont-email.me>
In reply to#95356
On 28/10/2016 8:48 PM, Osmium wrote:
>
> I assume that the :) at the end indicates that your think the preceding
> sentence is humorous.  Do you really expect even one person in the world
> to chuckle or smile?

It's just because I wanna copy others' code.

Do you have a good random number generator to share? :)

-- 
   @~@   Remain silent! Drink, Blink, Stretch! Live long and prosper!!
  / v \  Simplicity is Beauty!
/( _ )\ May the Force and farces be with you!
   ^ ^   (x86_64 Ubuntu 9.10)  Linux 2.6.39.3
不借貸! 不詐騙! 不援交! 不打交! 不打劫! 不自殺! 請考慮綜援 (CSSA):
http://www.swd.gov.hk/tc/index/site_pubsvc/page_socsecu/sub_addressesa

[toc] | [prev] | [next] | [standalone]


#95358

FromRichard Heathfield <rjh@cpax.org.uk>
Date2016-10-28 14:21 +0100
Message-ID<nuvjcs$cuv$1@dont-email.me>
In reply to#95357
On 28/10/16 14:07, Mr. Man-wai Chang wrote:
> On 28/10/2016 8:48 PM, Osmium wrote:
>>
>> I assume that the :) at the end indicates that your think the preceding
>> sentence is humorous.  Do you really expect even one person in the world
>> to chuckle or smile?
>
> It's just because I wanna copy others' code.
>
> Do you have a good random number generator to share? :)

/dev/urandom is good enough for most stuff (but whether it's good enough 
for cryptography depends on how paranoid you are, and whether you're 
paranoid *enough*).

If you need a PRNG, the Twister was state of the art a while back, so 
it's probably good enough for most purposes even today.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#95363

FromGareth Owen <gwowen@gmail.com>
Date2016-10-28 16:22 +0100
Message-ID<87mvho8pmf.fsf@gmail.com>
In reply to#95358
Richard Heathfield <rjh@cpax.org.uk> writes:
 
Now Mr Heathfield, did I recently hear your opinions on motion pictures
coming through my podcast headphones?

[toc] | [prev] | [next] | [standalone]


#95364

FromRichard Heathfield <rjh@cpax.org.uk>
Date2016-10-28 16:30 +0100
Message-ID<nuvqt4$9v6$1@dont-email.me>
In reply to#95363
On 28/10/16 16:22, Gareth Owen wrote:
> Richard Heathfield <rjh@cpax.org.uk> writes:
>
> Now Mr Heathfield, did I recently hear your opinions on motion pictures
> coming through my podcast headphones?

Sorry, but I don't have the faintest idea of what you're talking about.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#95365

FromGareth Owen <gwowen@gmail.com>
Date2016-10-28 16:32 +0100
Message-ID<87ziloxzeu.fsf@gmail.com>
In reply to#95364
Richard Heathfield <rjh@cpax.org.uk> writes:

> On 28/10/16 16:22, Gareth Owen wrote:
>> Richard Heathfield <rjh@cpax.org.uk> writes:
>>
>> Now Mr Heathfield, did I recently hear your opinions on motion pictures
>> coming through my podcast headphones?
>
> Sorry, but I don't have the faintest idea of what you're talking about.

That's a shame. Must've been a different person with the same name.

[toc] | [prev] | [next] | [standalone]


#95379

From"Mr. Man-wai Chang" <toylet.toylet@gmail.com>
Date2016-10-29 23:11 +0800
Message-ID<nv2e70$99s$1@dont-email.me>
In reply to#95358
On 28/10/2016 9:21 PM, Richard Heathfield wrote:
>
> /dev/urandom is good enough for most stuff (but whether it's good enough
> for cryptography depends on how paranoid you are, and whether you're
> paranoid *enough*).

On Window$? :)

> If you need a PRNG, the Twister was state of the art a while back, so
> it's probably good enough for most purposes even today.

Free library?

[toc] | [prev] | [next] | [standalone]


#95427

FromRichard Heathfield <rjh@cpax.org.uk>
Date2016-10-31 11:17 +0000
Message-ID<nv797n$22a$1@dont-email.me>
In reply to#95379
On 29/10/16 16:11, Mr. Man-wai Chang wrote:
> On 28/10/2016 9:21 PM, Richard Heathfield wrote:
>>
>> /dev/urandom is good enough for most stuff (but whether it's good enough
>> for cryptography depends on how paranoid you are, and whether you're
>> paranoid *enough*).
>
> On Window$? :)
>
>> If you need a PRNG, the Twister was state of the art a while back, so
>> it's probably good enough for most purposes even today.
>
> Free library?

There's a C implementation of Twister on its Wikipedia page.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#95430

From"Mr. Man-wai Chang" <toylet.toylet@gmail.com>
Date2016-10-31 20:14 +0800
Message-ID<nv7cj9$dlp$1@dont-email.me>
In reply to#95427
On 31/10/2016 7:17 PM, Richard Heathfield wrote:
>
> There's a C implementation of Twister on its Wikipedia page.
>

I don't need a library. I want source codes to copy! :)

[toc] | [prev] | [next] | [standalone]


#95431

FromMelzzzzz <Melzzzzz@zzzzz.com>
Date2016-10-31 12:32 +0000
Message-ID<nv7dkh$o41$2@news.albasani.net>
In reply to#95430
On 2016-10-31, Mr. Man-wai Chang <toylet.toylet@gmail.com> wrote:
> On 31/10/2016 7:17 PM, Richard Heathfield wrote:
>>
>> There's a C implementation of Twister on its Wikipedia page.
>>
>
> I don't need a library. I want source codes to copy! :)

Hm, that sounds like source code ;)

-- 
press any key to continue or any other to quit

[toc] | [prev] | [next] | [standalone]


#95433

FromRichard Heathfield <rjh@cpax.org.uk>
Date2016-10-31 12:48 +0000
Message-ID<nv7ei2$k7s$2@dont-email.me>
In reply to#95431
On 31/10/16 12:32, Melzzzzz wrote:
> On 2016-10-31, Mr. Man-wai Chang <toylet.toylet@gmail.com> wrote:
>> On 31/10/2016 7:17 PM, Richard Heathfield wrote:
>>>
>>> There's a C implementation of Twister on its Wikipedia page.
>>>
>>
>> I don't need a library. I want source codes to copy! :)
>
> Hm, that sounds like source code ;)

It looks like source code, too. It even quacks like source code.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#95484

From"Mr. Man-wai Chang" <toylet.toylet@gmail.com>
Date2016-11-01 15:30 +0800
Message-ID<nv9g93$t69$1@dont-email.me>
In reply to#95433
On 31/10/2016 8:48 PM, Richard Heathfield wrote:
>>
>> Hm, that sounds like source code ;)
>
> It looks like source code, too. It even quacks like source code.

Good. thanks

[toc] | [prev] | [next] | [standalone]


#95432

FromRichard Heathfield <rjh@cpax.org.uk>
Date2016-10-31 12:47 +0000
Message-ID<nv7eh6$k7s$1@dont-email.me>
In reply to#95430
On 31/10/16 12:14, Mr. Man-wai Chang wrote:
> On 31/10/2016 7:17 PM, Richard Heathfield wrote:

(in reply to Man-wai Chang's request: "Free library?")

>>
>> There's a C implementation of Twister on its Wikipedia page.
>>
>
> I don't need a library. I want source codes to copy! :)


There's a C implementation of Twister on its Wikipedia page.

-- 
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

[toc] | [prev] | [next] | [standalone]


#95362

From"Osmium" <r124c4u102@comcast.net>
Date2016-10-28 09:32 -0500
Message-ID<e7h5s3Fndp7U1@mid.individual.net>
In reply to#95357
"Mr. Man-wai Chang" wrote:

> On 28/10/2016 8:48 PM, Osmium wrote:
>>
>> I assume that the :) at the end indicates that your think the preceding
>> sentence is humorous.  Do you really expect even one person in the world
>> to chuckle or smile?
>
> It's just because I wanna copy others' code.
>
> Do you have a good random number generator to share? :)

Yes, good but not truly random.  This is source code by Ben Pfaff who used 
to post here and has good bona fides.  Search google for <rc4 pfaff>.  It 
shows at the top of my hits.  You can cast around for a decent seed to start 
it.  Flip a coin if you are really paranoid.  RC4 is fast and 
understandable.

Most sentences in English end with a .  Not with a .:)

[toc] | [prev] | [next] | [standalone]


#95360

From"Rick C. Hodgin" <rick.c.hodgin@gmail.com>
Date2016-10-28 07:14 -0700
Message-ID<37481339-6cc2-4bef-b550-4c868b3159d2@googlegroups.com>
In reply to#95355
On Friday, October 28, 2016 at 8:31:47 AM UTC-4, Mr. Man-wai Chang wrote:
> Anyone got an existing and truly random random number generator function 
> for me to copy? :)

There are no such creations.  It's impossible in a software algorithm to
create a truly random sequence without having truly random input.

Several CPU manufacturers have introduced hardware which generates truly
random sequences based on internal circuits which monitor heat radiation
and the like.  VIA Technologies incorporated this into their CPUs back in
the early 2000s.  Those CPUs are pretty cheap and you could setup a true
random number server which responds to remote requests for data.

Others CPU manufacturers have done similarly.

If you really want a true random number generator locally, you can buy
add-on boards which provide that functionality through an API call:

    http://www.idquantique.com/random-number-generation/quantis-random-number-generator/

Best regards,
Rick C. Hodgin

[toc] | [prev] | [next] | [standalone]


#95374

From"Chris M. Thomasson" <invalid@invalid.invalid>
Date2016-10-28 18:07 -0700
Message-ID<nv0sno$279$1@dont-email.me>
In reply to#95360
On 10/28/2016 7:14 AM, Rick C. Hodgin wrote:
> On Friday, October 28, 2016 at 8:31:47 AM UTC-4, Mr. Man-wai Chang wrote:
>> Anyone got an existing and truly random random number generator function
>> for me to copy? :)
>
> There are no such creations.  It's impossible in a software algorithm to
> create a truly random sequence without having truly random input.

For fun, take a look at:

https://groups.google.com/d/topic/comp.lang.c++/7u_rLgQe86k/discussion
(read all please...)

Is a mouse move a random event? How about a key press?

I not saying this race infested thing I am messing around with is 
random, I am saying its hard for it to hit a set period.

[toc] | [prev] | [next] | [standalone]


#95559

From"Chris M. Thomasson" <invalid@invalid.invalid>
Date2016-11-01 17:45 -0700
Message-ID<nvbcu4$fjm$1@dont-email.me>
In reply to#95374
On 10/28/2016 6:07 PM, Chris M. Thomasson wrote:
> On 10/28/2016 7:14 AM, Rick C. Hodgin wrote:
>> On Friday, October 28, 2016 at 8:31:47 AM UTC-4, Mr. Man-wai Chang wrote:
>>> Anyone got an existing and truly random random number generator function
>>> for me to copy? :)
>>
>> There are no such creations.  It's impossible in a software algorithm to
>> create a truly random sequence without having truly random input.
>
> For fun, take a look at:
>
> https://groups.google.com/d/topic/comp.lang.c++/7u_rLgQe86k/discussion
> (read all please...)
>
> Is a mouse move a random event? How about a key press?
>
> I not saying this race infested thing I am messing around with is
> random, I am saying its hard for it to hit a set period.
>

Did you take a look at my code Rick?

[toc] | [prev] | [next] | [standalone]


#95560

From"Rick C. Hodgin" <rick.c.hodgin@gmail.com>
Date2016-11-01 18:57 -0700
Message-ID<01bf1ea3-23bf-4c46-8d1e-506ad6dbfa81@googlegroups.com>
In reply to#95559
On Tuesday, November 1, 2016 at 8:45:26 PM UTC-4, Chris M. Thomasson wrote:
> On 10/28/2016 6:07 PM, Chris M. Thomasson wrote:
> > On 10/28/2016 7:14 AM, Rick C. Hodgin wrote:
> >> On Friday, October 28, 2016 at 8:31:47 AM UTC-4, Mr. Man-wai Chang wrote:
> >>> Anyone got an existing and truly random random number generator function
> >>> for me to copy? :)
> >>
> >> There are no such creations.  It's impossible in a software algorithm to
> >> create a truly random sequence without having truly random input.
> >
> > For fun, take a look at:
> >
> > https://groups.google.com/d/topic/comp.lang.c++/7u_rLgQe86k/discussion
> > (read all please...)
> >
> > Is a mouse move a random event? How about a key press?
> >
> > I not saying this race infested thing I am messing around with is
> > random, I am saying its hard for it to hit a set period.
> >
> 
> Did you take a look at my code Rick?

No.  But to answer your question, any input that's not from an algorithm-
generated source can be considered random input.

Best regards,
Rick C. Hodgin

[toc] | [prev] | [next] | [standalone]


#95569

FromDavid Brown <david.brown@hesbynett.no>
Date2016-11-02 10:06 +0100
Message-ID<nvcaac$hni$1@dont-email.me>
In reply to#95560
On 02/11/16 02:57, Rick C. Hodgin wrote:
> On Tuesday, November 1, 2016 at 8:45:26 PM UTC-4, Chris M. Thomasson wrote:
>> On 10/28/2016 6:07 PM, Chris M. Thomasson wrote:
>>> On 10/28/2016 7:14 AM, Rick C. Hodgin wrote:
>>>> On Friday, October 28, 2016 at 8:31:47 AM UTC-4, Mr. Man-wai Chang wrote:
>>>>> Anyone got an existing and truly random random number generator function
>>>>> for me to copy? :)
>>>>
>>>> There are no such creations.  It's impossible in a software algorithm to
>>>> create a truly random sequence without having truly random input.
>>>
>>> For fun, take a look at:
>>>
>>> https://groups.google.com/d/topic/comp.lang.c++/7u_rLgQe86k/discussion
>>> (read all please...)
>>>
>>> Is a mouse move a random event? How about a key press?
>>>
>>> I not saying this race infested thing I am messing around with is
>>> random, I am saying its hard for it to hit a set period.
>>>
>>
>> Did you take a look at my code Rick?
> 
> No.  But to answer your question, any input that's not from an algorithm-
> generated source can be considered random input.
> 

The number of cups of coffee I drink a day does not come from an
algorithm, but it would be a very poor source of random input.

It is accurate to say that any sequence generated from a /deterministic/
algorithm will not be random - but the converse is not correct.
(Non-deterministic random algorithms are easy to devise - "roll a die,
and write down the number it shows" is an algorithm for picking a number
between 1 and 6.)

There are many pseudo-random number generator algorithms that give
excellent non-determinism and very flat frequency distributions for long
sequences.  Often they give much more useful sources of "randomness"
than more "true" random sources such as the movement of mice (living
mice or computer mice), because such external sources have complex
distributions that are hard to compensate.

So when you want really good random sequences, you use the least
significant bits of a "natural" source to seed and occasionally re-seed
your PRNG.  That's what Linux does with /dev/random, and it is also what
cpu manufacturers do when they have a "hardware random number generator".

[toc] | [prev] | [next] | [standalone]


Page 1 of 4  [1] 2 3 4  Next page →

Back to top | Article view | comp.lang.c


csiph-web