Top "Random" questions

This tag is for questions pertaining to random numbers and their generators, whether pseudo-random or truly random.

Generate a random double in a range

I have two doubles like the following double min = 100; double max = 101; and with a random generator, I need to create …

java random
Random String Generator Returning Same String

I've developed a random string generator but it's not behaving quite as I'm hoping. My goal is to be able …

c# random
Reasons for using the set.seed function

Many times I have seen the set.seed function in R, before starting the program. I know it's basically used …

r random
Creating random numbers with no duplicates

In this case, the MAX is only 5, so I could check the duplicates one by one, but how could I …

java random
Generating random integer from a range

I need a function which would generate a random integer in given range (including border values). I don't unreasonable quality/…

c++ random
How do I pick randomly from an array?

I want to know if there is a much cleaner way of doing this. Basically, I want to pick a …

ruby arrays random
How to access random item in list?

I have an ArrayList, and I need to be able to click a button and then randomly pick out a …

c# arrays string random
How can I generate a unique ID in Python?

I need to generate a unique ID based on a random value.

python random unique-id
Get random item from array

$items = Array(523,3452,334,31,...5346); Each item of this array is some number. How do I get random item from $items?

php random
Efficient method to generate UUID String in JAVA (UUID.randomUUID().toString() without the dashes)

I would like an efficient utility to generate unique sequences of bytes. UUID is a good candidate but UUID.randomUUID().…

java random uuid