Class 5 Slides

CSCI 246 – Class 5
RATIONAL NUMBERS, QUOTIENT – REMAINDER THEOREM
Quiz Questions

Lecture 8:



n = 10

n=0
Lecture 9:


Give the divisors of n when:
Say: 10 = 3*3 +1 What’s the quotient q and the remainder r?
Lecture 10:
𝑎
𝑏

What notation would you use to say “The floor of ”?

What notation would you use to say “The ceiling of ”?
𝑎
𝑏
Notes

Quiz will be handed back tomorrow

Will return grades next-day
Lesson 8 – Rational Numbers and Divisibility

Reminder

What is Rational Numbers ℚ equal to?
Lesson 8 – Rational Numbers and Divisibility

Reminder

What is Rational Numbers ℚ equal to?

ℚ=
𝑎
𝑏
𝑎, 𝑏 ∈ ℤ, 𝑏 ≠ 0}
Lesson 8 – Rational Numbers and Divisibility

Reminder

What is Rational Numbers ℚ equal to?

ℚ=

Which operations are rational numbers “closed under”?
𝑎
𝑏
𝑎, 𝑏 ∈ ℤ, 𝑏 ≠ 0
Lesson 8 – Rational Numbers and Divisibility

Reminder

What is Rational Numbers ℚ equal to?

ℚ=

Which operations are rational numbers “closed under”?
𝑎
𝑏
𝑎, 𝑏 ∈ ℤ, 𝑏 ≠ 0

Multiplication

Addition
Lesson 8 – Rational Numbers and Divisibility

Divisibility
Lesson 8 – Rational Numbers and Divisibility

Divisibility

Defn: 𝑖𝑓 𝑛, 𝑑 ∈ ℤ ∧ 𝑑 ≠ 0, 𝑡ℎ𝑒𝑛 𝑛 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑖𝑓𝑓 ∃𝑘 ∈ ℤ 𝑠. 𝑡. 𝑛 = 𝑘 ∗ 𝑑

Consider 10 = 2 ∗ 5

What’s n?

What’s d?

What’s k?
Lesson 8 – Rational Numbers and Divisibility

Divisibility

Defn: 𝑖𝑓 𝑛, 𝑑 ∈ ℤ ∧ 𝑑 ≠ 0, 𝑡ℎ𝑒𝑛 𝑛 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑖𝑓𝑓 ∃𝑘 ∈ ℤ 𝑠. 𝑡. 𝑛 = 𝑘 ∗ 𝑑

What are the divisors of 21?
Lesson 8 – Rational Numbers and Divisibility

Prime Numbers: only divisible by 1 and itself
Lesson 8 – Rational Numbers and Divisibility

Prime Numbers: only divisible by 1 and itself

Give the first 4 prime numbers
Lesson 8 – Rational Numbers and Divisibility

Transitivity of Divisibility
Theorem: Let 𝑎, 𝑏, 𝑐 𝜖ℤ
Lesson 8 – Rational Numbers and Divisibility

Transitivity of Divisibility
Theorem: Let 𝑎, 𝑏, 𝑐 𝜖ℤ
Suppose a|b and b|c
Lesson 8 – Rational Numbers and Divisibility

Transitivity of Divisibility
Theorem: Let 𝑎, 𝑏, 𝑐 𝜖ℤ
Suppose a|b and b|c
Then …?
Lesson 8 – Rational Numbers and Divisibility

Transitivity of Divisibility
Theorem: Let 𝑎, 𝑏, 𝑐 𝜖ℤ
Suppose a|b and b|c
Then a|c
Proof:
Lesson 8 – Rational Numbers and Divisibility

Transitivity of Divisibility
Theorem: Let 𝑎, 𝑏, 𝑐 𝜖ℤ
Suppose a|b and b|c
Then a|c
Proof:
since a|b there exists k1 /*by definition of divisibility (b=k1*a) */
since b|c there exists k2 /*by definition of divisibility (c=k2*b) */
∴ 𝑐 = 𝑘1 ∗ 𝑘2 ∗ 𝑎
Lesson 9 – Quotient Remainder Theorem

Divisibility


Defn: 𝑖𝑓 𝑛, 𝑑 ∈ ℤ ∧ 𝑑 ≠ 0, 𝑡ℎ𝑒𝑛 𝑛 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 𝑑 𝑖𝑓𝑓 ∃𝑘 ∈ ℤ 𝑠. 𝑡. 𝑛 = 𝑘 ∗ 𝑑
Quotient – Remainder Theorem

𝑓𝑜𝑟 𝑎𝑛𝑦 𝑖𝑛𝑡𝑒𝑔𝑒𝑟𝑠 𝑎, 𝑏 𝑏 ≠ 0 , ∃ 𝑢𝑛𝑖𝑞𝑢𝑒𝑙𝑦 𝑖𝑛𝑡𝑒𝑔𝑒𝑟𝑠 𝑞, 𝑟 𝑠. 𝑡. 𝑎 = 𝑞 ∗ 𝑏 + 𝑟, 𝑤ℎ𝑒𝑟𝑒 0 ≤ 𝑟 ≤
|𝑏|
Lesson 9 – Quotient Remainder Theorem

Divisibility


Quotient – Remainder Theorem


Defn: 𝑖𝑓 𝑛, 𝑑 ∈ ℤ ∧ 𝑑 ≠ 0, 𝑡ℎ𝑒𝑛 𝑛 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 𝑑 𝑖𝑓𝑓 ∃𝑘 ∈ ℤ 𝑠. 𝑡. 𝑛 = 𝑘 ∗ 𝑑
𝑓𝑜𝑟 𝑎𝑛𝑦 𝑖𝑛𝑡𝑒𝑔𝑒𝑟𝑠 𝑎, 𝑏 𝑏 ≠ 0 , ∃ 𝑢𝑛𝑖𝑞𝑢𝑒𝑙𝑦 𝑖𝑛𝑡𝑒𝑔𝑒𝑟𝑠 𝑞, 𝑟 𝑠. 𝑡. 𝑎 = 𝑞 ∗ 𝑏 + 𝑟, 𝑤ℎ𝑒𝑟𝑒 0 ≤ 𝑟 ≤
|𝑏|
What are the quotient q, and the remainder r in the following:

11 = 2*5 + 1

99 = 9*10 + 9
Lesson 9 – Quotient Remainder Theorem

Divisibility


Quotient – Remainder Theorem


Defn: 𝑖𝑓 𝑛, 𝑑 ∈ ℤ ∧ 𝑑 ≠ 0, 𝑡ℎ𝑒𝑛 𝑛 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 𝑑 𝑖𝑓𝑓 ∃𝑘 ∈ ℤ 𝑠. 𝑡. 𝑛 = 𝑘 ∗ 𝑑
𝑓𝑜𝑟 𝑎𝑛𝑦 𝑖𝑛𝑡𝑒𝑔𝑒𝑟𝑠 𝑎, 𝑏 𝑏 ≠ 0 , ∃ 𝑢𝑛𝑖𝑞𝑢𝑒𝑙𝑦 𝑖𝑛𝑡𝑒𝑔𝑒𝑟𝑠 𝑞, 𝑟 𝑠. 𝑡. 𝑎 = 𝑞 ∗ 𝑏 + 𝑟, 𝑤ℎ𝑒𝑟𝑒 0 ≤ 𝑟 ≤
|𝑏|
Mod:

Quotient (reminder) q = a div b

Remainder r = a mod d
Lesson 9 – Quotient Remainder Theorem

Divisibility


Quotient – Remainder Theorem


