Skip to main content
Filter by
Sorted by
Tagged with
4 votes
3 answers
169 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 ...
WeCanDoItGuys's user avatar
0 votes
2 answers
110 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. ...
Sans the Medic's user avatar
-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 ...
Robertmg's user avatar
  • 119
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(...
The Justice King's user avatar
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 ...
Erithacus Rubecula's user avatar
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], ...
jasmine's user avatar
  • 263
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 ...
Ben's user avatar
  • 821
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 ...
Caden Stone's user avatar
0 votes
0 answers
37 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 ...
Jose Lopez's user avatar
2 votes
2 answers
78 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(&...
bribina's user avatar
  • 89
2 votes
3 answers
118 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 ...
geoscience123's user avatar
4 votes
2 answers
182 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 𝑎[1..n] that contains the value 1, where half ...
Colab Google's user avatar
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 ...
BioData41's user avatar
  • 1,032
0 votes
0 answers
116 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 ...
darkfrei's user avatar
  • 638
1 vote
1 answer
51 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 ...
Sakurai.JJ's user avatar
0 votes
1 answer
96 views

I'm trying to numerically calculate the CDF of the sum of two random variables and I'm having trouble replicating answers on StackOverflow. This question CDF of a sum of independent random variables ...
Vermin's user avatar
  • 13
3 votes
1 answer
82 views

I have a Markov Chain in R: set.seed(123) n_states <- 5 matrix <- matrix(runif(n_states^2), nrow=n_states) # set some transitions to 0 matrix[1, 4:5] <- 0 matrix[5, 1:3] <- 0 matrix[...
farrow90's user avatar
0 votes
1 answer
72 views

I need to use OpenBUGS to compute the posterior probability of the mean lifetime of a piece of equipment being greater than 100 hours. Given that the data comes from an exponential distribution with ...
not anymore's user avatar
0 votes
1 answer
84 views

I'm working with an R package called "ruin package", and it is taking too long to compute the ruin probability for the parameter values that I chose. The function works, I already checked ...
Karla Sharai Rodriguez Ramirez's user avatar
7 votes
5 answers
873 views

I have this data: simulated_states = c("A", "E", "B", "B", "A", "C", "D", "A", "B", "D", "A&...
heartofdarkness's user avatar
2 votes
1 answer
54 views

I have a list of historical frequencies of elements that have occurred together over time. These elements may have occurred (without repetition) in sequences of various order and length. For example, ...
pyll's user avatar
  • 1,754
-2 votes
2 answers
49 views

i have students academic data and would like to investigate whether some subject combinations will increase the probability of failure. let's make an example data set (data sourced from real uni data ...
Big Wool's user avatar
0 votes
2 answers
95 views

I am not sure if this is more suitable for math stackexchange or stack overflow, but since the mathematical proofs look alright to me, I suspect its the code that's the issue and hence I will post it ...
Ishigami's user avatar
  • 592
0 votes
1 answer
118 views

I have an excel file with x rows with random numbers (from 1 till 25). The total number of columns (numbers) can vary (15, 16, 17, 18, 19 or 20): I need python to tell me my probability of winning a ...
ROCA's user avatar
  • 149
0 votes
1 answer
73 views

Think of this problem similar to a lottery: I have been trying to determine all possible combinations of 15 numbers (from 1 to 25). By mathematical calculation, I know it is 3.268.760 possibilities. ...
ROCA's user avatar
  • 149
0 votes
2 answers
64 views

I have created a pandas dataframe as follows: ds = {'col1' : ["A","B"], 'probability' : [0.3, 0.6]} df = pd.DataFrame(data=ds) The dataframe looks like this: print(df) col1 ...
Giampaolo Levorato's user avatar
0 votes
1 answer
66 views

I have the next code in Julia but the problem is when I use the vector p = [0.2,0.1,0.1,0.15,0.17] with n = 3 appears the next: BoundsError: attempt to access 4-element Vector{Float64} at index [5] ...
victhor99's user avatar
0 votes
1 answer
193 views

I know that for static weights the recommended way to go is Walker Alias method because it has sampling complexity of O(1). However I have a case where I need to be able to temporary adjust ...
user64675's user avatar
  • 366
0 votes
0 answers
95 views

I was trying to implement a gacha system using probability and show the result with a SnackBar, I have found question #61822429, and tried using it but i could'nt found the right way. I was expecting ...
shotmeinthehead's user avatar
3 votes
1 answer
80 views

Recently when reading SICP, one footnote says: Numbers that fool the Fermat test are called Carmichael numbers, and little is known about them other than that they are extremely rare. There are 255 ...
An5Drama's user avatar
  • 774
0 votes
0 answers
39 views

An event can occur[1] or not[0]. It depends on the age of the object! It can happen in summer, autumn, winter, or spring, and then it has a different probability depending on the season. It can take ...
paule's user avatar
  • 61
1 vote
1 answer
193 views

I have an enum and I want to create instances of its variants by performing a random non uniform extraction. A possible solution involves using Rng::gen_range() from rand by trying to match the ...
rdxdkr's user avatar
  • 1,285
1 vote
0 answers
411 views

Is there any basis in determining the probability threshold in xgb.predict_proba while using XGBClassifier, especially if the data are imbalanced. I know when xgb.predict is used, a probability ...
Omab's user avatar
  • 11
1 vote
1 answer
257 views

I am working on a statistical analysis in R where I need to do a multivariate t-distribution. Each component of my parameter vector 𝛽 β should follow a univariate t-distribution derived from a ...
julialucy's user avatar
0 votes
0 answers
22 views

I am working with dmultinom function from the Stats package in R. I am trying to calculate the probability of observing these values: observed_values <- c(23, 14, 81, 0, 0, 0, 154, 0, 0, 54, 0, 0, ...
Hasinala Ramangason's user avatar
-3 votes
1 answer
188 views

I am trying to solve a code challenge. It is about the game blackjack. 2 cards are given to me, 1 to the dealer. I know every card including the deck. I need to calculate the probability to win, to ...
notmemaybe's user avatar
0 votes
1 answer
167 views

I am trying to understand the difference between discriminative models and generative models. One of the helpful answers at Stack Overflow is here: What is the difference between a generative and a ...
Oatmeals's user avatar
  • 119
1 vote
1 answer
66 views

I'm just learning javascript and one of my personal projects for learning is a rpg game. I've been trying to get this working for several days, using functions I've seen on stackoverflow and trying to ...
I Will Learn's user avatar
0 votes
1 answer
370 views

The context for this question is that say I have 200 dollars locked up that will be paid back to me each month for a varying amount of money with the final payment taking pace on the 4th year. I'm NOT ...
Wolfgang Icarus's user avatar
1 vote
0 answers
121 views

I have a messy Excel formula that I'm trying to figure out. I have data with 2 or more columns, each associated with the probability (labeled p1, p2, p3, etc.) of a particular whole number outcome (...
Vallis's user avatar
  • 11
0 votes
0 answers
103 views

I am trying to use the result that $p(\omega)^n$ = Gamma(n, beta) where $p(\omega)$ is the fourier transform of an $Exp(\beta)$ distribution. My code does well for small n but as n increases the gamma ...
John Smith's user avatar
1 vote
1 answer
66 views

The question is "The winning probability for each ticket is 0.005. You can get 25 lottery tickets for free. After the free ticket, you need to pay $9.6 to buy a ticket. You are guaranteed to win ...
meow's user avatar
  • 13
0 votes
2 answers
373 views

Let our distributions both be uniform, the first (A) with bounds (ψ,Ψ) and the second (B) with bounds (φ,Φ). What is the probability of A.random() > B.random()? # A>...
Bennett D's user avatar
2 votes
1 answer
127 views

I want to calculate the probability that a Weibull random variable X is greater than 1000, where X ~ Weibull(lambda, g). Using the CDF I calculate it as: g = log(log(.7)/log(.5))/log(40/81) lambda = -...
nilsinelabore's user avatar
3 votes
3 answers
73 views

Supposed I toss 10 dice many times (let's say, 10000 times), and I want to know the probability of the sum on 10 dice falling into a range (10 to 20, 20 to 30, ..., 50 to 60). How can I divide the ...
Keith Duong's user avatar
0 votes
0 answers
91 views

My objective is to calculate the expected cost for each path from the starting point to the end point and identify the minimum expected cost for each path when the respective node serves as the ...
stat_man's user avatar
  • 161
0 votes
1 answer
723 views

I need some insights on the following problem. You are given a coin whose diameter is equivalent to half the length of a chessboard unit square. If you throw the coin on the board, what is the ...
KELVIN MWAKA MUIA's user avatar
1 vote
2 answers
209 views

I have a pandas dataframe like this: ID Value 0 a 2 1 a 4 2 b 6 3 c 8 4 c 10 5 c 12 I would like to sample equally from the ID groups. I know I can ...
mnoerregaard's user avatar
0 votes
1 answer
409 views

I'm using the code below to fit an HMM model with two hidden states, a vocabulary of size 5 (so 5 possible symbols), and a list of sequences, each with 10 observations. I don't understand why model....
zzzbbx's user avatar
  • 10.2k
1 vote
1 answer
301 views

I have three random variables X, Z, and Y, and I know their distribution functions F(X), F(Z), and F(Y). However, the dependence structure among them is not known. I want to calculate the conditional ...
user17326436's user avatar

1
2 3 4 5
81