IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New So you can't have a (pseudo) random number generator?
New Those don't have side-effects
And given the same seed, a pseudo-random number generator will always return the same sequence of "random" numbers.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
New I was too tearse.
Some random number generators are more random than others. :-) I'm aware of the limitations of typical pseudo random number generators. I was too tearse in putting that in the Subject. (One of many true random number generators is [link|http://www.fourmilab.ch/hotbits/|HotBits].)

I wasn't questioning the "side-effects" aspect (I don't think), I was wondering whether it would be possible to hypotheically code a random number generator in a pure functional language given that, apparently, f(x0,t) = y0 for all x0 for a fuctional language, where a random number generator would give f(x0,t) = y(x0,t,gamma) (where gamma is some truly radom parameter). (If I didn't mess the notation up.) Presumably the code would talk to a radioactivity sensor or something similar that was truly random.

I would think that it must be possible, but wonder how it would be simply explained and whether it violates the premise of functional programming.

Thanks.

Cheers,
Scott.
New For pure functional programming, no
Because the program won't be provable for a given set of inputs.

Unless you count the external random number as one of the inputs, I suppose.
Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
Expand Edited by admin March 11, 2006, 02:02:24 PM EST
New You can if you thread the state through the functions...
...and hence the introduction of monads.
     Erlang? - (tuberculosis) - (22)
         Threads, Messages, and Pattern Matching.... - (ChrisR) - (21)
             Right so to me this sounds like the ultimate SOA language - (tuberculosis) - (20)
                 I dunno - (jake123) - (18)
                     Quick CS101 pointer? Diff between fucntional and imperative? -NT - (drewk) - (17)
                         Re: Quick CS101 pointer? Diff between fucntional and imperat - (admin) - (16)
                             Okay, remember hearing that before, and I understand ... - (drewk) - (6)
                                 Re: Okay, remember hearing that before, and I understand ... - (admin) - (5)
                                     So you can't have a (pseudo) random number generator? -NT - (Another Scott) - (4)
                                         Those don't have side-effects - (admin) - (3)
                                             I was too tearse. - (Another Scott) - (2)
                                                 For pure functional programming, no - (admin)
                                                 You can if you thread the state through the functions... - (ChrisR)
                             Is this worth going through? - (broomberg) - (3)
                                 Shorter read.... - (ChrisR) - (2)
                                     Already did that - (broomberg) - (1)
                                         I didn't find the gentle intro useful when I read it... - (ChrisR)
                             The three pillars - (ChrisR) - (4)
                                 You just lost me - (drewk) - (3)
                                     Google the terms - (ben_tilly)
                                     Quick explanation - (ChrisR) - (1)
                                         One other important concept worth mentioning is Currying - (ChrisR)
                 Erlang does look very intriguing, will hopefully influence - (tonytib)

The reaction times on these are really impressive.
67 ms