One in six, ten thousand PINs and five ways to round a number

Calculate event probability as fraction and percent, count PIN and password combinations with variations, and compare five rounding methods side by side. Free online tools.

Patryk Matyjasik · 17 June 2026 · 9 min read

A 4-digit PIN code. Ten digits, four positions. That gives exactly 10,000 possible combinations. A thief trying every combination at one attempt per second needs under three hours. Banks know this, which is why they lock the card after three wrong tries. The math behind that security decision is not complicated, but most people have never seen it written down.

The same logic scales. An 8-character password using lowercase letters, uppercase letters and digits has 62 options per position. That is 62 to the power of 8, which equals 218,340,105,584,896 combinations. At one billion guesses per second, brute force takes over two and a half days. Add special characters and the time jumps to weeks.

These are not abstract math problems. They are the calculations that determine whether your accounts are safe, whether your experiment is statistically meaningful, and whether your financial report rounds correctly. Three new tools handle the numbers.


Variations with repetition: the math behind PINs and passwords

Every time you set a PIN, choose a password, or read a license plate, you are looking at a variation with repetition. The formula is simple: n raised to the power of k, where n is the number of available elements and k is the number of positions.

ScenarionkCombinations (n^k)
4-digit PIN (0-9)10410,000
6-digit PIN1061,000,000
8-char password (a-z, A-Z, 0-9)628218,340,105,584,896
License plate (26 letters, 3 pos + 10 digits, 4 pos)variesvaries175,760,000

The difference between variations with repetition and permutations without repetition matters. Permutations do not allow the same element twice. A PIN like 1-1-1-1 is a valid variation with repetition but not a permutation. When repetition is allowed, the total count is always higher.

For a 4-digit PIN: variations with repetition give 10,000 combinations, but permutations without repetition give only 5,040. The remaining 4,960 combinations all contain at least one repeated digit. That means roughly half of all PINs people choose would be impossible under a no-repeat rule.

The calculator also estimates brute-force cracking time. At one billion attempts per second (a realistic figure for modern hardware attacking a leaked hash), a 4-digit PIN falls instantly. An 8-character alphanumeric password holds for about 2.5 days. A 12-character password with the full 95-character set takes over 17,000 years.

Variations with Repetition Calculator showing n=10, k=4 gives 10,000 combinations

The Variations with Repetition Calculator takes two inputs: the number of elements and the number of positions. It returns the variation count, the permutation count for comparison, the ratio between them, and a brute-force time estimate.


Probability: what one in six actually means

Roll a standard die. The probability of getting a 6 is 1 in 6. Most people know this intuitively. But what does that number actually mean, and how does it connect to percentages, decimals, fractions and odds?

1 in 6 equals:

  • Fraction: 1/6
  • Decimal: 0.166667
  • Percentage: 16.67%
  • Odds: 1 to 5 (one favorable outcome against five unfavorable)

The odds notation confuses people the most. "1 to 5" means for every time the event happens, it does not happen five times. Betting odds work the same way. If a horse is listed at 4 to 1, the bookmaker expects it to lose four times for every win.

The calculator handles four modes:

Single event - the basic case. You have k favorable outcomes out of n total. Rolling a 6: k=1, n=6. Drawing a heart from a deck: k=13, n=52, which gives 25%.

Two independent events - what is the probability that both happen? Multiply. Rolling a 6 twice in a row: (1/6) times (1/6) = 1/36 = 2.78%. Drawing two hearts in a row (with replacement): (13/52) times (13/52) = 6.25%.

Union of events - what is the probability that at least one of two events happens? Add the individual probabilities and subtract the overlap. Probability of drawing a heart or a face card from a standard deck: P(heart) = 13/52, P(face card) = 12/52, P(heart and face card) = 3/52. Total: (13+12-3)/52 = 22/52 = 42.3%.

Repeated trials - run the same experiment multiple times. What is the chance of the event happening at least once? The formula is 1 minus (1 minus P) raised to the power of n. Flipping heads at least once in 10 coin flips: 1 minus (0.5)^10 = 99.9%.

