Advertisement

Decimal random number generator

Choose the number of decimal places before drawing. This samples equally spaced decimal values directly, so uniqueness refers to the displayed precision.

Calculator

Change this whole number for a different reproducible sample.

Eligible decimal values
101
Smallest eligible value
0.000000
Largest eligible value
1.000000
Fixed-precision list
0.40, 0.64, 0.30, 0.40, 0.18, 0.14, 0.71, 0.10, 0.77, 0.68
Final generator state
2,007,237,709.000000
Generated column
PositionValue
1.0000000.400000
2.0000000.640000
3.0000000.300000
4.0000000.400000
5.0000000.180000
6.0000000.140000
7.0000000.710000
8.0000000.100000
9.0000000.770000
10.0000000.680000

Advertisement

How this calculator works

Multiply the bounds by ten to the chosen decimal-place count and find the eligible integers. Exclude an endpoint only if it is itself on that grid. Each sampled integer maps back to a decimal, avoiding the unequal edge bins created by rounding a continuous sample. Without-replacement mode removes each selected grid position through a partial shuffle. Both the list and column are returned. Zero decimal places gives integers. The seed reproduces a teaching sample and is unsuitable for secure draws.

Formula

Grid values = k/10^d for eligible integers k. With replacement each value has model probability 1/N. Without replacement, draw from the remaining positions after each selection.

Worked example

From 0.00 to 0.03 inclusive at two places, the eligible values are 0.00, 0.01, 0.02 and 0.03. Seed 1 draws 0.02, 0.00, 0.00 with repeats allowed. Without repeats it draws 0.02, 0.00, 0.03, 0.01.

Advertisement

Frequently asked questions

Can excluded bounds still appear after rounding?

Sampling takes place on the final decimal grid, without a later rounding step. An excluded grid endpoint cannot be selected.

What if my bounds have more decimal places than the sample?

The eligible grid is clipped to the bounds. For example, 0.011 through 0.029 at two places contains only 0.02.

Why is there a limit on the eligible grid size?

The seeded generator has a finite integer state range. This tool limits the grid to that range so rejection mapping can assign every position.

Does sorting change the draw?

Sorting rearranges the sampled values after generation. It preserves duplicates when repeated values are allowed.

Sources

Advertisement