uniform-distribution Questions
9
I am trying to generate random points on the surface of the sphere using numpy. I have reviewed the post that explains uniform distribution here. However, need ideas on how to generate the points o...
Coincident asked 28/11, 2015 at 22:1
4
Solved
Given some interval [a, b] of indices (64-bit unsigned integers), I would like to quickly obtain an array that contains all of these indices ordered according to a uniformly distributed hash functi...
Paramnesia asked 21/4, 2023 at 21:57
9
Solved
I want to get a 2-D torch.Tensor with size [a,b] filled with values from a uniform distribution (in range [r1,r2]) in PyTorch.
Grainfield asked 2/6, 2017 at 12:5
10
Solved
I am looking to be able to generate a random uniform sample of particle locations that fall within a spherical volume.
The image below (courtesy of http://nojhan.free.fr/metah/) shows what I am lo...
Logjam asked 23/3, 2011 at 16:11
3
Imagine 10 cars randomly, uniformly distributed on a round track of length 1. If the positions are represented by a C double in the range [0,1> then they can be sorted and the gaps between the c...
Supposititious asked 27/8, 2021 at 17:32
1
Solved
Is
p = rand(-1.:eps():1., 100000)
a good way to get random Float values in [-1, 1]?
A common suggestion seems to be 2. * rand(100000) - 1. instead, but
this doesn't ever return 1 since rand's ran...
Britten asked 18/8, 2021 at 4:56
7
Solved
I could not find a built-in function in Python to generate a log uniform distribution given a min and max value (the R equivalent is here), something like: loguni[n, exp(min), exp(max), base] that ...
Palestrina asked 15/5, 2017 at 10:57
4
Solved
In the documentation it is said that there is a chance that uniform(0,1) can generate the values 0 and 1.
I have run uniform(0, 1) 10000 times, but it never produced zero. Even in the case of uni...
Adara asked 4/10, 2019 at 18:58
2
Solved
In this link, it says that truncated MD5 is uniformly distributed. I wanted to check it using PySpark and I created 1,000,000 UUIDs in Python first as shown below. Then truncated the first three ch...
Knowlton asked 22/10, 2018 at 20:1
6
Solved
I want generate a number in Gaussian and Uniform distributions in matlab.
I know this function randi and rand() but all of them are in normal (Gaussian) distribution. How can a generate a random nu...
Lonely asked 12/12, 2012 at 17:8
1
Solved
I wanted to generate a random real (I guess rational) number.
To do this I wanted to use runif(1, min = m, max = M) and my thoughts were to set m; M (absolute) as large as possible in order to ma...
Relief asked 18/3, 2018 at 9:9
2
Solved
I want to sample a two-dimensional vector x from a uniform distribution with ∥x∥ ≤ 1. I know I can sample from a uniform distribution as
numpy.random.uniform(0.0, 1.0, 2)
but how can I make sure...
Alchemize asked 29/10, 2017 at 4:32
2
Assume it's given a set of rectangles with different areas and some rectangles could overlap.
Objective is generating of a uniform random point among rectangles' areas.
Rectangle is defined as a p...
Jollify asked 4/4, 2018 at 15:46
3
The algorithm in this question tells us how to efficiently sample from a multidimensional ball. Is there a way to similarly efficiently sample from a multidimensional ring , i.e. have r1<r<r2...
Guiscard asked 24/11, 2017 at 11:14
4
Solved
[I'm splitting a population number into different matrices and want to test my code using random numbers for now.]
Quick question guys and thanks for your help in advance -
If I use;
100*rand(9...
Godless asked 9/11, 2011 at 11:55
2
std::uniform_int_distribution accepts any of <random>'s PRNG's, including the ones that are consistent across implementations and platforms.
However, std::uniform_int_distribution itself does n...
Cornhusk asked 13/6, 2017 at 12:2
4
Solved
I use the C++ random number utility library in quite a few places. It might not be perfectly comfortable (e.g. no base class for an arbitrary distribution), but - I've learned to live with it.
Now...
Reggie asked 15/8, 2016 at 13:52
2
Solved
Let me start by stating what I'm trying to accomplish:
I need to randomly generate a set of numbers within a range
I would like those numbers to be somewhat uniformly distributed
I need to be abl...
Preconcert asked 31/7, 2016 at 0:16
5
Solved
I have two options of code:
Option 1
int myFunc() {
return new Random().nextInt();
}
Or:
Option 2
private static final Random random = new Random();
int myFunc() {
return random.nextInt();...
Tache asked 7/7, 2016 at 10:10
1
Solved
I'm trying to convert this line of matlab in C++: rp = randperm(p);
Following the randperm documentation:
randperm uses the same random number generator as rand
And in rand page:
rand ret...
Singlehanded asked 14/7, 2016 at 7:23
2
Solved
If I were to produce floating point values in the following way:
template <typename T>
T RandomFromRange(T low, T high){
std::random_device random_device;
std::mt19937 engine{random_devic...
Belsky asked 24/4, 2016 at 16:25
1
© 2022 - 2025 — McMap. All rights reserved.