๐ŸŽฒ

Combination & Permutation Calculator

Calculate combinations C(n,r), permutations P(n,r), and factorials n! with step-by-step solutions.

MATHEMATICS

The Combination and Permutation Calculator computes C(n,r), P(n,r), and factorial with solution steps.

Uses BigInt for accurate calculations up to 170!. Includes an interactive Pascal's triangle, real-world examples (lottery, PIN, teams), and an explanation of when to use combinations vs. permutations.

Permutation & Combination Calculator

Calculate permutations, combinations, and factorials with step-by-step solutions and Pascal's triangle.

Kombinasi C(n, r)
C(n, r) = n! / (r! ร— (nโˆ’r)!)
Contoh Soal Nyata
Lotere 6 dari 49
Berapa peluang menebak 6 angka dari 49 angka (tidak peduli urutan)?
1 dari C(49,6) kemungkinan โ€” odds sangat kecil!
Pilih Anggota Tim
20 karyawan, pilih 5 untuk proyek tanpa mempedulikan posisi.
C(20,5) = 15.504 cara membentuk tim.
Pilih Menu
Restoran punya 8 menu, kamu pilih 3. Berapa pilihan berbeda?
C(8,3) = 56 kombinasi menu.

Referensi: Permutasi vs Kombinasi

Gunakan Permutasi โ€” jika URUTAN penting
Contoh: nomor antrian, password, juara lomba (1st/2nd/3rd berbeda), susunan huruf. P(n,r) selalu โ‰ฅ C(n,r) karena memperhitungkan urutan.
Gunakan Kombinasi โ€” jika URUTAN tidak penting
Contoh: pilih anggota panitia, pilih menu, pilih angka lotere, pilih soal ujian. C(n,r) = P(n,r) / r! karena tiap grup dihitung sekali.
Sifat Penting Kombinasi: C(n,r) = C(n, nโˆ’r)
Memilih 3 dari 10 sama banyaknya dengan memilih 7 dari 10 (yang tidak terpilih). Berguna untuk menyederhanakan perhitungan besar.
Segitiga Pascal & Binomial
Nilai C(n,r) membentuk Segitiga Pascal. Juga merupakan koefisien binomial dalam (a+b)^n. Baris ke-n = koefisien ekspansi (a+b)^n.
Rumus Ringkas:
  • P(n, r) = n! / (nโˆ’r)! โ€” Permutasi r dari n
  • C(n, r) = n! / (r! ร— (nโˆ’r)!) โ€” Kombinasi r dari n
  • C(n, r) = P(n, r) / r! โ€” Hubungan P dan C
  • 0! = 1 โ€” Berdasarkan definisi
  • P(n, n) = n! โ€” Semua elemen disusun
  • C(n, 0) = C(n, n) = 1 โ€” Pilih 0 atau semua = 1 cara

Calculator information

How to use this calculator

  1. Enter the total number of elements n (size of the set) and the number of elements to choose r.
  2. Choose the type: combination C(n,r) if order doesn't matter, or permutation P(n,r) if order matters.
  3. For pure factorial, use 'n!' mode and enter n (0-170 supported with BigInt).
  4. Click Calculate for the result plus a step-by-step solution with factorial expansion and simplification.
  5. Explore the interactive Pascal's triangle to see C(n,r) values laid out visually.
  6. Read real-world examples (ATM PIN, team lineup, lottery) to learn when to use combinations vs. permutations.
  7. Mnemonic tip: 'P needs order, C just selects'; C(n,r) โ‰ค P(n,r) because order is ignored.

Combinations, Permutations, Factorials

C(n,r) = n! / (r!(n-r)!) ; P(n,r) = n! / (n-r)!
  • n! = n ร— (n-1) ร— (n-2) ร— ... ร— 2 ร— 1, with 0! = 1
  • Constraints: 0 โ‰ค r โ‰ค n, n and r non-negative integers
  • Property: C(n,r) = C(n,n-r) (symmetry)
  • P(n,r) = r! ร— C(n,r)
  • Circular permutations: (n-1)! ; permutations with repetition: n^r

For large n, use Stirling's approximation: n! โ‰ˆ โˆš(2ฯ€n) ร— (n/e)^n.

Worked example: Pick 3 people from 10 for a team (combination) vs. 1st-2nd-3rd place (permutation)

Given:
  • n = 10, r = 3
Steps:
  1. Permutation (order matters, 1st-2nd-3rd are distinct): P(10,3) = 10!/(10-3)! = 10!/7! = 10 ร— 9 ร— 8 = 720.
  2. Combination (order doesn't matter, 3-person team): C(10,3) = 10!/(3!ยท7!) = 720/6 = 120.
  3. Verification: C(10,3) = P(10,3)/3! = 720/6 = 120 โœ“.
  4. Interpretation: 720 distinct podium orderings, but only 120 unique team compositions.

Result: P(10,3) = 720 orderings; C(10,3) = 120 teams. Difference factor: 3! = 6 (orderings per team).

Frequently asked questions

When should I use combinations vs. permutations?
Use PERMUTATIONS when order changes the outcome: ATM PIN (1234 โ‰  4321), race rankings (gold/silver/bronze), seating arrangements, passwords. Use COMBINATIONS when order doesn't matter: choosing a team (Alice-Bob-Carol = Carol-Bob-Alice), lottery numbers (45-12-7 same as 7-12-45), pizza topping selections. Quick test: 'do AB and BA count as the same?' If yes -> combination.
What are the odds of winning Powerball?
Powerball requires picking 5 white balls from 69 and 1 red Powerball from 26: C(69,5) ร— 26 = 11,238,513 ร— 26 = 292,201,338 combinations. The odds of hitting the jackpot with one ticket are about 1 in 292 million. For comparison, the lifetime odds of being struck by lightning in the U.S. are about 1 in 15,300 (NWS). Understanding these probabilities is essential for statistical literacy and recognizing the math behind gambling.
How many 8-character passwords are possible?
With 95 printable ASCII characters (upper/lowercase letters + digits + symbols), there are 95^8 = 6.6 ร— 10^15 combinations. A modern computer at 1 billion guesses per second needs 76 days to brute-force. With 12 characters that jumps to 5.4 ร— 10^23 = 17,000 years. NIST SP 800-63B recommends passwords of at least 8 characters from a broad set, or passphrases of 4 random words (~44 bits of entropy).
What is Pascal's triangle and what is it used for?
Pascal's triangle is a triangular arrangement where each number equals the sum of the two numbers above it. Row n contains C(n,0), C(n,1), ..., C(n,n). Applications: binomial coefficients in (a+b)^n, Sierpinski fractals (color odd numbers), probabilities in the binomial distribution, and discrete combinatorics. Notable patterns: row n sums to 2^n; the second diagonal lists the triangular numbers.
How do I compute 100! without overflow?
100! โ‰ˆ 9.33 ร— 10^157 - far beyond a 64-bit integer (max 9.22 ร— 10^18) or a double-precision float (accurate to ~17 significant digits). Solution: use BigInt (arbitrary precision) in JavaScript/Python, or BigInteger in Java. For a fast estimate, Stirling: 100! โ‰ˆ โˆš(200ฯ€) ร— (100/e)^100 with under 1% error. 170! is the upper bound for IEEE 754 double (Number.MAX_VALUE).

Last updated: May 11, 2026