# How do Pseudorandom number generators (Randoms) work?

Page 1 of 1

## 2 Replies - 398 Views - Last Post: 26 February 2012 - 11:10 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=268332&amp;s=050c1e07e80dd0d098087a64820b2c39&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

### #1 superkb10

• D.I.C Regular

Reputation: 25
• Posts: 272
• Joined: 27-November 11

# How do Pseudorandom number generators (Randoms) work?

Posted 26 February 2012 - 10:30 AM

Hello, I'm writing a program right now that requires some random number generation. I don't actually need any help with code or anything, I'm just a little curious as to how the number generators actually work since a computer can't really generate completely random numbers,so how do they actually work? Again, not needing any real help or anything, I'm just a little curious

Is This A Good Question/Topic? 0

## Replies To: How do Pseudorandom number generators (Randoms) work?

### #2 Ryano121

• D.I.C Lover

Reputation: 1051
• Posts: 2,229
• Joined: 30-January 11

## Re: How do Pseudorandom number generators (Randoms) work?

Posted 26 February 2012 - 10:59 AM

There's a bit of information on how the Random class works on the MSDN page

There are also many pages scattered around with lots more in depth information on pseudo random number generation if you can handle the math behind it.

### #3 RexGrammer

• Coding Dynamo

Reputation: 178
• Posts: 750
• Joined: 27-October 11

## Re: How do Pseudorandom number generators (Randoms) work?

Posted 26 February 2012 - 11:10 AM

If you're interested you can look at the actual code of the .NET Random class:

NOTE: It's somewhat long so I put it in a spoiler tag.

Spoiler