Skip to content
GATEiit

GATE DA · Probability and Statistics

Counting: permutations and combinations

Sum and product rules, permutations (with repetition, identical items, circular), combinations, stars and bars, and inclusion–exclusion; GATE asks direct counts and counts used inside probability questions.

Before you start

  • Factorials and basic algebra

    Every count is written as factorials or binomial coefficients and then simplified.

  • Sets and their operations →

    Inclusion–exclusion counts unions of sets; complements give the "at least one" trick.

This topic comes before: Data types; data transformation: normalization, discretization, sampling and compression, Introduction to graph theory, Marginal, conditional and joint probability; Bayes' theorem, Probability axioms, sample space, events, independent and mutually exclusive events, Random variables; discrete random variables and probability mass functions, Uniform, Bernoulli and binomial distributions

Concept notes

1. Sum rule and product rule

Sum rule: if a task can be done in one of m ways or one of n ways, with no overlap, there are m+n ways.

Product rule: if a task is a sequence of two stages, with m ways for the first and n ways for the second (whatever the first choice was), there are m×n ways.

Most GATE counts are a product of stage counts, split into cases with the sum rule when a restriction changes the count of a later stage.

  • Strings of length r over an alphabet of size n: nr.
  • 4-digit numbers with distinct digits: the first digit has 9 choices (no 0), then 9,8,7, giving 9⋅9⋅8⋅7=4536.

Complement trick: "at least one" is usually easiest as total minus "none". Fill the most restricted position first (here, the leading digit).

2. Permutations: order matters

A permutation is an ordered arrangement. The number of ways to arrange r of n distinct objects in a row is nPr=n!(n−r)!.

Situation Count
All n distinct objects in a row n!
r positions, repetition allowed nr
n objects with n1,n2,…,nk identical copies n!n1! n2!⋯nk!
n distinct objects round a circle (n−1)!
Circle where clockwise = anticlockwise (necklace) (n−1)!2, for n≥3

For a circle, fix one object to remove rotations, then arrange the rest.

Together / apart rules: to keep certain objects together, glue them into one block and multiply by the arrangements inside the block. To keep objects apart, first arrange the others, then place the restricted ones in the gaps between them (the gap method).

3. Combinations: order does not matter

A combination is a selection where order is ignored. The number of ways to choose r of n distinct objects is (nr)=n!r! (n−r)!=nPrr!.

Useful identities:

  • (nr)=(nn−r) (choosing who is in = choosing who is out).
  • Pascal: (nr)=(n−1r−1)+(n−1r) (the first object is in or out).
  • ∑r=0n(nr)=2n (number of subsets).

Permutation or combination? Ask whether swapping two chosen items gives a different outcome. A committee of 3: no, so combination. President, secretary, treasurer: yes, so permutation. Selecting then arranging is (nr)⋅r!=nPr.

For restrictions such as "at least 2 women", either add the cases (exactly 2, exactly 3, …) or subtract the bad cases from the total. Never fix "one woman first" and then choose the rest freely: that counts some committees more than once.

4. Stars and bars: identical objects into distinct boxes

The number of ways to put n identical objects into r distinct boxes (boxes may be empty) equals the number of non-negative integer solutions of x1+⋯+xr=n: (n+r−1r−1). Write the objects as n stars and separate boxes with r−1 bars; choose which of the n+r−1 positions hold bars.

  • Each box at least one: substitute yi=xi−1, giving (n−1r−1).
  • Lower bound x1≥a: substitute y1=x1−a and solve with total n−a.
  • Selecting n items from r types with repetition (order ignored) is the same count, (n+r−1n).

Upper bounds (xi≤c) need inclusion–exclusion: subtract the solutions where some xi≥c+1.

x1 = 2x2 = 1x3 = 36 stars, 2 bars
Stars and bars: the solution (2, 1, 3) of x1 + x2 + x3 = 6 is one arrangement of 6 stars and 2 bars

5. Inclusion–exclusion and derangements

Inclusion–exclusion counts a union by correcting overlaps: ∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣. Example: among 1 to 1000, multiples of 3, 5 or 7 number 333+200+142−66−47−28+9=543 (use ⌊1000/k⌋ for each term).

A derangement is a permutation with no element in its own place (no letter in its correct envelope). By inclusion–exclusion, Dn=n!∑k=0n(−1)kk!,Dn=(n−1)(Dn−1+Dn−2). Values: D1=0, D2=1, D3=2, D4=9, D5=44. The fraction Dn/n! approaches 1/e≈0.368.

Formulas to remember

Permutations
nPr=n!(n−r)!
Combinations
(nr)=n!r! (n−r)!
Arrangements with identical itemsn1+⋯+nk=n
n!n1! n2!⋯nk!
Circular arrangementsDivide by 2 more if flipping gives the same arrangement
(n−1)!
Stars and bars (non-negative solutions)x1+⋯+xr=n, xi≥0
(n+r−1r−1)
Stars and bars (positive solutions)xi≥1
(n−1r−1)
Pascal's rule
(nr)=(n−1r−1)+(n−1r)
Derangements
Dn=n!∑k=0n(−1)kk!

Common mistakes

  • Using nPr when the order of the chosen items does not matter (a committee, a hand of cards); divide by r!.
  • Counting "at least one" by fixing one item first and choosing the rest freely; this counts the same selection several times. Use total minus none.
  • Treating identical objects as distinct (or the reverse); stars and bars is only for identical objects into distinct boxes.
  • Using n! for a round table instead of (n−1)!, or forgetting the extra division by 2 for necklaces.
  • Forgetting to remove the leading zero when counting numbers of a given number of digits.

Worked examples

Try each step yourself, then reveal the working.

Example 1: Arranging BANANA

numerical

How many distinct arrangements of the letters of BANANA are there? In how many of them are no two A's adjacent?

  1. Step 1: Count the letters and the repeats.

    Try it on paper first.

Example 2: Committee with at least two women

numerical

A committee of 5 is chosen from 6 men and 4 women. In how many ways can it have at least 2 women?

  1. Step 1: Find the total with no restriction.

    Try it on paper first.

Example 3: Distributing identical sweets

numerical

In how many ways can 10 identical sweets be given to 3 children (a) if a child may get none, (b) if each child gets at least one?

  1. Step 1: Set up the equation.

    Try it on paper first.

Example 4: Permutation or combination?

conceptual

From 8 students, (i) a captain and a vice-captain are chosen, (ii) a pair is chosen to attend a seminar. Which is a permutation count and which a combination count?

  1. Step 1: Swap the two chosen students. Does the outcome change?

    Try it on paper first.

Previous year questions

3 official GATE DA questions on this topic, newest first.

Practise these 3 PYQs →

Topic test

10 questions: up to 3 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE DA syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.