Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
4 votes
3 answers
171 views

I want to iterate through a list of size n, with A 1s in it (the rest are 0s), and I want the 1s randomly distributed. n and A are large, so I'm trying to make a generator instead of a list. If they ...
0 votes
2 answers
113 views

I'm working on designing an RNG loot table for something a friend is running, and the obvious solution given the nature of the loot table (its for a foraging system) is to use a weighted RNG method. ...
-4 votes
1 answer
98 views

I am a mathematician. I am doing some work on simulating probability distribution draws, but there are lots of calculations involved in terms of numerical integration, function inversion. All of this ...
0 votes
0 answers
69 views

I have a simple 1D value noise function here: public float ValueNoise1D(float x) { int l = Mathf.FloorToInt(x); int r = l + 1; float vl = hashToFloat(hash(l)); float vr = hashToFloat(...
1 vote
0 answers
71 views

When computing the dist.log_prob function for a uniform distribution on a box dist, the results seems to be -inf for the coordinates that are out-of-bound and -log(upper - lower) for the coordinates ...
4 votes
3 answers
170 views

I have a pre specified mean [0.5, 0.5, 0]. This is a probability array which sum up to 1. I want to generate several, say 10 random probability arrays (each sums up to 1) whose mean is [0.5, 0.5, 0], ...
0 votes
3 answers
171 views

I have an array with values and probabilities (or in PHP, keys and values): Value Probability John 3 Peter 2 Paul 1 I want to shuffle this array but have the order be influenced by the ...
6 votes
0 answers
148 views

Given: A list of numbers, "values". A sample size, x A kth highest number (ex: [3, 2, 1, 0], 2 is the 2nd highest number) Write a function kmax(x, k) that returns the Mean and Standard ...
0 votes
0 answers
47 views

I want to try to do the Monte Carlo in this circuit with an instrumental amplifier, but the loop does not work for me, I try to export in a txt file, but the 100 iterations are accumulated in the ...
2 votes
2 answers
79 views

I am trying to remake this figure with my data. I have 2 binary factors (P treatment & Embryo_Presence_vs._Absence) and 1 continuous value (Final_Size). Here is my data: print.data.frame(x[c(&...
2 votes
3 answers
119 views

I have an R data frame that I need to perform a random binomial draw for each row. The n = argument in the random binomial draw will be based on a value in a column of that row. Further, this ...
4 votes
2 answers
183 views

Consider the following algorithm: while True: i = random(1, n) if a[i] == 1: return i The objective is to find a position in an array a[1..n] that contains the value 1, where half ...
0 votes
0 answers
67 views

I want to expand on the following question and answers found here: What are the chances that two messages have the same MD5 digest and the same SHA1 digest? My interest in this question is not about ...
0 votes
0 answers
118 views

I'm working on a simulation in Lua where I need to randomly assign cars to a set of slots based on probabilities. Specifically, I want the probability for each slot to be adjusted dynamically as the ...
1 vote
1 answer
52 views

I have a non-negative normalized vector p. I would like to sample an index from the index set of the vector. The probability getting sample k is p[k]. Using np.random.choice function, I can write the ...

15 30 50 per page
1
2 3 4 5
...
270

AltStyle によって変換されたページ (->オリジナル) /