Is there any simple and fast algorithm (to be implemented in Javascript) to obtain a sample from the hypergeometric distribution? My needed sample size is very large (100,000,000).
2026-03-29 12:38:35.1774787915
hypergeometric distribution and random sampling
202 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in RANDOM
- Prove that central limit theorem Is applicable to a new sequence
- Generating random versions of cubic and quadratic curve
- Is product of random numbers still random?
- Can I generate a random number with the probability distribution of the area under any arbitrary function?
- Average distance from a line to a point
- When does two random measures coincide in distribution?
- Determine the maximum period of this potential random number generator, if possible
- Does a random variable come from a probability distribution or is it vice-versa?
- Expected number of operations until matrix contains no zeros.
- Mean and Variance of Random Sum of Random Variables
Related Questions in SAMPLING
- Defintion Ideally sampled image
- What is expected value of a sample mean?
- Why does k-fold cross validation generate an MSE estimator that has higher bias, but lower variance then leave-one-out cross-validation?
- Sampling Question
- Limit of chi square distribution.
- Sampling Distribution of Difference of Normal Random Variables
- Sampling Distribution and Chi Squared Random Variables
- Variance of $S^2$ taken from Normal Distribution
- Sample Variance Definition Disparity
- [data generating process]-[sampling from an infinite population]-[i.i.d.]: some clarifications
Related Questions in HYPERGEOMETRIC-FUNCTION
- Probability of future success when trials are dependent: In 4 draws w/o replacement, what is the probability that draws 3 & 4 will be successful?
- Integral of a Gaussian multiplied with a Confluent Hypergeometric Function?
- Integral $ \int_{0}^{D} x \cdot (\sqrt{1+x^a})^{b}\,dx$
- Generating function of the sequence $\binom{2n}{n}^3H_n$
- Integral $\int (t^2 - 1)^{a} \cdot t^{b} \cdot \log(t)\,dt$
- The integral of an elliptic integral: $\int_{0}^{1}\frac{x\mathbf{K}^2\left ( x \right )}{\sqrt{1-x^{2}}}\mathrm{d}x$
- Integrating $\int (t^2+7)^{\frac{1}{3}}$dt
- Evaluating a definite integral with hypergeometric function
- Consider a sequence of n independent multinomial trials
- Asymptotic expansion of the hypergeometric function
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
Why not just implement it via its definition? You have a population of size $N$ amoungst which $K$ are successes. You sample $n$ times without replacement and count the number of successes. You can easily implement this by having an array of numbers $\{1,2,\cdots,N\}$, with numbers $1,2,\cdots,K$ being the "successes." Now draw a number $X_1$ uniformly and remove it. If $X_1\leq K$, you record a success. Now repeat with the number removed, $n$ times. The total number of successes is hypergeometric.