Mathematical Cheatsheet
==
# General Mathematics
## Quadratic equation
Given a quadratic equation of form : $ax^2+bx+c = 0$
We compute the determinant :
$$\Delta = b^2-4ac$$
If $\Delta >= 0$ then the quadratic equation admits 2 solutions :
$$x = {-b \pm \sqrt{\Delta} \over 2a}$$Else, if $\Delta = 0$ then the quadratic equation admits only 1 solution :
$$x = {-b \over 2a}$$If $\Delta < 0$ then the quadratic equation admits no solutions in $\Bbb{R}$ but in $\Bbb{C}$ we have :
$$x = {-b \pm i\sqrt{-\Delta} \over 2a}$$
## Cubic equation
## Sums and Products
$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$
$\sum_{i=0}^n i = \frac{n(n+1)}{2}$
- Telescopic sum.
$\sum_{i=p}^q (a_{i+1}-a_{i}) = (a_{q+1}-a_{p})$
- Telescopic products.
$\prod_{i=p}^q \frac{a_{i+1}}{a_{i}} = \frac{a_{q+1}}{a_{p}}$
- Newton's Factorisation.
for(a,b) in $\Bbb{R}$ and n in $\Bbb{N}$
$(a+b)^{n} = \sum_{k=0}^n\dbinom{n}{k}a^{k}b^{n-k}$
- Factorisation
$a^{n+1}-b^{n+1} = (a-b)\sum_{k=0}^n a^{k}-b^{n-k}$
## Complex numbers
For z in $\Bbb{C}$
$z = x + iy$
$x = Re(z)$ and $y = Im(z)$
### Additions and Multiplications.
$z+z' = (x+x')+i(y+y')$
$zz' = (xx'-yy') + i(xy'+ yx')$
$\lvert z \rvert$ = $\sqrt{Re(z)^{2}+Im(z)^{2}}$
$\lvert z+z' \rvert$ $\leq$ $\lvert z \rvert$ + $\lvert z' \rvert$
# Modular Arithmetic
For a, b $\in$ $\Bbb{N}$
$a \equiv b \pmod p$ if and only if $a -b$ can be divided by p
In this case, k $\in$ $\Bbb{N}$ such that $a = b + kn$
## Euler's theorem
Given $n$ $\in$ $\Bbb{Z}$ and $a$ $\in$ $\Bbb{Z}$ with $gcd(a, n) = 1$ then
$${a^\phi(n)} \equiv 1 \pmod n$$
## Fermat's little theorem
Let a $\in$ $\Bbb{Z}$ and p a prime number
$${a^p} \equiv a \pmod p$$
## RSA
For $\forall$p, q $\in$ $\Bbb{N}$ (note : p and q have to be coprimes numbers)
$$n = p * q$$
## Discrete logarithm
# Linear algebra