Announcement

Collapse
No announcement yet.

Discussion: CMWC with lag PRNG

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #41
    Re my last snippet if we use two loops we get some interesting results.

    For example:
    Code:
    For i = 0 To 255
      a(i) += p
      p += [COLOR="Red"]3[/COLOR] ' Any prime number except 2
    Next
    
    For i = 0 To 255
      a(i) += p
      p += [COLOR="Red"]5[/COLOR] ' Any prime number except 2
    Next
    With 3 followed by 5 we get 0,0,0,0,0,0,0,0,8,8,8,8,8,8,8,8, ..., 248,248,248,248,248,248,248,248

    With 3 followed by 9 we get 0,0,0,0,4,4,4,4, ..., 252,252,252,252

    With 3 followed by 7 we get 0,0,2,2, ..., 254,254

    as we do with 5 followed by 9 and 3 followed by 3.

    There is a theorem lurking about here.

    Gleason's theorem sounds good to me except it hasn't been formalized yet.

    Comment


    • #42
      I think even Gleason's conjecture would be way pushing it.

      Comment


      • #43
        Hi David,

        I get a random greater than one with your double-precision routine CMWCFD. Is it normal?
        Attached Files
        "The trouble with quotes on the Internet is that you can never know if they are genuine." - Abraham Lincoln.

        Comment


        • #44
          Hi Arthur

          Is it normal?
          No it is not - it is impossible. With a 12 bit right shift we get a sign bit of zero and all the 11 exponent bits as zero so we must have [0,1).

          The bit map shows -155697.8

          We cannot get that with 'Global RandomDouble As Double' but we could get that with 'Global RandomDouble As Single'.

          I have just generated 10 billion and they were all in [0,1); although we only need one to upset the apple cart.

          Comment


          • #45
            Hi David,

            You're right. My fault!

            Nice work!
            Last edited by Arthur Gomide; 9 Jul 2012, 09:01 AM.
            "The trouble with quotes on the Internet is that you can never know if they are genuine." - Abraham Lincoln.

            Comment

            Working...
            X