Statistics & Probability / Inverse & Rejection Sampling
FREE TO EXPLORE
LABORATORY 22 · STATISTICS & PROBABILITY

Pseudo-Random Number Generation: Inverse Transform and Acceptance-Rejection Sampling

Investigate fundamental stochastic simulation algorithms, implement the Inverse Transform method for invertible CDFs, construct Von Neumann Acceptance-Rejection sampling for complex target densities, and measure bounding envelope efficiency. Explore interactive statistical sampling, probability models, and empirical regression.

SAMPLE · INFER · CONVERGE

Your virtual statistics laboratory.

TOTAL CANDIDATE PROPOSALS EVALUATED N_PROP—
SAMPLING TELEMETRY

Ready to sample with Quota Scale k = 1.0.

1.0 quota
Target density f(x) = 6x(1-x) on [0, 1] (Beta(2, 2))

Adjust Quota Scale k, then execute statistical trial.

Probabilistic samples are evaluated rigorously using 64-bit IEEE 754 precision. Residuals reflect ordinary least-squares regression across successive observations. Continuous data structures support high-fidelity empirical probability functions.

Statistical assumptions and distribution limits

Acceptance-rejection sampling becomes computationally inefficient in high-dimensional parameter spaces (curse of dimensionality). The empirical regression of candidate proposals against target quota yields a linear gradient of m = 1.5000, confirming the theoretical envelope factor c = 1.500 with R² = 1.000000.

Statistical tools & sampling modules.

Uniform Pseudo-Random Core

Generates high-quality uniform random variates U ~ U[0, 1] using the 64-bit Xoshiro256** algorithm.

Inverse CDF Analytical Inverter

Generates non-uniform variates X = F^(-1)(U) for analytically invertible cumulative distributions.

Von Neumann Envelope Generator

Constructs proposal densities g(x) and bounding scale constants c = sup [f(x)/g(x)] to form majorizing envelopes.

Acceptance-Rejection Decision Unit

Applies the stochastic filter: accept proposal Y ~ g if U ≤ f(Y) / (c g(Y)); reject and repeat otherwise.

Sampling Efficiency Meter

Measures the empirical acceptance rate P(Accept) = 1/c and computes proposal overhead.

Proposal Overhead Regression Engine

Performs linear regression of total candidate proposals versus accepted sample quota to extract envelope factor c = 1.500.

FOLLOW THE METHOD

A reason behind every step.

Investigate fundamental stochastic simulation algorithms, implement the Inverse Transform method for invertible CDFs, construct Von Neumann Acceptance-Rejection sampling for complex target densities, and measure bounding envelope efficiency. Standardized parameter settings: 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 quota.

01

Initialize Target and Proposal Densities

Specify target probability density f(x) = 6x(1-x) on [0, 1] (Beta(2, 2) distribution) and proposal density g(x) = 1 (Uniform U[0, 1]) on the simulation dashboard.

02

Calculate the Optimal Bounding Constant c

Differentiate the ratio f(x)/g(x) = 6x - 6x^2 to find the maximum at x = 0.5: c = sup [f(x)/g(x)] = 6(0.5)(1 - 0.5) = 1.500.

03

Implement the Inverse CDF Method on Exponential Data

In the comparison module, draw U ~ U[0, 1] and evaluate X = -ln(1 - U) / λ. Verify that the resulting sample follows the Exponential distribution with 100% acceptance efficiency.

04

Execute Acceptance-Rejection Sampling

Draw candidate Y ~ U[0, 1] and test threshold U_2 ~ U[0, 1]. Accept Y if U_2 ≤ f(Y) / (c g(Y)) = 6Y(1-Y)/1.5 = 4Y(1-Y). Count accepted variates and rejected proposals.

05

Step Target Sample Quota Across k = 1 to 6

Increment accepted quota across standardized settings N_target = 1,000 · k for k ∈ {1, 2, 3, 4, 5, 6}, recording total candidate proposals N_prop evaluated.

06

Perform Linear Regression on Proposal Scaling

Fit a linear regression model y = mx to the coordinate pairs (x = k, y = N_prop / 1000). Confirm that empirical slope m = 1.5000 rigorously recovers the bounding constant c = 1.500.

YOUR NOTEBOOK · 0 OBSERVATIONS

Turn measurements into empirical insight.

See a complete example report ↗

Points are your recorded observations. The solid regression line validates Inverse & Rejection Sampling mathematical scaling.

LINEAR REGRESSION FIT · y = mx + b
y = 1.5000 · x
#Target Sample Quota Scale k (quota)Total Candidate Proposals Evaluated N_prop (Proposals)Target Quota Multiplier kTotal Proposals Evaluated N_propRemove

No readings yet. Execute a statistical trial and record it.

Calculate it yourself.

CHECK YOUR UNDERSTANDING

Explain what the statistical metrics mean.

What is the theoretical acceptance probability in Acceptance-Rejection sampling with bounding constant c?

If target density f(x) = 6x(1-x) on [0, 1] is bounded by uniform proposal g(x) = 1, what is the optimal bounding constant c = sup[f(x)/g(x)]?

For target sample quota N_target = 1,000 with bounding constant c = 1.500, what is the expected number of candidate proposals evaluated?

What fundamental condition must the cumulative distribution function F(x) satisfy to apply the Inverse Transform method?