random-numbers

How to generate random int number? (C#)

How to generate random int number? (C#) ...

How to get numeric random uniqueid in SQL Server

I am using SQL Server 2005, please tell me how can I get 6 digits (unique numeric which should be random) value for every row in table. I have a field in table in which I need 6 digit numeric value (random and unique). Please help me to do this. ...

Generating multiple random numbers

I want to generate 25 unique random numbers and list them in a console. The numbers should be atleast 10 characters long. Any easy way to do that? ...

Generate n-dimensional random numbers in Python

I'm trying to generate random numbers from a gaussian distribution. Python has the very useful random.gauss() method, but this is only a one-dimensional random variable. How could I programmatically generate random numbers from this distribution in n-dimensions? For example, in two dimensions, the return value of this method is essentia...

How to generate a random but unique number and display that number within the source of my image tag

Hello guys, I have done some searching but really haven't found what I'm looking for. What I would like to do is generate a random BUT unique 5 digit number and push whatever number into an img tag on my page. For example when people come to my page this number would generate and get pushed into this image tag: <img src="http://www.sa...

qrand is not generating a random number

Hi there I have a QT app, running 2 more threads. Inside the threads I use the qrand function to generate a random number. The following is the code used to get the number, where m_fluctuations max is a double. int fluctuate = qrand() % (int)(m_FluctuationMax * 100); I tried adding the following code in the main thread, and also in...

How to generate random +ve -ve decimal with php?

how can I regenerate random decimal from -0.0010 to 0.0010 with php rand()? or any other? ...

Generate different random -ve +ve number with php rand()?

Dear all, I have asked a question about random generating -ve +ve decimal value here: http://stackoverflow.com/questions/3206563/how-to-generate-random-ve-ve-decimal-with-php But now i have another more challenging problem. May I know how can I generate random integer with -ve +value with a different set? like from -552 to 2200 as an e...

What mechanisms could be used to easily generate a high entropy password on a smartphone without having to resort to alphanumeric input?

I'm working on a version of Password Safe for android. Password Safe uses a passphrase to encrypt your passwords, but typing out long passphrases on a smartphone can be tedious, especially if they're masked. I'd like to investigate using alternatives to a passphrase, such as arrays of simple images. Are there any good examples of su...

What shuffling algorithms exist besides Fisher-Yates and finding the "next permutation?"

Specifically in the domain of one-dimensional sets of items of the same type, such as a vector of integers. Say, for example, you had a vector of size 32,768 containing the sorted integers 0 through 32,767. What I mean by "next permutation" is performing the next permutation in a lexical ordering system. Wikipedia lists two (http://en...

random complex number

i need algorithm for generate random complex number please help i know how generate random number but random complex number confuse me ...

Deciding test statistic and distribution for a random number test

Hi, How do u decide on a test statistic while developing a test for random number testing and its likely distribution. How do u calculate and decide on the formula for calculating a p value for the test statistics distribution. TIA ...

How to get really random number?

Possible Duplicates: Understanding randomness Fastest implementation of a true random number generator in C# Hello. Function: Random rand = new Random(); rand.Next() It gives pseudo random numbers based on time in seconds. How to get really random numbers? I mean totally random not based on system time and some algorithm....

True random number generation

How is exactly that we talk about "true random" numbers when we are actually measuring something. I mean, isn't measuring almost the opposite of randomness. Som articles says that, for example, throwing a dice is "true random". Of course it isn't Pseudo-random, but is it even random?? If you could have a machine that throw dices from de...

Selecting Randomly Lowest Weighted

There are plenty of SO questions on weighted random, but all of them rely on the the bias going to the highest number. I want to bias towards the lowest. My algorithm at the moment, is the randomly weighted with a bias towards the higher values. double weights[2] = {1,2}; double sum = 0; for (int i=0;i<2;i++) { sum += weights[i]; } d...

How to generate truly random numbers (NOT pseudo) in Linux

Hello, What is the (best) way to create a secure random numbers in Linux (C/ C++ code), more random than the general rand() results, and not pseudo as OpenSSL BN_rand? In Windows I found CryptGenRandom() as a good option. Is there any equivalent in Linux? Thank you in advance. ...