случайные-числа

Java Math. random repeats the values. Galton Board

This program demonstrates the work of the Galton board. This board has a N slot on the bottom and one hole on the top. The to ... hile (times > 0) { //code... rand.setSeed(System.currentTimeMillis()); } // code... It didn't help

STL C++ stl random

We need a lambda function that generates a random number of stl by the generator, normal scattering . minimum -50 max 50. the ... = []() { return std::mt19937 gen{std::random_device()()}, std::uniform_int_distribution<int> uid(-50, 50); };

How random is random.randint in python?

import random x=0 for i in range(10000): my_series = [random.randint(0, 11) for i in range(100)] x += 1 if len(list(f ... negative even though the list generation is random and the possible number of even and odd values is the same(from 0 to 11).

Random with a certain probability of occurrence

There is randon(1,10); Is it possible to implement it with a certain percentage, that is, the same rand, but the 2-ki has an 80% chance of falling out, etc. Does anyone have any ideas?

Generating a sequence of unique random numbers

I need to generate a sequence of unique random numbers. I use a standard generator and get repetitions, and quite often, for ... (); for (var i = 0; i < 20; i++) { Console.Write(rand.Next()); Console.Write(' '); } 1 3 3 2 0 9 5 8 2 4 9 ...

Random string generation

I'm interested in how you can generate a string like sa32Asf7w1 using the random library in python. The first 4 characters are a random set of letters and numbers, from 6 to 10 the same. 5 character - random capital letter.

Math.random() JS

var rand = Math.random(1, 3); alert(rand); This code always gives out approximately the following numbers: 0.265656231225, it does not respond to the range at all. Always 0. What is the problem?

How do I find the product of all the elements of a two-dimensional array?

In the product, it always outputs 0. Everything is fine with a one-dimensional array, but when working with a two-dimensional ... ; 3; i++) for (int j = 0; j < 3; j++) r = r * a[i][j]; System.out.println(r); } }

How do I get a random number generator to give fractional values?

I can't figure out how to get a random number generator to give fractional values. I tried to do this. A = rand() % 158.6 ... свобождение памяти for (int i = 0; i < N; i ++) delete [] A[i]; delete [] A; system("pause"); return 0; }

Random selection of two phrases (words)

Tell me if there is any simple method of choosing from two phrases. For example, implementing such a Random r = new Random(); ... теплый"; break; } This code is too cumbersome, is there any reduction? For example: function(glass {warm|cold});

Creating Random objects WITHOUT duplicate objects

.Hello, good people. My task is to randomly determine the number of so-called survivors and list them. The problem is that th ... nt deletion of the object selected by random, but it did not work. I will be glad to hear the options your decisions. Thanks.

Shuffle all the letters in the string in all possible variations

The user enters a string, you need to mix the letters in it in all possible variations and display them in the list, and remo ... solution to the problem, the question is taken from here: https://www.codewars.com/kata/5254ca2719453dcc0b00027d/train/python

The rand function in the loop

double rnd() { srand(time(0)); return(rand() % 1000 / 1000.0); } I call the function above in a loop, you need to m ... t a bunch of identical numbers. To solve my problem, I need to get a random number on each scroll (probability) some event.

How in Python to determine which random number will most often appear from the list of values starting from (00, 0,1,2 ... 36?

I recently started learning the random module. You need to do it 1000 times and identify the most frequent number, if possibl ... till output not 1, but 5 of the most frequent numbers. The problem with 00, I do not understand how to write it as a number.

Random word generator in Russian

I need a word generator in python, I know that there is a Random-Words package for this. Are there any alternatives for other ... nse = requests.get(Word_site) WORDS = response.content.splitlines() But again, here is the import of the English dictionary

How to output random characters by their Unicode code

I'm trying to output Unicode characters in the range 9398, 10178. import java.util.*; public class Unicode { public stat ... oblems with '\u' in creating the variable.How can I solve this so that the program can output random characters in the range?

random. shuffle with indexing

I set myself the task of making a type of obfuscator. In general, the user sets a string (text) to the text_to_compile variab ... hed_text) complete_text2 = 'local out2 = ' + '..'.join(finished_text) print(text_compiled) print(complete_text)

How to generate a random number in an interval without repetitions? [duplicate]

This question has already been answered here: ... You need to generate a random number in the range from 1 to 30 inclusive without repetitions. How do I do this?

Randomizer of words in an array

You need to write a randomizer of words that takes 6 letters from the keyboard,writes them in the " alphabet "and then makes ... break; } } //for (int i = 0; i < 6; i++) //тест вывода // cout << Slovaa[i]; return 0; }

Random does not work correctly in the C# loop [duplicate]

This question is already answered here: ... o a separately created file and based on randomly taken values from the head (and not based on the image) works correctly...