# Common Math Formulas

A collection of various math formulas I commonly encounter for quick reference.

## Logarithm

The logarithm of a number is the exponent to which some fixed value (the base) is raised to produce a number. For example, if you have a base 10, what is the logarithm of 100,000? The answer is 5, since $10^5 = 100,000$. This is usually written $\log_{10} 100,000 = 5$. Base 10 is referred to as the common logarithm.

### Natural Logarithm

The natural logarithm (ln) uses the irrational number $e$ (~2.718) as the base. So the natural logarithm of some number $x$ can be written as $\ln x$ or $\log_e x$.

### Discrete Logarithm

A discrete logarithm is some integer $k$ such that $x^k = y$ where both $x$ and $y$ are elements of a finite set. Essentially, a discrete logarithm is a logarithm in a finite group.

## Modular Arithmetic

Suppose $a$ and $b$ are integers and $m$ is a positive integer. Then $a \equiv b($mod $m)$ if $m$ divides $b - a$. The phrase $a \equiv b($mod $m)$ is called a congruence and is read “$a$ is congruent to $b$ modulo $m$”. The $m$ integer is called the modulus.

We use the notation $a$ mod $m$ (without paranthesis) to denote the remainder when $a$ is divided by $m$.

$a \equiv b($mod $m)$ if and only if $a$ mod $m = b$ mod $m$.

Examples:

• 101 mod 7 = 3, where 101 = 7 x 14 + 3
• -101 mod 7 = 4, where 101 = 7 x -15 + 4

### Addition and Multiplication in Modular Arithmentic

11 x 13 in modulo 16 is taking 11 x 13 = 143 and reducing by modulo 16. So 143 = 8 x 16 + 15 so 143 mod 16 = 15. A similar method is used for addition.

See here.

See here.

## Binomial Coefficient

Denotes the number of ways of choosing a subset of $k$ objects from a set of $n$ objects:
$\binom{n}{k} = n!/(k!(n-k)!)$

## Probability

See here. 