Chuyển tới nội dung
Number Buffet

Số nguyên ngẫu nhiên

Các số nguyên phân bố đều từ dải bất kỳ, bốc từ một hạt giống — nên cùng một liên kết luôn cho ra cùng danh sách.

Đọc 3 phút

Thiết lập

Thiết lập nhanh

Inclusive. If you put the larger number here, the two ends are swapped for you.

Inclusive, so 1 to 6 really can produce a 6.

Off means every value is different — a draw without replacement, like a lottery.

Sorting happens after the draw, so it changes the order shown but not which numbers came out.

The whole result is a function of this. Change it for a new draw; keep it to share one.

Tinh chỉnh dáng vẻ

Hãy chọn một thiết lập cạnh ảnh trước — các điều khiển này điều chỉnh nó.

Frame

A border drawn inside the edge of the image.

Nâng cao

Kết quả

10 giá trị

86, 56, 13, 56, 45, 5, 26, 73, 11, 22

Drawn from the seed "buffet" — the same seed and settings always reproduce this exact list. Observed mean 39.30 against 50.50 expected for a uniform draw from 1 to 100.


Tạo ảnh

Hãy bật JavaScript để tạo kiểu cho những số này và tải về dưới dạng ảnh. Bản thân các giá trị đã được liệt kê ở trên.

Text on the image

Drag a line straight onto the picture to place it — once placed, it stays exactly where you put it. Everything here is drawn into the download.

Bài viết nền bên dưới chưa được dịch và đang hiển thị bằng tiếng Anh.

Về số nguyên ngẫu nhiên

Before machines, random numbers were a publishing problem. L. H. C. Tippett produced the first widely used table in 1927: 41,600 digits, which he extracted from the area figures of a 1925 census report rather than generating from scratch. M. G. Kendall and B. Babington Smith were not satisfied that borrowed digits were random enough, so they built a randomising machine of their own design, published the statistical tests they thought a table should pass, and released 100,000 digits in 1939. The RAND Corporation went further in 1955 with A Million Random Digits with 100,000 Normal Deviates, whose contents came from an electronic roulette wheel and had to be de-biased before the book could go to press.

Hardware ran in parallel with paper. On 1 June 1957 the British Post Office switched on ERNIE — Electronic Random Number Indicator Equipment — to draw Premium Bond winners. It was built at the Dollis Hill research station by engineers including Tommy Flowers, who had designed the wartime Colossus, and it took its digits from electrical noise rather than arithmetic. The first draw kept it running for more than fifty hours.

The arithmetic approach that now dominates began with Derrick Henry Lehmer's linear congruential generator, proposed in 1949. It was cheap, and wrong in a specific way: in 1968 George Marsaglia showed, in a Proceedings of the National Academy paper titled "Random Numbers Fall Mainly in the Planes", that consecutive outputs of such generators lie on a lattice of hyperplanes. IBM's widely distributed RANDU was the notorious case — with multiplier 65539 and modulus 2^31, every triple of its outputs falls on just fifteen planes inside the unit cube, which quietly undermined simulation work for years.

Drawing without replacement has its own lineage. The shuffle now named for Ronald Fisher and Frank Yates appeared in their 1938 statistical tables as a pencil-and-paper procedure; Richard Durstenfeld published the in-place computer version in 1964.

Tính chất chính

  • Every value is drawn independently and uniformly, so each of the max − min + 1 possible outcomes has the same probability.
  • With duplicates allowed, drawing n numbers from a range of N values has N^n equally likely ordered outcomes.
  • The expected mean of a uniform draw from a to b is (a + b) / 2, and the variance is ((b − a + 1)² − 1) / 12.
  • The birthday problem applies to repeats: just 23 independent draws from 1–365 already give a better-than-even chance that two of them match.
  • With duplicates switched off and the count equal to the range size, the output is a uniformly random permutation of the whole range.
  • This page maps the generator’s 32-bit word onto your range by rejection sampling, which removes the modulo bias that a plain remainder introduces whenever the range size does not divide 2³² exactly.
  • The range is capped at ±1,000,000,000 so every result is an exact integer, well inside JavaScript’s safe range of ±(2⁵³ − 1).
  • The underlying generator is mulberry32, a deterministic PRNG. It is reproducible by design and therefore unsuitable for keys, passwords, or anything else that depends on being unpredictable.

Xuất hiện ở đâu

  • Classical Athens selected jurors by lot using the kleroterion, a slotted stone into which citizens placed bronze name tokens; black and white balls released down a tube decided which rows were seated. Fragments survive in the Agora Museum in Athens.
  • UK Premium Bond prizes have been allocated by a dedicated random number machine named ERNIE since 1957, with successive generations replacing noisy valves with later hardware sources.
  • Randomised controlled trials assign participants to treatment and control arms from a random allocation sequence; concealing that sequence from recruiters is what keeps the comparison honest.
  • Monte Carlo methods, developed at Los Alamos in the 1940s by Stanisław Ulam, John von Neumann and Nicholas Metropolis for neutron diffusion problems, replace an intractable integral with a large number of random samples.
  • Lottery and raffle players often avoid numbers they consider "overdue". Independent draws have no memory, so no past result changes the next one — the belief is the gambler’s fallacy, not a strategy.

Cách dùng bộ tạo này

Các giá trị được tạo hiện ở trên cùng, bên cạnh là nút sao chép. Để biến chúng thành ảnh, hãy chọn một dáng vẻ trong các kiểu ở phần Tạo ảnh, chọn kích thước xuất rồi tải về dưới dạng PNG, JPEG hoặc WebP. Mọi thứ được vẽ trong trình duyệt, nên không có gì bạn tạo ra được gửi tới máy chủ.

Thanh địa chỉ cập nhật theo lúc bạn làm, nên liên kết luôn cho lại đúng những gì bạn đang thấy — tiện khi muốn chia sẻ một dãy cụ thể hay giữ lại một cấu hình. Dùng Sao chép để lấy giá trị dưới dạng văn bản thuần, hoặc Xuất dữ liệu để có CSV, JSON, NDJSON, SQL và XML.

Nguồn

Các phần tóm lược lịch sử trên trang này dựa vào những tài liệu giấy phép mở được liệt kê ở trên. Thấy chỗ nào sai? Hãy cho chúng tôi biết và chúng tôi sẽ sửa.