Group 2 Discreteedited2
Group 2 Discreteedited2
Group 2 Discreteedited2
Example
Directly prove that if n is an odd integer then
is also an odd integer.
Solution
Let p be the statement that n is an odd integer and q be the statement that is an odd
integer.
Assume that n is an odd integer, then by definition n = 2k + 1 for some integer k.
We will now use this to show that is also an odd integer.
Direct Proof
Kyle Coronel
Reporter
The division algorithm is an algorithm in which
given 2 i n t e g e r s A a n d B , it computes their
quotient Q and remainder R, where 0 < R.
REMAINDERS
a remainder is a quantity “left over”
after performing a particular algorithm.
The term is most common used to refer to
the number left over when two integers are
divided by each other in integer division.
Algorithm 3.2.2. Division for positive numbers.
I n p u t : a natural number A and a natural number B
O u t p u t : Two integers q and r such that a=(q⋅b)+r and 0≤r<b
1.i f a < b t h e n r e t u r n 0 , a
2.l e t q : = 0
3.l e t r : = a
4.r e p e a t
a.let q:=q+1
b.let r:=r−b
5.u n t i l r < b
6.r e t u r n q , r
Example # 1 : Dividing 4 by 7 with
Algorithm
We f i n d t h e o u t p u t v a l u e s o f A l g o r i t h m f o r t h e i n p u t
values a=4 and b=7.
Input: a=4and b=7
Output: 0,4
4.a. let q:=1+1=2
4.b let r:=22−8=14
Output:
Tw o i n t e g e r s q a n d r s u c h t h a t a = ( q ⋅ b )
+r and 0≤r<b
1.l e t q : = 0
2.l e t r : = a
3.r e p e a t
a. let q:=q−1
b. let r:=r+b
4.u n t i l r ≥ 0
5.r e t u r n q , r
a=−20 and b=7.
Input: a=−20 and b=7
As r=1 the statement r≥0
1. let q:=0
is false. So we continue
2. let r:=a=−20
with step 5.
3.a. let q:=0−1=−1
3.b. let r:=−20+7=−13
5 . We r e t u r n t h e q u o t i e n t
q=−3 and the remainder r=1
As r=−20the statement r≥0 is false. So we
Output: −3,1
continue with step 3.
3.a. let q:=−1−1=−2
3.b. let r:=−13+7=−6
4. As r=−6 the statement r≥0 is false. So we
continue with step 3.
3.a. let q:=−2−1=−3
3.b. let r:=−6+7=1
GREATEST COMMON
DIVISORS
REPORTER: MARIO GRIEFIEL
GCF/GCD - Greatest Common
Factor/Divisor
A number you can use to divide into a
certain number and what you get is a
whole number
TRADITIONAL
METHOD
12 = (1, 2, 3,4, 6, 12)
36 = (1, 2, 3, 4, 6, 9, 12, 18, 36)
Greatest Common Divisor= 12
OTHER METHOD
WHAT IS THE COMMON DIVISOR OF 192
AND 168?
192÷2=96 168÷2=84
96=2=48 84÷2=42
48÷2=24 42÷2=21
24÷2=12 21÷3=7
12÷2=6
2x2x2x3=24
6÷3=2
Greatest common divisor
And
Linear Combination
REPORTER: ARLYN VINLUAN
Greatest common divisor
The greatest common divisor is sometimes
called the greatest common factor or
highest common factor. The greatest
common divisor of two integers (not both
zero) is the largest integer which divides
both of them.
Linear Combination
Is an expression constructed from a
set of terms by multiplying each term
by a constant and adding the results.
WHEN DOES GCD(a,b)=ax + by?
The greatest common divisor as a linear combination of
two values that is gcd (a,b) = xa + yb
Assume that a,b,x and y are integers (positive, negative
or zero )
All of the values of ax + by, are multiples of gcd(a,b)
The smallest possible positive value for ax + by is
gcf(a,b)
Here are some examples:
52=(1)44 + 8
44=(5)8 + 4
8= (2)4 + 0
Here are some examples:
Express gcd(84,199) as a linear
combination of 84 and 119.
Checking:
119=(1)84 + 35 119-(1)84gcd(84,119)=7
84=(2)35 + 14 84-(2)35 =35-(2)14
35=(2)14 + 7 35-(2)14 =(1)35 + (-2)14
14=(2)7 + 0 =(1)35 + (-2)[84-(2)35]
=(5)35 + (-2)84
=(5)[119-(1)84] + (-2)84
=(5)119 + (-7)84
Be’zout Coefficient
Use the Euclidean Algorithm to find integers x and y so that
22x+60y=gcf(22,60)
Step1: Step 2 Substitute a=22 and b=60: Step 3 Solve for the remainder in terms of a
and b and substitute into subsequent equation
60=22(2)+16 b=a(2)+16 b=a(2)+16b-2a=16
22=16(1) + 6 a=16(1) + 6 a=16(1) + 6 a=(b-2a)(1) + 6
16= 6 (2) + 4 16= 6 (2) + 4 a=b-2a+6
6= 4(1) + 2 a+2a-b=6
6= 4(1) + 2 3a-b=6
4=2(2)+ 0 So gcf (a,b) =2 16= 6 (2) + 4 b-2a=(3a-b)(2) + 4
b-2a=6a-2b +4
So gcf (22,60) =2 b+2b -2a-6a=4
3b-8a = 4 cv
6= 4(1) + 2 3a-b = 3b-8a(1) + 2
3a-b = 3b-8a + 2
Therefore x=11, y=-4 is a solution to 3a-b-3b+8a = 2
22x + 60y = gcf(22,60) 11a-4b = 2 cv