Questions tagged as 'random'

1
answer

You are not generating the 1000 random numbers required

I'm developing a program in C that randomly generates a thousand numbers and that in the end appears the largest and smallest of them. For this, I'm using rand() . But I have a problem. When I run only less than 300 numbers are generate...
asked by 05.11.2014 / 22:06
1
answer

How to get a random number in Kotlin?

How can I get a random number between two values? As ruby does with rand(0..n)     
asked by 26.01.2018 / 19:48
4
answers

How to generate random numbers for Draw? [closed]

I need to generate numbers for a promotion, these numbers should range from 0 to 99999. How can I distribute these numbers randomly and equitably, without repeating numbers already distributed?     
asked by 24.10.2016 / 23:44
4
answers

Generate random numbers that do not repeat

How can I generate a large string of random numbers that do not repeat? I have to generate 10 000 thousand numbers from 1 to 1 million and save to a file and they can not be repeated. Although the sequence is large, it has some repeating numb...
asked by 21.06.2016 / 05:11
3
answers

What does it mean to assign Math.random () 0.5 to a variable?

What does this Math.random() > 0.5; mean in boolean ? Here is an example: class Pro { public static void main(String[] args) { int numero = 10; boolean[] array = new boolean[numero]; for(int i= 0;...
asked by 14.02.2016 / 22:48
2
answers

How to get an item from a list randomly?

Suppose I have the following list: frutas = ['abacate', 'mamão', 'laranja', 'uva', 'pêra'] I need to capture one of these elements of list randomly. How would I do this in Python?     
asked by 09.01.2017 / 19:31
1
answer

Generate random numbers in Java

How to generate only numbers greater than 2? How to generate only numbers greater than 2 and the generated numbers have to be multiples of 3 (eg 3, 6, 9)? How to generate only numbers smaller than 10? How to generate only numbers smalle...
asked by 28.10.2015 / 23:40
2
answers

Regex in dynamic string of X characters, in dynamic content

Next, I have a page that generates content scrambled with dynamic and non-dynamic strings, I need to get a dynamic value between the | tabs, it contains random data / strings that change when loading the page. The variable I want to get h...
asked by 13.06.2015 / 07:44
1
answer

How to generate a random number within a range?

Using the arc4random_uniform() method, how should I assemble the logic to generate a random within a given range? For example, given the range [5, 10] Random Candidates:    5, 6, 7, 8, 9, 10     
asked by 20.03.2015 / 21:05
1
answer

Randomized query in ascending order in MYSQL

I have a table where I have the student's name and punctuation, I need to pick up 5 random students and display them in ascending order of punctuation. I tried to do this, but he's just bringing students randomly and not ordering the score:...
asked by 27.01.2016 / 15:30