Permutations and combinations are the mathematical foundation for counting possibilities, and they underpin probability theory, statistics, cryptography, genetics, and logistics. The key distinction is whether order matters. When order matters, you use permutations. When only the selection matters and order is irrelevant, you use combinations. The Powerball lottery, which draws 5 white balls from 69 and 1 red Powerball from 26, is a classic combination problem: C(69,5) x C(26,1) = 292,201,338 possible outcomes, making the jackpot odds approximately 1 in 292 million. Whether you are calculating lottery odds, assessing password security, or determining how many ways a team can be assembled, these formulas provide exact answers.
What This Calculator Does
Enter n (the total number of items available) and r (the number of items you want to select or arrange). The calculator computes both the permutation P(n,r) and combination C(n,r) simultaneously, along with the factorials used in each calculation.
For related math tools, try our Probability Calculator for calculating event probabilities, or our Factorial Calculator for computing factorials individually. You can also use our Statistics Calculator for broader data analysis.
Inputs Required
- n: The total number of distinct items in the set
- r: The number of items to select or arrange (r must be less than or equal to n)
Outputs Provided
- P(n,r): Number of permutations (order matters)
- C(n,r): Number of combinations (order does not matter)
- Factorials: n!, r!, and (n-r)! where applicable
How the Calculation Works
Both formulas use factorials. The factorial of a number n (written n!) is the product of all positive integers from 1 to n. For example, 5! = 5 x 4 x 3 x 2 x 1 = 120.
Permutation: P(n,r) = n! / (n-r)!
Combination: C(n,r) = n! / (r! x (n-r)!)
The combination formula divides the permutation result by r! to remove duplicate arrangements of the same group. For example, choosing {A, B, C} from a set is the same combination whether you pick A first, B first, or C first. The r! factor removes all those equivalent orderings.
How to Use the Calculator
- Enter n, the total number of items in your set
- Enter r, the number of items you want to select or arrange
- Read P(n,r) for order-sensitive problems and C(n,r) for selection problems
- Review the factorials shown to understand how the result was derived
Example Calculations
Arranging Books on a Shelf
How many ways can you arrange 3 books chosen from a shelf of 10? n = 10, r = 3. P(10,3) = 10! / 7! = 10 x 9 x 8 = 720 arrangements. If you simply need to choose 3 books to take on a trip (order does not matter), C(10,3) = 10! / (3! x 7!) = 720 / 6 = 120 selections. There are 720 ordered arrangements but only 120 distinct groups because each group of 3 can be arranged in 3! = 6 different orders.
Powerball Lottery Odds
Powerball draws 5 white balls from 69 and 1 red Powerball from 26. The white ball selection is a combination (order does not matter): C(69,5) = 69! / (5! x 64!) = 11,238,513. The red Powerball is independent: C(26,1) = 26. Total combinations: 11,238,513 x 26 = 292,201,338. Your odds of winning the jackpot are 1 in 292,201,338. The overall odds of winning any prize (from $4 to the jackpot) are approximately 1 in 24.87.
Real-World Scenarios
Password Security Assessment in San Francisco
A security engineer at a fintech startup in San Francisco is evaluating PIN-based authentication for a mobile app. The system uses a 6-digit PIN from digits 0 through 9, where each digit can only be used once and order matters. This is a permutation: P(10,6) = 10! / 4! = 151,200 possible PINs. She compares this to a standard 4-digit PIN with repetition allowed: 10^4 = 10,000 possible PINs. The 6-digit no-repeat system offers 15 times more combinations. However, she notes that for true security analysis, the relevant metric is entropy, and she recommends a minimum of 6 digits with repetition allowed (10^6 = 1,000,000 combinations) for consumer-facing apps.
Lottery Odds Comparison in Miami
A statistics student in Miami is comparing lottery games for a probability class project. Powerball requires choosing 5 of 69 white balls plus 1 of 26 red balls: C(69,5) x 26 = 292,201,338 combinations, for jackpot odds of 1 in 292 million. Mega Millions requires choosing 5 of 70 white balls plus 1 of 25 gold balls: C(70,5) x 25 = 302,575,350 combinations, for jackpot odds of 1 in 302.6 million. She uses the calculator to demonstrate that Mega Millions has slightly worse jackpot odds than Powerball, though both are astronomically unlikely. Her professor uses this example to discuss expected value: even with a $1 billion jackpot, the expected value of a $2 ticket remains negative after accounting for taxes, lump sum reduction, and shared jackpot probabilities.
Team Assembly for a Project in Seattle
A project manager at a tech company in Seattle needs to form a 4-person task force from a pool of 12 engineers. The order of selection does not matter, only who is chosen. C(12,4) = 12! / (4! x 8!) = 495 possible teams. However, if the task force has distinct roles (lead, backend, frontend, QA), order matters and the calculation becomes P(12,4) = 12! / 8! = 11,880 possible assignments. The calculator shows both values, helping the manager understand why role-based assignments create far more possibilities than simple team selection.
Common Mistakes to Avoid
- Using permutations when order does not matter: If the problem asks how many groups or committees can be formed, use combinations. Permutations overcount by treating each rearrangement as a different result. For example, C(10,3) = 120 but P(10,3) = 720, a 6x difference
- Forgetting that 0! = 1: The factorial of zero is defined as 1, not 0. This is required for the formulas to work correctly when r = n or r = 0. Without this convention, C(n,n) would be undefined, but the correct answer is 1 (there is only one way to choose all n items from n items)
- Allowing r to exceed n: You cannot choose more items than are available. P(n,r) and C(n,r) are zero when r is greater than n
- Confusing with replacement: These formulas apply to sampling without replacement. If items can be repeated, different counting rules apply: permutations with repetition = n^r, and combinations with repetition = C(n+r-1, r)
- Overlooking factorial growth: Factorials grow extremely fast. 20! is already over 2 quadrillion (2,432,902,008,176,640,000). Even modest values of n produce enormous results, which is why this calculator uses BigInt arithmetic for exact large-number calculations
Limitations of This Calculator
This calculator computes standard permutations P(n,r) and combinations C(n,r) for sampling without replacement. It does not handle permutations with repetition (n^r), combinations with repetition (C(n+r-1, r)), or partial permutations with replacement. It does not compute multinomial coefficients or Stirling numbers. The calculator uses BigInt arithmetic to handle large factorials without floating-point rounding errors, but extremely large inputs (n above 1000) may produce results too large to display meaningfully. For probability calculations that require dividing combinations by total outcomes, use the Probability Calculator for the final step. This tool provides the raw counts, not the associated probabilities.
Authoritative Research and Resources
- Powerball Official Prize Chart and Odds - The official Powerball website with prize structures, odds for all 9 prize tiers, and the current jackpot. The overall odds of winning any prize are 1 in 24.87, with jackpot odds of 1 in 292,201,338.
- NIST Dictionary of Algorithms and Data Structures: Permutations and Combinations - The National Institute of Standards and Technology maintains a reference dictionary defining permutations, combinations, and factorial operations with formal mathematical notation and algorithmic implementations.
- Khan Academy: Counting, Permutations, and Combinations - A free educational resource covering the fundamental counting principle, permutations, combinations, and probability applications with worked examples and interactive exercises.