Four ways of selecting items

Say someone is given a bag containing three condiments:

  • A: pepper
  • B: salt
  • C: sugar

In how many ways can they select two sweets? We can follow different principles.

  • Order matters means whether we count and as different elements.
  • Repetition allowed means whether we allow elements to pair with themselves, e.g. , , .
HeaderOrder matters?Repetition allowed?Result
AAB, AC, BA, BC, CA, CB
BAA, AB, AC, BA, BB, BC, CA, CB, CC
CAB, AC, BC
DAA, AB, AC, BB, BC, CC

In summary:

Order matters
permutations
Order doesn’t matter
combinations
Repetitions
not allowed

Repetitions
allowed

Where is the total number of items, is the number of items we want to select.

Order matters, repetition not allowed

Order matters, repetition not allowed

How many ways can we select persons from a group of people to stand in line for a photo shoot? There are:

  • ways to select the first person
  • ways to select the second person
  • and so on until the ways to select the th person

So, using the product rule, we find that:

There is a special case when :

Link to original

Order matters, repetition allowed

Order matters, repetition allowed

How many words of length can be formed from the letters of an letter alphabet?

  • There are ways to select the first letter.
  • ways to select the second.
  • ways to select the th letter.

So by the product rule, the overall number is:

Link to original

Order does not matter, repetition not allowed

Order does not matter, repetition not allowed

How many ways can we select persons from a group of people if the order of selection does not matter?

  • As seen before, if the order of selection matters, there are ways.
  • But then for each set of people, we counted the the people in the number of ways persons can be ordered. ()
  • So, if the selection order does not matter, then the number of ways is: This leaves us with the binomial coefficient equation.
Link to original

Order does not matter, repetition allowed

Order does not matter, repetition allowed

Given we have an unlimited supply of types of fruit:

  • A: apples
  • O: oranges
  • P: peaches

How many ways are there to select pieces of fruit, if the order of selection does not matter, only the type of fruit / not the individual piece matters?

We could consider a box which can store 4 pieces of fruit, the box can have 3 compartments, each can store one of 3 types of fruit. Compartments are divided by 2 movable dividers that can be shifted depending on how many types of each fruit we want to store. For example:

  • 2 apples, 1 orange, 1 peach:
  • 4 oranges:
  • 1 apple, 3 peaches:
  • 4 apples:

So if we have to choose objects from a set of objects, with repetition allowed, we need a box with places for the chosen object and places for the dividers dividing the box into compartments.

Given any random box: , we have places.

The number of ways we can choose our objects is the number of ways we can distribute the dividers in the box. Out of the places, we hace to choose for the dividers. The number of ways of doing this is:

This formula should be remembered!

Going back to the example, we find that:

Link to original