random

iPhone SDK Random Numbers

Hi I know I can get a random number for example from 0 to 700 using: arc4random() % 362 But how can I get a random number in between for example 200 to 300? Thanks. ...

C# quickSort with random pivot.

Hello! I am trying to modify the heapSort algorithm into version with random pivot , and I dont know what to do. Could any one help me ? This is the code: //QuickSort w C# using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace QuickSort { class Program { //Zamienia miejscami...

Seeding a pseudo-random number generator in C#

I need a seed for an instance of C#'s Random class, and I read that most people use the current time's ticks counter for this. But that is a 64-bit value and the seed needs to be a 32-bit value. Now I thought that the GetHashCode() method, which returns an int, should provide a reasonably distributed value for its object and this may be ...

Generating random numbers with know mean and variance

From a paper I'm reading right know: ... S(t+1, k) = S(t, k) + ... + C*∆ ... ∆ is a standard random variable with mean 0 and variance 1. ... How to generate this series of random values with this mean and variance? If someone has links to a C or C++ library I would be glad but I wouldn't mind implementing it myself if someone tells me...

Biased random in SQL?

I have some entries in my database, in my case Videos with a rating and popularity and other factors. Of all these factors I calculate a likelihood factor or more to say a boost factor. So I essentially have the fields ID and BOOST.The boost is calculated in a way that it turns out as an integer that represents the percentage of how oft...