< Home

Discrete Maths

Dividability

Def:

If there exists kZk \in \mathbb{Z}, such that b=akb = ak for a,bZa, b \in \mathbb{Z}, we write aba \mid b (read as "aa divides bb").

If no such kk exists, we write aba \nmid b (aa does not divide bb)

Ex: 5255 \mid 25, but 5265 \nmid 26

If aba \mid b, then kk is the quotient

If aba \nmid b, there exists rr and qq in the integers, such that b=aq+rb = aq + r, where rr is the remainder.

Note: abbaa \mid b \neq \frac{b}{a}

Mathematical version: abkZ:b=ak a \mid b \Leftrightarrow \exists k \in \mathbb{Z}: b = ak

Examples

a0a \mid 0 -> True 000 \mid 0 -> True 0b0 \mid b -> True if b=0b = 0

Theory

For a,b,m,n,cZa, b, m, n, c \in \mathbb{Z}, if cac \mid a and cbc \mid b, then c(ma+nb)c \mid (ma + nb)

Factors

How many factors does 144144 have?

There are a few ways to find out:

Prime Factorisation of 144144: 24322^4 * 3^2
We can combine them such that we get all of the factors:

Using this method, we can count the number of factors and we'll get the product of one more than each exponent in the prime factorisation.
Since 144=2432144 = 2^4 * 3^2, the number of factors is 53=155 * 3 = 15.

Example

Find the number of factors for (1024)(144)(10000000)(1024)(144)(10 000 000)

We must first break it down into the prime factorisation. We can either multiply them together first and have a large and complex number, or we can get the factorisations first and make it much easier:

1024=2101024 = 2^{10}
144=2332144 = 2^3 3^2
10000000=572710 000 000 = 5^7 2^7 (1024)(144)(10000000)=(210)(2332)(5727)=2215732(1024)(144)(10 000 000) = (2^{10})(2^3 3^2)(5^7 2^7) = 2^{21} 5^7 3^2

Now that we have the prime factorisation, we can add one to each exponent and find the product to get the number of factors:

2283=52822 * 8 * 3 = 528

Thus, (1024)(144)(10000000)(1024)(144)(10 000 000) has 528528 factors.

Prime Numbers

An integer p>1p > 1 is called prime if it is not divisible by an integer ±1\pm 1 or ±p\pm p, otherwise it is called composite

Note: 11 is considered neither prime nor composite

Is 43214321 prime?

We need to check all potential factors. To do this, we must check only up to 4321=65 \left \lfloor \sqrt{4321} \right \rfloor = 65

Now we can check each number.

| Check | If the number we check is not a multiple, then neither are... | | 22 | 4,6,8,,644, 6, 8, \dots , 64 | | 33 | $9, 15, 21, \dots $ | | 44 | This was covered by 22 | | 55 | $25, 35, 45, \dots $ | | \dots | | | 2929 | 29432129 \mid 4321, so it is not prime. |

The Fundamental Theorem of Arithmetic

For every positive integer n2n \ge 2, nn can be written as a product of one or more primes

Note: This is also known as prime factorisation

Proof by Strong Induction

BC: let n=2n = 2 22 is prime, thus, P(2)P(2) holds.

IH: Assume P(k)P(k) holds for integer k=3,4,5,,nk = 3, 4, 5, \dots, n

IS: Consider n+1n + 1. There are two cases:

  1. n+1n + 1 is prime, thus we are done.
  2. n+1n + 1 is composite, then n+1=abn + 1 = ab for some positive integers a,ba, b such that a<n+1a < n + 1 and b<n+1b < n + 1. By IH, both aa and bb can be written as a product of primes. Thus abab is a product of primes.

Theorem: There are infinitely many primes

Proof

Suppose for a contradiction that there are finitely many primes.
List them: P1,P2,P3,,PnP_1, P_2, P_3, \dots, P_n nZ+n \in \mathbb{Z}^+

let q = P1P2P3Pn+1P_1*P_2*P_3*\dots*P_n + 1 i=1n(Pi)+1 \prod_{i=1}^n (P_i) + 1

PiqP_i \nmid q for any i=1,2,,ni = 1, 2, \dots, n

Thus, qq is prime, but q=Piq = P_i for i=1,2,,ni = 1, 2, \dots, n therefore, qq is not in the list of all primes, a contradiction. Thus, there are infinitely many primes.

Proofs by Contradictions

  1. Argue the hypothesis holds
  2. Negate the conclusion
  3. Break Maths

Example

Prove that 2\sqrt{2} is irrational

Proof:

AFAC (Assume for a contradiction) that 2\sqrt{2} is rational. Then, for some a,bZa, b \in \mathbb{Z}, 2=ab\sqrt{2} = \frac{a}{b} such that aa and bb have no common factors(This is true of all fractions, due to simplification)

This contradicts that aa and bb have no common factors, thus 2\sqrt{2} is irrational.

Greatest Common Denominator

Theorem 1

If aba \mid b, then gcd(a,b)=a\gcd(a, b) = a

Proof:

let gcd(a,b)=d\gcd(a, b) = d
Since aba \mid b and aaa \mid a, aa is a common divisor of aa and bb.
Thus, ada \le d. Since dad \mid a, dad \le a.
Therefore, dada=dd \le a \le d \Rightarrow a = d

Theorem 2

gcd(a,b)=gcd(a,b1)\gcd(a, b) = \gcd(a, b - 1) if aba \le b

Proof: let d1=gcd(a,b)d_1 = \gcd(a, b), d2=gcd(a,ba)d_2 = \gcd(a, b - a)

Since d1ad_1 \mid a and d1b1d_1 \mid b_1, k1,k2Z\exists k_1, k_2 \in \mathbb{Z}
such that a=d1k1a = d_1 k_1 and b=d1k2b = d_1 k_2. Then ba=d1k2d1k1=d[k2k1]b - a = d_1 k_2 - d_1 k_1 = d\left[k_2 - k_1\right]
d1[ba]\Rightarrow d_1 \mid \left[b - a\right]
Since d1ad_1 \mid a and d1[ba]d_1 \mid \left[b - a\right], d1d2d_1 \le d_2

Since d2ad_2 \mid a and d2[ba]d_2 \mid \left[b - a\right], k3,k4Z\exists k_3, k_4 \in \mathbb{Z} such that a=d2k3a = d_2 k_3 and ba=d2k4b - a = d_2 k_4
Then b=ba+a=d2k4+d2k3=d2[k4+k3]b = b - a + a = d_2 k_4 + d_2 k_3 = d_2 \left[k_4 + k_3 \right]
d2b\Rightarrow d_2 \mid b
Since d2ad_2 \mid a and d2b1d_2 \mid b_1, d2d1d_2 \le d_1
Thus, d1d2d1d1=d2d_1 \le d_2 \le d_1 \Rightarrow d_1 = d_2

Theorem 3

gcd(a,b)=gcd(a,r)\gcd(a, b) = \gcd(a, r) where b=ma+rb = ma + r, 0ra0 \le r \le a