Interview Q&A / Data Science

BeginnerQuick answer1 min readUpdated 3 Oct 2026

What is the difference between permutations and combinations?

SHORT ANSWER

Permutations count arrangements where order matters; combinations count selections where order does not. Choosing r from n gives nPr = n!/(n-r)! ordered ways and nCr = n!/(r!(n-r)!) unordered ways.

Explain it simply

Picking a team captain, vice-captain and wicketkeeper from 10 players is a permutation: giving Rohit the captaincy and Virat the vice-captaincy is different from the other way round. Picking 3 players for a committee is a combination: the same three people form the same committee in any order.

Every group of 3 can be arranged in 3! = 6 orders, so permutations = combinations x 6.

Example

  • Ordered, 3 roles from 10 people: 10 x 9 x 8 = 720
  • Unordered, a 3-person committee: 720 / 6 = 120
python
import math
print(math.perm(10, 3))  # 720
print(math.comb(10, 3))  # 120

Link to probability: if 3 people are picked at random from the 10 and you want a particular trio, the chance is 1/120.

What to say in the interview

"If order matters, such as rankings, passwords or seating, I use permutations, nPr. If it does not, such as choosing a committee or a hand of cards, I use combinations, nCr. A quick check is whether swapping two chosen items gives a different result."

Common mistakes

  • Using combinations for passwords or PINs. Order matters there, and repeats may be allowed, which changes the formula again.

#permutation#combination#probability

Related questions

Practise more Data Science questions

Test your recall with short answers, then return to the detailed explanations when you need context.

Open Data Science quick answers →

Get new questions like this by email

One short email when something new and useful lands. No spam, unsubscribe in one tap.

By subscribing you agree to the Privacy Policy.