0% found this document useful (0 votes)
46 views2 pages

A DQ + R: Big Oh Least Common Multiple

The document discusses several topics in mathematics including: 1) Big O notation and using it to show that a function is O(x^2). 2) The division algorithm and finding the quotient and remainder when dividing integers. 3) Calculating the greatest common denominator (GCD) of two numbers by finding the greatest factor that divides both numbers. 4) Relatively prime integers having a GCD of 1 and examples of such integers.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views2 pages

A DQ + R: Big Oh Least Common Multiple

The document discusses several topics in mathematics including: 1) Big O notation and using it to show that a function is O(x^2). 2) The division algorithm and finding the quotient and remainder when dividing integers. 3) Calculating the greatest common denominator (GCD) of two numbers by finding the greatest factor that divides both numbers. 4) Relatively prime integers having a GCD of 1 and examples of such integers.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

BIG OH

Ex: Show that f(x) = 3x+7 is O(x


2
)
=3x
2
+ x
2

=4x
2

therefore, 3x+7 < 4x
2

where: c=4 ; k=2

DIVISION ALGORITHM


where: 0 s r < d
a integer (dividend)
d- positive integer (divisor)
q quotient
r remainder
ex: -11 by 3
-11 = 3 * (- 4) + 1
therefore, q = -4 ; r = 1
***Remainder cannot be negative

GREATEST COMMON DENOMINATOR
***least exponent
ex: GCD(60,54) = ?
a = 60 = 2
2
3
1
5
1

b = 54 = 2
1
3
3
5
0

GCD = 2
1
3
1
5
0
= 6
therefore, GCD(60,54) = 6

RELATIVELY PRIME INTEGERS
***all GCD is 1
ex: 11 , 15 , 13
GCD(11,15) = 1
GCD(11,13) = 1
GCD(15,13) = 1
therefore, RELATIVE PRIME
14 , 15 , 21
GCD(14,15) = 1
GCD(14,21) = 7
GCD(15,21) = 3
therefore, NOT RELATIVE PRIME
LEAST COMMON MULTIPLE
***greatest exponent
ex: LCM(60,54) = ?
a = 60 = 2
2
3
1
5
1

b = 54 = 2
1
3
3
5
0

LCM = 2
2
3
3
5
1
= 540
therefore, LCM(60,54) = 540
***TO CHECK: a*b = gcd(a,b) * lcm(a,b)

MODULAR ARITHMETIC
ex: -13 mod 4
13 = 4 * (-4) + 3
therefore, r = 3

RULES OF INFERENCE
Modus
ponens
p
p q
q
Modus
tollens
q
p q
p
Hypothetical
syllogism
p q
q r
p r
Disjunctive
syllogism
p v q
p
q
Addition
p
p v q
Simplification
p . q
p
Conjunction
p
q
p . q
Resolution
p v q
p v r
q v r

ex: Every UMB student is a genius.
George is a UMB student.
Therefore, George is a genius.
U(x): x is a UMB student.
G(x): x is a genius.
Step 1: x (U(x) G(x)) Hypothesis
Step 2: U(George) G(George) Univ. instantiation
using Step 1
Step 3: U(George) Hypothesis
Step 4: G(George) Modus ponens
using Steps 2 & 3
a = dq + r
x P(x)
__________ Universal Instantiation
P(c) if ceU

PROVING THEOREMS
1. Direct method
p q is TRUE
ex: If n is odd, then n
2
is odd.
2. Indirect method
~q ~p is TRUE
ex: If 3n + 2 is odd, then n is odd.
3. Contradiction
p ~q is FALSE
4. Induction
a) Show P(0) is TRUE
b) Show that if P(k), then P(k+1)

EXAMPLE OF INDUCTION
1 + 2
n
< 3
n
for all n > 1
a) n=1
1 + 2
1
< 3
1
VALID
b) P(k)
1 + 2
k
< 3
k
c) P(k+1)
1 + 2
k+1
< 3
k+1
------------------------------------------------
1 + 2
k
< 3
k
1 + 2
k
+ 2
k
< 3
k
+ 2
k
< 3
k
+ 3
k
< 3 * 3
k


therefore, VALID

RECURSIVE DEFINITION
1. Fibonacci Series
n 1 2 3 4 5
a
n
0 1 1 2 3

a
3
= a
2
+ a
1
therefore, a
n
= a
n-1
+ a
n-2






2. a
n
= 3n-5
n 1 2 3 4 5
a
n
-2 1 4 7 10

a
2
= a
1
+ 3
therefore, a
n
= a
n-1
+3

3. f(n) = n!
a
n
= a
n-1
+ n

4. a
n
= 2
n
1 ; n > 1
a
n
= a
n-1
+ 2
n-1

ALGORITHM (CONTD)
Binary search: log
2
n (from 2
n
)
ex: 8 elements 3 steps
16 elements 4 steps

You might also like