Permutation Combination Online Calculator

statistical-calculators.site

Result
Permutations, nPr = n! / (n - r)!
= 0
Combinations, nCr = n! / r! × (n - r)!
= 0

Understanding Permutations and Combinations

Permutations and combinations are fundamental concepts in combinatorics, a branch of mathematics dealing with counting, both as a means and an end in obtaining results, and certain properties of finite structures.

Permutations (nPr)

A permutation is an arrangement of items in a specific order. When we talk about permutations, the order of selection matters.

For example, if we are selecting 'r' items from a set of 'n' distinct items, the number of ways to arrange these 'r' items is given by the permutation formula:

nPr = n! / (n-r)!

Where '!' denotes the factorial operation (e.g., 5! = 5 × 4 × 3 × 2 × 1).

This formula counts the number of different ordered arrangements possible.

Combinations (nCr)

A combination is a selection of items from a set where the order of selection does not matter.

For example, if we are choosing 'r' items from a set of 'n' distinct items, the number of ways to choose these items, irrespective of their order, is given by the combination formula:

nCr = n! / (r! × (n-r)!)

This formula counts the number of different unordered selections possible. It is essentially the number of permutations divided by r! (the number of ways to order the 'r' selected items).

Combinations and Permutations Online Calculator

Examples

Example 1: Awarding Medals (Permutation)

Problem: In a race with 10 athletes, how many different ways can gold, silver, and bronze medals be awarded?

Solution: Here, n = 10 (total athletes) and r = 3 (medals to be awarded). The order matters because giving Athlete A gold and Athlete B silver is different from giving Athlete B gold and Athlete A silver. So, we use permutations.

10P3 = 10! / (10-3)! = 10! / 7! = (10 × 9 × 8 × 7!) / 7! = 10 × 9 × 8 = 720.

There are 720 different ways to award the medals.

Example 2: Forming a Committee (Combination)

Problem: From a group of 10 people, how many different committees of 3 people can be formed?

Solution: Here, n = 10 (total people) and r = 3 (committee size). The order in which people are chosen for the committee does not matter (a committee of {Alice, Bob, Charlie} is the same as {Charlie, Alice, Bob}). So, we use combinations.

10C3 = 10! / (3! × (10-3)!) = 10! / (3! × 7!) = (10 × 9 × 8 × 7!) / ((3 × 2 × 1) × 7!) = (10 × 9 × 8) / (3 × 2 × 1) = 720 / 6 = 120.

There are 120 different committees that can be formed.

Example 3: Drawing Poker Hands (Combination)

Problem: How many different 5-card poker hands can be dealt from a standard deck of 52 playing cards?

Solution: Here, n = 52 (total cards in a deck) and r = 5 (cards in a hand). The order in which the cards are dealt into a hand does not matter. So, we use combinations.

52C5 = 52! / (5! × (52-5)!) = 52! / (5! × 47!) = (52 × 51 × 50 × 49 × 48) / (5 × 4 × 3 × 2 × 1) = 311,875,200 / 120 = 2,598,960.

There are 2,598,960 different 5-card hands possible.

How to Do This in Statistical Software

The same permutation and combination calculations can be reproduced directly in common statistical and programming environments. The examples below use the poker hands example above (n = 52, r = 5).

How to Do This in RStudio

R's base factorial() function, or the built-in choose() function for combinations directly:

n <- 52
r <- 5

# Permutations (nPr)
perm <- factorial(n) / factorial(n - r)
perm

# Combinations (nCr) - built-in function
comb <- choose(n, r)
comb
# 2598960

How to Do This in Python

Python's built-in math module includes both perm() and comb() directly (Python 3.8+):

import math

n = 52
r = 5

perm = math.perm(n, r)
comb = math.comb(n, r)

print(perm, comb)
# 311875200 2598960

How to Do This in SPSS

SPSS doesn't have a menu-based permutation/combination calculator, but both can be computed using the COMPUTE command with SPSS's built-in factorial function in the Syntax editor:

COMPUTE perm = FACT(52) / FACT(52-5).
COMPUTE comb = FACT(52) / (FACT(5) * FACT(52-5)).
EXECUTE.

How to Do This in JASP

JASP is built for statistical inference rather than combinatorial calculations, so it doesn't offer a dedicated nPr/nCr tool. For quick combinatorics work alongside your JASP analysis, R and Python (both shown above) or a dedicated calculator like this one remain the most direct options.

Related Statistical Calculators