Questions tagged [random]
This tag is for questions dealing with random numbers, pseudorandom numbers, and computer entropy.
124
questions
1
vote
1
answer
163
views
Random Numbers and Collisions [closed]
I read a question about using a 32bit random number as a "unique" identifier. One of the answers asserted that a "rough guide" to estimating collision likelihood is that there's a ...
3
votes
4
answers
2k
views
Is checking if a new GUID exists before insert a code smell?
Say I use GUIDs as keys. Considering the chance of a duplicate GUID being generated being what they are, is code like this considered a code smell?
Guid newID = GenerateGuid();
while (dictionary....
0
votes
2
answers
807
views
What are the reasons not to use random values in unittests? [duplicate]
I've read the questions regarding the use of random values in unit-tests and, well, I still don't quite understand what the argument against random values is.
I'm trying to understand because I've had ...
0
votes
0
answers
295
views
Improving performance of 'Weighted/prioritized left shuffle algorithm'
I wrote a prioritized/weighted left shuffle algorithm (the code is copied from my open source C# project Fluent Random Picker).
What does that mean? You've got some values and each of them has a ...
3
votes
3
answers
830
views
How does cuRAND use a GPU to accelerate random number generation? Don't those require a state?
My understanding is that every PRNG or QRNG requires a state to prevent the next item in its sequence from being too predictable; which is sensible, as they're all running on deterministic hardware.
...
-1
votes
2
answers
227
views
How random is enough to be random? [closed]
I download the atmospheric noise data from random.org in form:
10111011 01101111 01100001 00001001 00100110 10111011 01110110 11010110
00000111 01111110 10001110 01101010 11100000 11110111 10101011 ...
-4
votes
1
answer
80
views
How to write a sporadic metronome?
I already asked this question on stackoverflow -- I am posting it here as well, because I think many of you will have encountered an analogous problem. I would appreciate even a link as a reference, ...
1
vote
4
answers
1k
views
Is using multiple UUIDs decrease chance of collisions exponentially?
For example if you have a single UUID with a collision probability of x, if you concatenate 2 UUIDs, does the collision probability become x^2?
val0 = generate_uuid()
val1 = generate_uuid()
final_val ...
0
votes
3
answers
904
views
How to guarantee an ID is unique in a non-UUID set of values?
I would like to have IDs of different sizes from the alphabet 0-9. So I have 5-length IDs as in 10000 or 13531, etc.. I have 10, 15, 20, up to 39 digit strings (the size of a UUID). I would like to ...
2
votes
3
answers
824
views
Algorithm for random weighted boolean shuffles?
I don't exactly know how to phrase the thing I'm searching for in a succinct way, which also made it hard to research.
In my application I need a random list of booleans, say of length five. The ...
3
votes
3
answers
553
views
Is it really more difficult to debug randomized algorithms?
I am a theoretical computer scientist. I have heard the following:
Practitioners do not like randomized algorithms because they are notoriously difficult to debug. So deterministic algorithms are ...
0
votes
2
answers
116
views
Is it possible to transfer data with a really unique seed of a psudo random number generator
I have thinking about this idea for over 5 years and i don't have the complete technical knowledge to fully grasp the idea I'm having.
The premise of the idea is to have an extremely high base number ...
0
votes
3
answers
370
views
Getting random yet consistent data for testing
I have a big codebase yet to be covered with tests and rather limited access to the real data.
The code that needs to be covered is very data dependent. And the data is anything but shallow and ...
1
vote
2
answers
1k
views
How to shuffle a large data set without touching every row?
Let’s say I have two larges arrays of users with equals number of rows and I want to match them randomly and one to one(one from the first array,one from the second), I will first need to shuffle one ...
-1
votes
1
answer
331
views
Choosing random cards from a deck?
Is there a difference between the 2 below methods for choosing a random card from a deck of cards? Is one approach more accepted than the other?
Method 1: Generate a random number from 1-52 for the ...