0% found this document useful (0 votes)
22 views7 pages

CIS 1600 Lecture 5

CIS 1600 Lecture 5

Uploaded by

krrishapatel26
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views7 pages

CIS 1600 Lecture 5

CIS 1600 Lecture 5

Uploaded by

krrishapatel26
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Mathematical Foundations of Computer Science

Lecture Outline
September 10, 2024

The unique factorization theorem states that every positive number can be uniquely repre-
sented as a product of primes. More formally, it can be stated as follows.

Given any integer n > 1, there exist a positive integer k, distinct prime numbers
p1 , p2 , . . . , pk , and positive integers e1 , e2 , . . . , ek such that

n = pe11 pe22 pe33 · · · pekk

and any other expression of n as a product of primes is identical to this except,


perhaps, for the order in which the factors are written.

Example. Prove that 2 is irrational using the unique factorization theorem.

Solution. Assume for the purpose of contradiction that 2 is rational. Then there are
integers a and b (b 6= 0) such that
√ a
2=
b
Squaring both sides of the above equation gives

a2
2 =
b2
a2 = 2b2

Note that since 1 < 2 < 2, we can assume that a > 1 and b > 1. Let S(m) be the sum
of the number of times each prime factor occurs in the unique factorization of m. Note
that S(a2 ) and S(b2 ) is even. Why? Because the number of times that each prime factor
appears in the prime factorization of a2 and b2 is exactly twice the number of times that
it appears in the prime factorization of a and b. Then, S(2b2 ) = 1 + S(b2 ) must be odd.
This is a contradiction as S(a2 ) is even and the prime factorization of a positive integer is
unique.

Example. Prove or disprove that the sum of two irrational numbers is irrational.

Solution.
√ The above statement is false. Consider the two irrational numbers, 2 and
− 2. Their sum is 0 = 0/1, a rational number.

Example. Show that there exist irrational numbers x and y such that xy is rational.
2 Lecture Outline September 10, 2024


√ √ 2
Solution. We know that 2 is an irrational number. Consider 2 .
√ √2
Case I: 2 is rational. √
In this case we are done by setting x = y = 2.

√ 2
Case II: 2 is irrational.
 √ √2
√ √2 √ y
√ 2 √
In this case, let x = 2 and let y = 2. Then, x = 2 = ( 2)2 = 2, which is
an integer and hence rational.

Example. Prove that for all positive integers n,

n is even ↔ 7n + 4 is even

Solution. Let n be a particular but arbitrarily chosen integer.


Proof for n is even → 7n + 4 is even. Since n is even, n = 2k for some integer k. Then,

7n + 4 = 7(2k) + 4 = 2(7k + 2)

Hence, 7n + 4 is even.

Proof for 7n + 4 is even → n is even. Since 7n + 4 is even and n is a positive integer, let
7n + 4 = 2l for some integer l ≥ 6. Then,

7n = 2l − 4 = 2(l − 2)

Clearly, 7n is even. Combining the fact that 7 is odd with the result of the Example 1, we
conclude that n is even.

We can also prove the latter by proving its contrapositive, i.e., we can prove

if n is odd then 7n + 4 is odd.

Since n is a positive odd integer, we have n = 2k + 1, for some integerk ≥ 0. Thus we have

7n + 4 = 7(2k + 1) + 4
= 14k + 10 + 1
= 2(7k + 5) + 1
= 2k 0 + 1, where k 0 = 7k + 5 is an integer.

Example. Prove that there are infinitely many prime numbers.


September 10, 2024 Lecture Outline 3

Solution. Assume, for the sake of contradiction, that there are only finitely many primes.
Let p be the largest prime number. Then all the prime numbers can be listed as

2, 3, 5, 7, 11, 13, . . . , p

Consider an integer n that is formed by multiplying all the prime numbers and then adding
1. That is,
n = (2 × 3 × 5 × 7 × · · · p) + 1

Clearly, n > p. Since p is the largest prime number, n cannot be a prime number. In other
words, n is composite. Let q be any prime number. Because of the way n is constructed,
when n is divided by q the remainder is 1. That is, n is not a multiple of q. This contradicts
the Fundamental Theorem of Arithmetic.

Alternate Proof by Filip Saidak. Let n be an arbitrary positive integer greater than
1. Since n and n + 1 are consecutive integers, they must be relatively prime. Hence, the
number N2 = n(n + 1) must have at least two different prime factors. Similarly, since
the integers n(n + 1) and n(n + 1) + 1 are consecutive, and therefore relatively prime, the
number
N3 = n(n + 1)[n(n + 1) + 1]

must have at least three different prime factors. This process can be continued indefinitely,
so the number of primes must be infinite.

Mathematical Induction
Example. Prove that for all integers n ≥ 1,
n
X n(n + 1)
i=
2
i=1

Solution. We will prove the claim using induction on n.


Induction hypothesis: Assume that the claim is true when n = k, for some k ≥ 1. In other
words assume that
k
X k(k + 1)
i=
2
i=1

Base Case: n = 1. The claim is true for n = 1 as both sides of the equation equal to 1.
Induction step: To prove that the claim is true when n = k + 1. That is, we want to show
that
k+1
X (k + 1)(k + 2)
=
2
i=1
4 Lecture Outline September 10, 2024

We can do this as follows.


k+1
X k
X
i= i + (k + 1)
i=1 i=1
k(k + 1)
= +k+1 (using induction hypothesis)
2
k(k + 1) + 2(k + 1)
=
2
(k + 1)(k + 2)
=
2
September 10, 2024 Lecture Outline 5

Example. Prove that the sum of the first n positive odd numbers is n2 .

Solution. We want to prove that ∀ positive integers n, P (n) where P (n) is the following
property.
n−1
X
2i + 1 = n2
i=0
Base Case: We want to show that P (1) is true. This is clearly true as
0
X
2i + 1 = 1 = 12
i=0

Induction Hypothesis: Assume P (k) is true for some k ≥ 1.


Induction Step: We want to show that P (k + 1) is true, i.e., we want to show that
k
X
2i + 1 = (k + 1)2
i=0

We can do this as follows.


k
X k−1
X
2i + 1 = 2i + 1 + 2k + 1
i=0 i=0
= k 2 + 2k + 1 (using induction hypothesis)
2
= (k + 1)

Example. Show that for all integers n ≥ 0, if r 6= 1,


n
X a(rn+1 − 1)
ari =
r−1
i=0

Solution. Let r be any real number that is not equal to 1. We want to prove that ∀
integers n, P (n), where P (n) is given by
n
X a(rn+1 − 1)
ari =
r−1
i=0

Base Case: We want to show that P (0) is true.


0
X a(r − 1)
ari = a =
r−1
i=0

Induction Hypothesis: Assume that P (k) is true for some integer k ≥ 0.


Induction Step: We want to show that P (k + 1) is true, i.e., we want to prove that
k+1
X a(rk+2 − 1)
ari =
r−1
i=0
6 Lecture Outline September 10, 2024

We can do this as follows.


k+1
X
L.H.S. = ari
i=0
Xk
= ari + ark+1
i=0
ark+1 −a
= + ark+1
r−1
a(rk+1 − 1) ark+1 (r − 1)
= +
r −1 r−1 
a k+1
= r (1 + r − 1) − 1
r−1
a 
= rk+2 − 1
r−1
a(rk+2 − 1)
=
r−1

Example. Prove that ∀ non-negative integers n,


n
X
2i = 2n+1 − 1
i=0

Solution. By setting a = 1, r = 2 in the result of the previous problem, the claim follows.

Example. Prove that ∀ non-negative integers n, 22n − 1 is a multiple of 3.

Solution. We want to prove that ∀ non-negative integers n, P (n), where P (n) is

22n − 1 = 3k, for some non-negative integer k

Base Step: P (0) is true as shown below.

20 − 1 = 0 = 3 · 0.

Induction Hypothesis: Assume that P (x) is true for some integer x ≥ 0, i.e., 22x − 1 = 3 · k 0 ,
for some k 0 ≥ 0.
Induction Step: We want to prove that P (x + 1) is true, i.e., we want to show that

22(x+1) − 1 = 3l, for some non-negative integer l.


September 10, 2024 Lecture Outline 7

We can show this as follows.

L.H.S. = 22(x+1) − 1
= 22x+2 − 1
= 22x · 22 − 1
= 22x · 4 − 1
= 22x · (3 + 1) − 1
= 3 · 22x + 22x − 1
= 3 · 22x + 3 · k 0 (using induction hypothesis)
2x 0
= 3(2 +k)
= 3l, where l = 22x + k 0

Since x and k 0 are integers l is also an integer. Hence, P (x + 1) is true.

Example. Prove that ∀n ∈ N, n > 1 → n! < nn .

Solution. Below is a simple direct proof for this inequality.

n! = 1 × 2 × 3 × · · · × n
< n × n × n × ··· × n
= nn

We now give a proof using induction. Let P (n) denote the following property.

n! < nn

Induction Hypothesis: Assume that P (k) is true for some integer k > 1.
Base Case: We want to prove P (2). P (2) is the proposition that 2! < 22 , or 2 < 4, which
is true.
Induction Step: We want to prove P (k +1), i.e., we want to prove that (k +1)! < (k +1)k+1 .

L.H.S. = (k + 1)!
= k! × (k + 1)
< k k × (k + 1) (using induction hypothesis)
k
< (k + 1) × (k + 1) (since k > 1)
= (k + 1)k+1

You might also like