« Back to Index

[Maths: variations/possible combinations]

View original Gist on GitHub

Tags: #math #factorials #exponents #power #raise

Maths: variations and possible combinations.md

Factorials

To identify the various combinations of a number or letter, you need to know the number of items.

So if you’re dealing with a string like “ABC”, that’s three characters.

So you would say 3! factorial.

Which really means: 3*2*1 = 6.

And the reason we multiply backwards from 3 specifically is because there were three characters to begin with.

So we know there are six potential combinations:

  1. ABC
  2. ACB
  3. BAC
  4. BCA
  5. CAB
  6. CBA

But what if you have 10 items?

10*9*8*7*6*5*4*3*2*1 = 3,628,800

You can see that even with a small number of items, the number of possible combinations becomes very large.

Exponents

An exponent is made up of two numbers: a “base” and a “power” (also referred to as an “exponent”, but I prefer “power” as it helps to distinguish the second number from the over-arching concept of exponents).

Typically the power is displayed as a superscript, but as that not always the easiest thing to type in different editors there is also a symbol to represent an exponent: ^.

3^4 = 3*3*3*3

Note: strictly speaking the small (superscript) number is the “exponent”, while the larger number is the “base”. The base multiplying itself a number times (specifically by whatever number the exponent is set to) will result in what’s called “raising to the power” (the “power” is the resulting number). – see https://en.wikipedia.org/wiki/Exponentiation