< Home

Discrete Maths

Dividability

Def:

If there exists k∈Zk \in \mathbb{Z}, such that b=akb = ak for a,b∈Za, b \in \mathbb{Z}, we write a∣ba \mid b (read as "aa divides bb").

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

Ex: 5∣255 \mid 25, but 5∤265 \nmid 26

If a∣ba \mid b, then kk is the quotient

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

Note: a∣b≠baa \mid b \neq \frac{b}{a}

Mathematical version: a∣b⇔∃k∈Z:b=ak a \mid b \Leftrightarrow \exists k \in \mathbb{Z}: b = ak

Examples

a∣0a \mid 0 -> True 0∣00 \mid 0 -> True 0∣b0 \mid b -> True if b=0b = 0

Theory

For a,b,m,n,c∈Za, b, m, n, c \in \mathbb{Z}, if c∣ac \mid a and c∣bc \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: 24∗322^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=24∗32144 = 2^4 * 3^2, the number of factors is 5∗3=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:

22∗8∗3=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 | 29∣432129 \mid 4321, so it is not prime. |

The Fundamental Theorem of Arithmetic

For every positive integer n≥2n \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 n∈Z+n \in \mathbb{Z}^+

let q = P1∗P2∗P3∗⋯∗Pn+1P_1*P_2*P_3*\dots*P_n + 1 ∏i=1n(Pi)+1 \prod_{i=1}^n (P_i) + 1

Pi∤qP_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,b∈Za, 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 a∣ba \mid b, then gcd⁡(a,b)=a\gcd(a, b) = a

Proof:

let gcd⁡(a,b)=d\gcd(a, b) = d
Since a∣ba \mid b and a∣aa \mid a, aa is a common divisor of aa and bb.
Thus, a≤da \le d. Since d∣ad \mid a, d≤ad \le a.
Therefore, d≤a≤d⇒a=dd \le a \le d \Rightarrow a = d

Theorem 2

gcd⁡(a,b)=gcd⁡(a,b−1)\gcd(a, b) = \gcd(a, b - 1) if a≤ba \le b

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

Since d1∣ad_1 \mid a and d1∣b1d_1 \mid b_1, ∃k1,k2∈Z\exists k_1, k_2 \in \mathbb{Z}
such that a=d1k1a = d_1 k_1 and b=d1k2b = d_1 k_2. Then b−a=d1k2−d1k1=d[k2−k1]b - a = d_1 k_2 - d_1 k_1 = d\left[k_2 - k_1\right]
⇒d1∣[b−a]\Rightarrow d_1 \mid \left[b - a\right]
Since d1∣ad_1 \mid a and d1∣[b−a]d_1 \mid \left[b - a\right], d1≤d2d_1 \le d_2

Since d2∣ad_2 \mid a and d2∣[b−a]d_2 \mid \left[b - a\right], ∃k3,k4∈Z\exists k_3, k_4 \in \mathbb{Z} such that a=d2k3a = d_2 k_3 and b−a=d2k4b - a = d_2 k_4
Then b=b−a+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]
⇒d2∣b\Rightarrow d_2 \mid b
Since d2∣ad_2 \mid a and d2∣b1d_2 \mid b_1, d2≤d1d_2 \le d_1
Thus, d1≤d2≤d1⇒d1=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, 0≤r≤a0 \le r \le a