QuestionAnswerInterpretation
Roll a 6 on one die16.67%Unlikely event
Roll at least one 6 in four rolls51.77%Better than a coin flip
Win a 1-in-1000 lottery after 1000 tries63.23%Not guaranteed
Two coins both heads25%Fairly likely

That lottery result surprises most people. After 1,000 tries at a 1-in-1,000 chance, the probability of winning at least once is only 63.2%, not 100%. The common intuition that "1,000 tries at 1-in-1,000 odds guarantees a win" is wrong. It takes about 6,900 tries to reach 99.9% certainty.

Probability Calculator showing P(A) = 1/6 = 16.67% for a single die roll

The Probability Calculator supports all four modes. Enter the numbers, read the probability as a fraction, percentage and odds ratio.


Rounding: five methods, five different answers

Ask someone to round 2.5 to the nearest integer and they will say 3. Ask a banker and the answer is 2. Ask a programmer and it depends on which rounding function they called. There are at least five common rounding methods, and they do not always agree.

Standard rounding (round half up) - the method taught in school. If the discarded part is exactly 0.5, round up. 2.5 becomes 3. 3.5 becomes 4. This is what most people mean by "rounding."

Ceiling (round up) - always round toward positive infinity. 2.1 becomes 3. -2.9 becomes -2. Used in pricing (always charge at least X) and resource allocation (if you need 2.3 trucks, you need 3 trucks).

Floor (round down) - always round toward negative infinity. 2.9 becomes 2. -2.1 becomes -3. Used in integer division and some tax calculations where regulations specify truncation toward zero.

Banker's rounding (round half to even) - when the value is exactly halfway, round to the nearest even number. 2.5 becomes 2. 3.5 becomes 4. This eliminates the systematic upward bias of standard rounding. Over thousands of transactions, the errors balance out. IEEE 754 floating-point arithmetic uses this as the default.

Truncation - chop off the decimal part. 2.9 becomes 2. -2.9 becomes -2. The simplest method, and the one used by many programming language integer conversions.

NumberStandardCeilingFloorBanker'sTruncation
3.14159 (to 2dp)3.143.153.143.143.14
2.500 (to 0dp)33222
3.500 (to 0dp)44343
-2.500 (to 0dp)-2-2-3-2-2

The difference between methods matters in finance. A bank processing a million transactions per day with a half-cent rounding decision on each one. Standard rounding adds half a cent upward on average, which over a million transactions is $5,000 per day of systematic bias. Banker's rounding eliminates that bias by rounding half-values down half the time and up the other half.

Pi provides a clean example for the comparison. Rounding 3.14159 to two decimal places, all five methods agree: the answer is 3.14 (or 3.15 for ceiling). The rounding error is 0.0016 for most methods, 0.0084 for ceiling. When precision matters - in engineering tolerances, scientific measurements, financial reconciliation - knowing the magnitude of the rounding error is as important as the rounded value itself.

Rounding Calculator showing 3.14159 rounded to 2 decimal places by five methods

The Rounding Calculator takes any decimal number and a precision level (from thousands down to six decimal places). It returns all five rounding methods side by side with the error for each.


Three tools, three layers of the same question

These three calculators look unrelated. One counts arrangements, one computes probabilities, one rounds numbers. But they form a natural chain.

Variations tell you how many possible outcomes exist. Probability tells you how likely a specific outcome is within that space. Rounding tells you how precisely to report the result. A security analyst calculating password strength needs all three: how many combinations (variations), what is the chance of guessing it (probability), and how to present the result (rounding to meaningful precision).


Tools discussed in this article

  • Variations with Repetition Calculator - count arrangements where repetition is allowed (n^k), compare with permutations, estimate brute-force cracking time
  • Probability Calculator - calculate event probability as fraction, percentage and odds in four modes: single, independent, union, repeated trials
  • Rounding Calculator - compare five rounding methods (standard, ceiling, floor, banker's, truncation) with error values

More math tools


Check for a specific value