Permutation and combination calculator (nPr, nCr) 소개
Combinations count the ways to pick r items from n when order doesn't matter: C(n, r) = n!/(r!(n − r)!). Permutations count each ordering separately, P(n, r) = n!/(n − r)!, so P(n, r) = C(n, r) × r!. When an item can be picked more than once, ordered picks number nʳ and unordered picks C(n + r − 1, r), the "stars and bars" count. Every answer is an exact whole number, up to 20,000 digits.
The default, 5 cards from 52, gives 2,598,960 poker hands, so one particular hand has a 1 in 2,598,960 chance. The same arithmetic gives 13,983,816 tickets in a 6-of-49 lottery, 720 podium orders from 10 runners and 10,000 four-digit PINs.
The chance of one outcome assumes every outcome is equally likely. Answers of 22 digits or more are shown in scientific notation, with every digit listed up to 300 digits.
자주 묻는 질문
What is the difference between a permutation and a combination?
A permutation counts orderings; a combination counts only which items are chosen. From 10 runners there are P(10, 3) = 720 ways to fill gold, silver and bronze, but only C(10, 3) = 120 different groups of three, because each group can be ordered in 3! = 6 ways. Use permutations for rankings, seatings and passwords, and combinations for hands, committees and lottery tickets.
How many 5-card poker hands are there?
There are C(52, 5) = 2,598,960 five-card hands from a standard 52-card deck, counting each set of cards once regardless of the order dealt. Only 4 of them are royal flushes, so the chance of being dealt one is 4 in 2,598,960, or 1 in 649,740. Counting ordered deals instead gives P(52, 5) = 311,875,200.
How are lottery jackpot odds calculated?
Multiply the number of combinations for each drawn set. A 6-from-49 draw has C(49, 6) = 13,983,816 possible tickets. Powerball draws 5 of 69 white balls and 1 of 26 red balls, so the jackpot odds are C(69, 5) × 26 = 11,238,513 × 26, or 1 in 292,201,338. Order doesn't matter in these games, which is why combinations apply.
How many 4-digit PIN combinations are there?
There are 10⁴ = 10,000 four-digit PINs, from 0000 to 9999, because each of the 4 positions can hold any of 10 digits. Strictly this is a permutation with repetition, since 1234 and 4321 are different codes; a "combination lock" is really a permutation lock. A 6-digit PIN has 10⁶ = 1,000,000 possibilities.
Why is 0! equal to 1?
0! = 1 by definition, because there is exactly one way to arrange zero items: the empty arrangement. The convention keeps the formulas consistent, so C(n, 0) = n!/(0! × n!) = 1 and C(n, n) = 1. It also matches the gamma function, where 0! = Γ(1) = 1, and the recursion n! = n × (n − 1)! at n = 1.
“Permutation and combination calculator (nPr, nCr)”의 정확도는 어느 정도인가요?
정확도는 입력값과 계산 방법의 가정에 따라 달라집니다. 십진 연산은 유효숫자 50자리를 사용하지만, 추정값·수치해석 방법·원본 데이터의 정밀도는 더 낮을 수 있습니다. 표시값을 반올림해도 이러한 한계는 사라지지 않습니다. 독립적인 출처의 풀이와 대조한 계산 예시: 9. 예를 들어 “5-card hands from 52 (defaults)”은 C(52,5) = 2,598,960 (Python math.comb; the standard count of poker hands)와 대조해 확인합니다.
이 계산 방법의 출처는 무엇인가요?
NIST Digital Library of Mathematical Functions, §26.3 Lattice paths: binomial coefficients and §26.2 permutations; Graham, Knuth & Patashnik, Concrete Mathematics, 2nd ed., chapter 5 (binomial coefficients).