home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 243,236 of 243,242   
   Paul to David Brown   
   Re: srand(0)   
   23 Feb 26 08:32:38   
   
   XPost: sci.math.num-analysis   
   From: nospam@needed.invalid   
      
   On Fri, 2/20/2026 3:16 AM, David Brown wrote:   
   > On 19/02/2026 23:39, Keith Thompson wrote:   
   >> David Brown  writes:   
   >> [...]   
   >>> As a deterministic function, a PRNG will obviously follow the pattern   
   >>> of its generating function.  But the aim is to have no /discernible/   
   >>> pattern.  The sequence 3, 4, 2, 1, 1, 7, 0, 6, 7 has no pattern that   
   >>> could be identified without knowledge of where they came from - and   
   >>> thus no way to predict the next number, 9, in the sequence.  But there   
   >>> is a pattern there - it's the 90th - 100th digits of the decimal   
   >>> expansion of pi.   
   >> [...]   
   >>   
   >> A Google search for 342117067 gives numerous hits referring to the   
   >> digits of pi.   
   >>   
   >   
   > That is using knowledge of where the sequence comes from - something else's   
   knowledge rather than your own, but it's the same principle.   
   >   
      
   "In the following sequence, what is the next digit 7,7,7,7,7,7,7,7,7 ? "    :-)   
      
   PI=3.   
      
   1415926535 8979323846 2643383279 5028841971 6939937510   
   ...   
   7777777772 4846769425 9310468643 5260899021 0266057232   # Line 517834   
      
   I suspect seeing that, that's not good.   
      
   Using pgmp-chudnovsky.c , and dumping pi as a binary float to a file,   
   I get this:   
      
       (text version of PI)  100,000,022 bytes   
       PI-Binary.bin          41,524,121 bytes   exponent and limbs   
       PI-Binary.bin.7Z       41,526,823 bytes   7Z Ultra compression, running on   
   1 core   
      
   The entropy property looks pretty good, but I doubt I would   
   be using that for my supply of random numbers :-)   
      
   https://gmplib.org/list-archives/gmp-discuss/2008-November/003444.html   
   https://stackoverflow.com/questions/3318979/how-to-serialize-the-gmp-mpf-type   
           https://gmplib.org/list-archives/gmp-discuss/2007-November/002981.html   
      
   gcc -DNO_FACTOR -fopenmp -Wall -O2 -o pgmp-chudnovsky pgmp-chudnovsky.c -lgmp   
   -lm   
      
      Paul   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca