Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Algorithms
  4. pseudorandom number generator algorithm

pseudorandom number generator algorithm

Scheduled Pinned Locked Moved Algorithms
algorithmsquestionlounge
17 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    niconicx
    wrote on last edited by
    #1

    can anyone tell me the algorithm for the pseudo random number generator? and how it works, i tried searching the net but to no avail.. thanks in advance, nico

    R T CPalliniC 3 Replies Last reply
    0
    • N niconicx

      can anyone tell me the algorithm for the pseudo random number generator? and how it works, i tried searching the net but to no avail.. thanks in advance, nico

      R Offline
      R Offline
      Robert C Cartaino
      wrote on last edited by
      #2

      niconicx wrote:

      i tried searching the net but to no avail

      Try this search: Random Number Generator Source[^]

      1 Reply Last reply
      0
      • N niconicx

        can anyone tell me the algorithm for the pseudo random number generator? and how it works, i tried searching the net but to no avail.. thanks in advance, nico

        T Offline
        T Offline
        Tim Craig
        wrote on last edited by
        #3

        niconicx wrote:

        i tried searching the net but to no avail..

        Or this[^] one. :doh:

        If you don't have the data, you're just another asshole with an opinion.

        1 Reply Last reply
        0
        • N niconicx

          can anyone tell me the algorithm for the pseudo random number generator? and how it works, i tried searching the net but to no avail.. thanks in advance, nico

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          See also here [^]. :-D

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          In testa che avete, signor di Ceprano?

          D N 2 Replies Last reply
          0
          • CPalliniC CPallini

            See also here [^]. :-D

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            D Offline
            D Offline
            David Crow
            wrote on last edited by
            #5

            Hey, I don't think that six you rolled is completly random. Since there are more pips on that face than the opposing face (one), it likely be up more often than not.

            "Love people and use things, not love things and use people." - Unknown

            "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

            CPalliniC R 2 Replies Last reply
            0
            • D David Crow

              Hey, I don't think that six you rolled is completly random. Since there are more pips on that face than the opposing face (one), it likely be up more often than not.

              "Love people and use things, not love things and use people." - Unknown

              "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

              CPalliniC Offline
              CPalliniC Offline
              CPallini
              wrote on last edited by
              #6

              Well I'm working on the anti-gravity vacuum glass box... :rolleyes:

              If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
              This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
              [My articles]

              In testa che avete, signor di Ceprano?

              1 Reply Last reply
              0
              • CPalliniC CPallini

                See also here [^]. :-D

                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                [My articles]

                N Offline
                N Offline
                niconicx
                wrote on last edited by
                #7

                CPallini wrote:

                See also here [^].

                im sorry for being somewhat dumb.. but can you explain the picture? thanks.. regards :)

                CPalliniC 1 Reply Last reply
                0
                • N niconicx

                  CPallini wrote:

                  See also here [^].

                  im sorry for being somewhat dumb.. but can you explain the picture? thanks.. regards :)

                  CPalliniC Offline
                  CPalliniC Offline
                  CPallini
                  wrote on last edited by
                  #8

                  Well it is a (pseudo: see David Crow's post...) random number generator device. :-D

                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                  [My articles]

                  In testa che avete, signor di Ceprano?

                  L 1 Reply Last reply
                  0
                  • CPalliniC CPallini

                    Well it is a (pseudo: see David Crow's post...) random number generator device. :-D

                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                    [My articles]

                    L Offline
                    L Offline
                    Lim Yuxuan
                    wrote on last edited by
                    #9

                    LOL. It is a pratical random generator. I used to write numbers on my square eraser and toss them to decide my answer for Multiple Choice Questions during tests that I didnt study.

                    CPalliniC 1 Reply Last reply
                    0
                    • L Lim Yuxuan

                      LOL. It is a pratical random generator. I used to write numbers on my square eraser and toss them to decide my answer for Multiple Choice Questions during tests that I didnt study.

                      CPalliniC Offline
                      CPalliniC Offline
                      CPallini
                      wrote on last edited by
                      #10

                      I obtained better results even for tests I did study. :-D

                      If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                      This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                      [My articles]

                      modified on Tuesday, September 16, 2008 11:42 AM

                      In testa che avete, signor di Ceprano?

                      N 1 Reply Last reply
                      0
                      • D David Crow

                        Hey, I don't think that six you rolled is completly random. Since there are more pips on that face than the opposing face (one), it likely be up more often than not.

                        "Love people and use things, not love things and use people." - Unknown

                        "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

                        R Offline
                        R Offline
                        Roger Wright
                        wrote on last edited by
                        #11

                        DavidCrow wrote:

                        there are more pips on that face than the opposing face (one), it likely be up more often than not.

                        Not really; they're only one-sixth as deep as the one on the opposite side.

                        "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                        CPalliniC D 2 Replies Last reply
                        0
                        • R Roger Wright

                          DavidCrow wrote:

                          there are more pips on that face than the opposing face (one), it likely be up more often than not.

                          Not really; they're only one-sixth as deep as the one on the opposite side.

                          "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                          CPalliniC Offline
                          CPalliniC Offline
                          CPallini
                          wrote on last edited by
                          #12

                          I know, but the mass distribution is different. ;P

                          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                          [My articles]

                          In testa che avete, signor di Ceprano?

                          1 Reply Last reply
                          0
                          • R Roger Wright

                            DavidCrow wrote:

                            there are more pips on that face than the opposing face (one), it likely be up more often than not.

                            Not really; they're only one-sixth as deep as the one on the opposite side.

                            "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                            D Offline
                            D Offline
                            David Crow
                            wrote on last edited by
                            #13

                            Roger Wright wrote:

                            Not really;

                            How so?

                            Roger Wright wrote:

                            ...they're only one-sixth as deep...

                            All pips are drilled to the same depth on a die.

                            "Love people and use things, not love things and use people." - Unknown

                            "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

                            R 1 Reply Last reply
                            0
                            • D David Crow

                              Roger Wright wrote:

                              Not really;

                              How so?

                              Roger Wright wrote:

                              ...they're only one-sixth as deep...

                              All pips are drilled to the same depth on a die.

                              "Love people and use things, not love things and use people." - Unknown

                              "The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch

                              R Offline
                              R Offline
                              Roger Wright
                              wrote on last edited by
                              #14

                              Okay, so I was guessing... But seriously, it's only one part of the equation. On the pair of sides showing 6 and 1 pip, one can consider that a shift in the center of mass occurs equal to some distance proportional to the ratio of the mass of one pip to the entire die in the direction of the face with 1 pip. Call that distance (6-1)l = 5l, and its direction i .On an adjacent face, the 5 counters the 3 for a distance of (5-3)l = 2l in the direction j. Normal to the plane formed thus is the pair 4 and 3, at a distance l in the k direction. The total distance by which the centroid shifts is then sqrt(25+4+1)*l = 5.477*l. Its direction is left as an exercise for the student, but it is decidedly not toward the face showing a 1. Remember, too, that we can't just rely on the measure of missing plastic in the pips, but must add back the mass of the paint used to mark each, and that might have a specific gravity much higher or lower than the base material. For practical purposes, the amount shift in the center of mass is negligible compared to the random variations in surface texture of the felt on the table, and the influence of random air currents from breathing, talking, air conditioning, passers by, and the occasinal fart. :-D The outcome is close enough to random for any engineering use, though a mathematician might argue the point. ;P

                              "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                              CPalliniC 1 Reply Last reply
                              0
                              • R Roger Wright

                                Okay, so I was guessing... But seriously, it's only one part of the equation. On the pair of sides showing 6 and 1 pip, one can consider that a shift in the center of mass occurs equal to some distance proportional to the ratio of the mass of one pip to the entire die in the direction of the face with 1 pip. Call that distance (6-1)l = 5l, and its direction i .On an adjacent face, the 5 counters the 3 for a distance of (5-3)l = 2l in the direction j. Normal to the plane formed thus is the pair 4 and 3, at a distance l in the k direction. The total distance by which the centroid shifts is then sqrt(25+4+1)*l = 5.477*l. Its direction is left as an exercise for the student, but it is decidedly not toward the face showing a 1. Remember, too, that we can't just rely on the measure of missing plastic in the pips, but must add back the mass of the paint used to mark each, and that might have a specific gravity much higher or lower than the base material. For practical purposes, the amount shift in the center of mass is negligible compared to the random variations in surface texture of the felt on the table, and the influence of random air currents from breathing, talking, air conditioning, passers by, and the occasinal fart. :-D The outcome is close enough to random for any engineering use, though a mathematician might argue the point. ;P

                                "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                                CPalliniC Offline
                                CPalliniC Offline
                                CPallini
                                wrote on last edited by
                                #15

                                Roger Wright wrote:

                                For practical purposes, the amount shift in the center of mass is negligible compared to the random variations in surface texture of the felt on the table, and the influence of random air currents from breathing, talking, air conditioning, passers by, and the occasinal fart.

                                Hey, you're definitely cheating: my (pseudo ;P ) random device rolls in a vacuum box! :-D

                                If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                [My articles]

                                In testa che avete, signor di Ceprano?

                                R 1 Reply Last reply
                                0
                                • CPalliniC CPallini

                                  Roger Wright wrote:

                                  For practical purposes, the amount shift in the center of mass is negligible compared to the random variations in surface texture of the felt on the table, and the influence of random air currents from breathing, talking, air conditioning, passers by, and the occasinal fart.

                                  Hey, you're definitely cheating: my (pseudo ;P ) random device rolls in a vacuum box! :-D

                                  If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                  This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                  [My articles]

                                  R Offline
                                  R Offline
                                  Roger Wright
                                  wrote on last edited by
                                  #16

                                  Well then, I guess the only way to resolve the matter is for you to build your machine, then run it through 6^(6^6) iterations and see if the Universe ends. :-D

                                  "A Journey of a Thousand Rest Stops Begins with a Single Movement"

                                  1 Reply Last reply
                                  0
                                  • CPalliniC CPallini

                                    I obtained better results even for tests I did study. :-D

                                    If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
                                    This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
                                    [My articles]

                                    modified on Tuesday, September 16, 2008 11:42 AM

                                    N Offline
                                    N Offline
                                    niconicx
                                    wrote on last edited by
                                    #17

                                    maybe ill try it

                                    1 Reply Last reply
                                    0
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                    • Login

                                    • Don't have an account? Register

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • World
                                    • Users
                                    • Groups