Defn: 𝑖𝑓 𝑛, 𝑑 ∈ ℤ ∧ 𝑑 ≠ 0, 𝑡ℎ𝑒𝑛 𝑛 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 𝑑 𝑖𝑓𝑓 ∃𝑘 ∈ ℤ 𝑠. 𝑡. 𝑛 = 𝑘 ∗ 𝑑
𝑓𝑜𝑟 𝑎𝑛𝑦 𝑖𝑛𝑡𝑒𝑔𝑒𝑟𝑠 𝑎, 𝑏 𝑏 ≠ 0 , ∃ 𝑢𝑛𝑖𝑞𝑢𝑒𝑙𝑦 𝑖𝑛𝑡𝑒𝑔𝑒𝑟𝑠 𝑞, 𝑟 𝑠. 𝑡. 𝑎 = 𝑞 ∗ 𝑏 + 𝑟, 𝑤ℎ𝑒𝑟𝑒 0 ≤ 𝑟 ≤ |𝑏|
Mod:

Quotient (reminder) q = a div b

Remainder r = a mod d
Example:
What is the quotient and remainder when 99 is divided by 7?
q = ? , a=?, d=?, r=?
Lesson 9 – Quotient Remainder Theorem

Divisibility


Quotient – Remainder Theorem


Defn: 𝑖𝑓 𝑛, 𝑑 ∈ ℤ ∧ 𝑑 ≠ 0, 𝑡ℎ𝑒𝑛 𝑛 𝑖𝑠 𝑑𝑖𝑣𝑖𝑠𝑖𝑏𝑙𝑒 𝑏𝑦 𝑑 𝑖𝑓𝑓 ∃𝑘 ∈ ℤ 𝑠. 𝑡. 𝑛 = 𝑘 ∗ 𝑑
𝑓𝑜𝑟 𝑎𝑛𝑦 𝑖𝑛𝑡𝑒𝑔𝑒𝑟𝑠 𝑎, 𝑏 𝑏 ≠ 0 , ∃ 𝑢𝑛𝑖𝑞𝑢𝑒𝑙𝑦 𝑖𝑛𝑡𝑒𝑔𝑒𝑟𝑠 𝑞, 𝑟 𝑠. 𝑡. 𝑎 = 𝑞 ∗ 𝑏 + 𝑟, 𝑤ℎ𝑒𝑟𝑒 0 ≤ 𝑟 ≤ |𝑏|
Mod:

Quotient (reminder) q = a div b

Remainder r = a mod d
Example:
What is the quotient and remainder when 99 is divided by 7?
q = ? , a=?, d=?, r=?
Rewrite the above in Modular arithmetic (mod) form:
Lesson 10 – Floors, Ceiling functions

Floor Function


Assigns to the real number x the largest integer that is less than or equal to x
Ceiling Function

Assigns to the real number x the smallest integer that is greater than or equal to
x
Lesson 10 – Floors, Ceiling functions

Floor Function


Ceiling Function


Assigns to the real number x the largest integer that is less than or equal to x
Assigns to the real number x the smallest integer that is greater than or equal to
x
Examples:

Floor of (1/2) = ?

Ceiling of (1/2) = ?
Homework (Group)
1.
Determine whether 3| 7? Explain why or why not using the definitions?
2.
What are the quotient when 101 is devised by 11?
3.
What is 101 mod 11 equal to?
4.
Let a = 3, b=9, c=81; use the proof outlined in the lecture video with these values to show
that because a|b and b|c that a|c
5.
Show that if a|b and b|a, where a and be are integers, then a=b or a=-b
6.
What is the floor of (-1/2)
7.
What is the ceiling of (-1/2)
8.
Prove or disprove that the ceiling of (x+y) = the (ceiling of x )+ (ceiling of y) for all real
numbers x and y
Homework (Individual)
1.
Determine whether 3|12? Explain why or why not using the definitions?
2.
What are the quotient and remainder when -11 is divided by 3?
3.
For the following, give the quotient and the remainder:
a)
19 is divided by 7
b)
-111 is divided by 11
c)
789 is divided by 23
d)
1001 is divided by 13
4.
What were the 3 cases given for the proof of the Quotient-Remainder Theorem?
5.
Data stored on a computer disk or transmitted over a data network are represented as a
string of bytes. Each byte is made up of 8 bits. How many bytes are required to encode
100 bits of data? (hint: report the celling or floor function of this problem – which one
makes sense here?)