Skip to main content

Questions tagged [random]

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

1 vote
1 answer
54 views

Generate n random 2D points within a valid region

I want to generate a fixed number of random-uniformly distributed xy points within a valid mask. The generated points should be continuous, i.e. can be "between pixels". I'm looking for an ...
Toni's user avatar
  • 33
0 votes
0 answers
23 views

rkdevine returns constant zero-valued simulations

I found that the rkdevine function, from the package kdevine, is returning constant zero-valued simulations when it shouldn't be the case. The function is meant to simulate from a a kdevine object, ...
Aguazz's user avatar
  • 1
-2 votes
0 answers
26 views

Powershell script reset expired AD pw with random pw [closed]

Does anyone have any suggestions of a PowerShell script, or how to find one, that would allow us to search Windows AD for passwords expired 7 days or more and change the password to a new random ...
Thom's user avatar
  • 1
-2 votes
0 answers
72 views

Why does my text based game display my options instead of attacking?

In my text-based Python game I handle random and scripted encounters: import time import os import random import sys from termcolor import cprint health = 75 player_turn_done = False usr_inpt = 0 ...
sp7n0's user avatar
  • 5
1 vote
1 answer
51 views

Using for loops, while, tidyverse, or packages to create a dataset with matching characteristics from a previous one (sampling) [closed]

I'm working with panel data. We assessed children in 2019 and 2020. Therefore, I have two datasets (2019 and 2020) and I want to create a third dataset matching the data from the second dataset (2020) ...
Luis's user avatar
  • 1,552
-3 votes
0 answers
37 views

cannot reshape array of size 1000 into shape (100,100) [closed]

>>> cent_rand = np.random.randint(1919, 3946, 1000) >>> len(cent_rand) 1000 >>> two_d_cent = cent_rand.reshape((100,100)) Traceback (most recent call last): File "<...
rosa elena's user avatar
0 votes
0 answers
59 views

Generate random value 0 to 1 using `crypto-js` library

I'm working on a small JS library, it consists of several npm packages for Web, NodeJS and React Native, but all of them use the shared core library. In the core library I've been using Math.random(), ...
Slava.In's user avatar
  • 931
0 votes
0 answers
12 views

Creating a pseudorandom matrix with a specific determinant and specific entropy

I was sampling several markov matrices for a project, for that: I want to create a random matrix, which is markovian(simply it's rows sum to one) and all its elements are between 0 and 1 it has a ...
Popat Patel's user avatar
0 votes
0 answers
24 views

Do I need to feed the entropy pool for /dev/random and /dev/urandom?

I'm working on an update of quite old kernel to just a bit newer and I've noticed that my /proc/sys/kernel/random is now quite different, e.g. entropy_pool (entropy_avail) value changed from 4096 to ...
lewiatan's user avatar
  • 1,166
1 vote
0 answers
31 views

Why I can't use gen_range method from rand::Rng trait with rand_chacha::ChaChaRng [duplicate]

I was looking for a seedable random number generator with consistent behavior across different platforms, and I was pointed to use ChaChaRng from the rand_chacha crate. I need to generate numbers ...
J K's user avatar
  • 642
0 votes
4 answers
74 views

Displaying all Results for Prime Numbers on One Popup Window

I am trying to create a password generator in Python. I'm starting off by writing a program to generate prime numbers to use when calculating RSA, and I found a program that I modified to display ...
user26149746's user avatar
4 votes
2 answers
84 views

Reverse work out the mean using random number seed

In R language version 4.4.1 (the version should not matter, just for the sake of discussion), we write the code : set.seed(1234) x <- 5 y <- rnorm(1, mean = x, sd = 0.1) We will be able to ...
温泽海's user avatar
  • 342
0 votes
0 answers
48 views

Numba and Numpy Generator Methods & Thread Safety Documentation Clarification

The Numba documention for the Numpy Random module states: The current Numba support for Generator is not thread-safe, hence we do not recommend using Generator methods in methods with parallel ...
John Duffy's user avatar
0 votes
0 answers
12 views

how to select N distinct items from M conflict items with different weight? #algorithm A-Res

A-RES A-RES calls for the selection of m distinct random items out of a population of size n, each item with weight. but my case is: a huge stream of input(some item maybe conflict many times with ...
user26002931's user avatar
3 votes
1 answer
63 views

can a random byte-array be decompressed? What algorithm would be used?

I can insert any byte-array into a compression-algorithm like Lempel-Ziv and i will get a lossless compressed byte-array back. I can decompress this again. But is there an algorithm that can ...
HerzogVolpe's user avatar

15 30 50 per page
1
2 3 4 5
2369