Skip to content
Saha Hesap

Random Data and Single Variable Monte Carlo Simulation

Generate seeded uniform real or integer data. Sample a model with one variable to estimate its mean, standard error and integral.

Reproducible random data

The same seed, count and bounds reproduce the same sequence. Real mode generates uniform values. Integer mode includes both endpoints. The first 20 generator outputs are discarded before sampling. The generator uses s = 16807s mod 2147483647. This simple generator is intended for learning and basic sampling, not cryptography, security, lotteries or demanding simulations in many dimensions. Integer conversion uses rejection sampling to avoid remainder bias.

Monte Carlo model

Enter an expression f(x) with one variable. Uniform samples of x between a and b are passed through the model. Their mean estimates the expected output. Multiplying by the interval width estimates the integral. Sample standard deviation uses denominator n − 1. The estimated standard error of the mean is s/√n and the integral error estimate is (b − a)s/√n. These estimates are neither rigorous error bounds nor confidence intervals. Sampling can miss narrow peaks and singularities. Finite samples do not prove that an integral converges.

Limits and example

For constant f(x)=2 over [0,3], all outputs are 2 and the integral is 6. Use 2 to 10000 samples and a seed from 1 to 2147483646. Real bounds have magnitude at most 1e50 and model outputs at most 1e100. Expressions support arithmetic and functions such as sin, cos, exp and log, using radians. The table shows the first 100 rows and CSV includes all rows. Multiple random inputs and correlation are not modelled.

Frequently asked questions

How do you generate a random integer from 1 to 10?

For example, a seeded pseudorandom generator produces 2 integers from 1 through 10, giving 3 then 9 with seed 1. Repeating the seed and settings reproduces the sequence, after initial transitions are discarded and values mapped to a uniform integer range, without providing cryptographic security or physical randomness.

Calculate with these values

Related calculators

Found a mistake or something missing?

If a value looks wrong, a size is missing or you need a feature, write to us and we will fix it.

Send an email