Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.

Slides:



Advertisements
Similar presentations
With examples from Number Theory
Advertisements

Lecture 2 Based on Chapter 1, Weiss. Mathematical Foundation Series and summation: ……. N = N(N+1)/2 (arithmetic series) 1 + r+ r 2 + r 3 +………r.
1 In this lecture  Number Theory ● Rational numbers ● Divisibility  Proofs ● Direct proofs (cont.) ● Common mistakes in proofs ● Disproof by counterexample.
Discrete Mathematics Math 6A Homework 9 Solution.
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Number Theory and Cryptography
Basic properties of the integers
More Number Theory Proofs Rosen 1.5, 3.1. Prove or Disprove If m and n are even integers, then mn is divisible by 4. The sum of two odd integers is odd.
Proof Techniques and Recursion. Proof Techniques Proof by induction –Step 1: Prove the base case –Step 2: Inductive hypothesis, assume theorem is true.
Chapter 4 Properties of the integers: mathematical induction Yen-Liang Chen Dept of IM NCU.
CMSC 250 Discrete Structures Number Theory. 20 June 2007Number Theory2 Exactly one car in the plant has color H( a ) := “ a has color”  x  Cars –H(
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
1 Section 3.3 Mathematical Induction. 2 Technique used extensively to prove results about large variety of discrete objects Can only be used to prove.
Methods of Proof Lecture 4: Sep 16 (chapter 3 of the book)
Properties of the Integers: Mathematical Induction
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
The Integers and Division
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
C OURSE : D ISCRETE STRUCTURE CODE : ICS 252 Lecturer: Shamiel Hashim 1 lecturer:Shamiel Hashim second semester Prepared by: amani Omer.
Methods of Proof & Proof Strategies
Real Numbers and Their Properties รายวิชา ค ความรู้พื้นฐานสำหรับแคลคูลัส 1 ภาคเรียนที่ 1 ปีการศึกษา 2552.
Mathematics of Cryptography Part I: Modular Arithmetic
Sequences and Series (T) Students will know the form of an Arithmetic sequence.  Arithmetic Sequence: There exists a common difference (d) between each.
1 © 2010 Pearson Education, Inc. All rights reserved 10.1 DEFINITION OF A SEQUENCE An infinite sequence is a function whose domain is the set of positive.
MATH 224 – Discrete Mathematics
1 Preliminaries Precalculus Review I Precalculus Review II
1 CS 201 Data Structures & Algorithms Chapter 1 Introduction Text: Read Weiss, §1.1 – 1.3 Izmir University of Economics.
Introduction to Proofs
Mathematical Induction. F(1) = 1; F(n+1) = F(n) + (2n+1) for n≥ F(n) n F(n) =n 2 for all n ≥ 1 Prove it!
1 Introduction to Abstract Mathematics Chapter 4: Sequences and Mathematical Induction Instructor: Hayk Melikya 4.1- Sequences. 4.2,
1 CE 221 Data Structures & Algorithms Chapter 1 Introduction Text: Read Weiss, §1.1 – 1.3 Izmir University of Economics.
Advance Data Structure and Algorithm COSC600 Dr. Yanggon Kim Chapter 1.
Methods of Proof. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical theorems. Direct.
Chapter 1 Introduction. Goals Why the choice of algorithms is so critical when dealing with large inputs Basic mathematical background Review of Recursion.
CSC201 Analysis and Design of Algorithms Asst.Proof.Dr.Surasak Mungsing Oct-151 Lecture 2: Definition of algorithm and Mathematical.
CompSci 102 Discrete Math for Computer Science February 16, 2012 Prof. Rodger.
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
Methods of Proof Lecture 3: Sep 9. This Lecture Now we have learnt the basics in logic. We are going to apply the logical rules in proving mathematical.
P.1 Real Numbers. 2 What You Should Learn Represent and classify real numbers. Order real numbers and use inequalities. Find the absolute values of real.
Math 021.  An equation is defined as two algebraic expressions separated by an = sign.  The solution to an equation is a number that when substituted.
Cpt S 223 – Advanced Data Structures Math Review 2
Chapter 1: Introduction
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Foundations of Discrete Mathematics Chapters 5 By Dr. Dalia M. Gil, Ph.D.
October 3, 2001CSE 373, Autumn Mathematical Background Exponents X A X B = X A+B X A / X B = X A-B (X A ) B = X AB X N +X N = 2X N 2 N +2 N = 2 N+1.
Fundamental Concepts of Algebra
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Math Review 1.
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Divide and Conquer Faculty Name: Ruhi Fatima Topics Covered Divide and Conquer Matrix multiplication Recurrence.
CS104:Discrete Structures Chapter 2: Proof Techniques.
1 CMSC 341 Math Review. 2 Exponents Identities (X A ) B = X AB X A * X B = X A+B X A / X B = X A-B X A + X B  X A+B.
1 2/21/2016 MATH 224 – Discrete Mathematics Sequences and Sums A sequence of the form ar 0, ar 1, ar 2, ar 3, ar 4, …, ar n, is called a geometric sequence.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
Proofs, Recursion and Analysis of Algorithms Mathematical Structures for Computer Science Chapter 2 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesProofs,
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
Methods of Proof Lecture 4: Sep 20 (chapter 3 of the book, except 3.5 and 3.8)
Chapter 4 With Question/Answer Animations 1. Chapter Summary Divisibility and Modular Arithmetic - Sec 4.1 – Lecture 16 Integer Representations and Algorithms.
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
Number Theory Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
Fuw-Yi Yang1 Textbook: Introduction to Cryptography 2nd ed. By J.A. Buchmann Chap 1 Integers Department of Computer Science and Information Engineering,
1 Proofs by Counterexample & Contradiction There are several ways to prove a theorem:  Counterexample: By providing an example of in which the theorem.
Hubert Chan (Chapters 1.6, 1.7, 4.1)
Direct Proof and Counterexample III: Divisibility
Hubert Chan (Chapters 1.6, 1.7, 4.1)
Chapter 5 Induction and Recursion
Applied Discrete Mathematics Week 9: Integer Properties
CE 221 Data Structures & Algorithms Chapter 1 Introduction
From the last time: gcd(a, b) can be characterized in two different ways: It is the least positive value of ax + by where x and y range over integers.
Recursion.
Presentation transcript:

Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs

Manipulation of exponents – When the operation involves multiplication, add the exponents algebraically – When the operation involves division, subtract the divisor exponent from the numerator exponent. – When the operation involves powers or roots, multiply the exponent by the power number or divide the exponent by the power number, respectively. – Others

In computer science, all logarithms are to the base 2 unless specified otherwise. DEFINITION: X A = B if and only if log X B = A Logarithms

THEOREM 1.1 Proof: Let X = log C B, Y = log C A, Z = log A B. By the definition of logarithms, C X = B, C Y = A, and A Z = B Combining these three equalities yields C X = B = A Z = (C Y ) Z = C YZ Therefore, X = YZ, which implies Z = X/Y, proving the theorem.

– THEOREM 1.2 logAB = logA + logB; A, B > 0 Proof: Let X = logA, Y = logB, Z = logAB. By the definition of logarithms, 2 X = A, 2 Y = B, and 2 Z = AB Combining these three equalities yields 2 X 2 y = 2 x+y = AB = 2 Z Therefore, X+Y = Z, proving the theorem. AB = 2 X 2 y = 2 x+y 2 Z = AB

– Some other useful formulas: log (A/B) = log A – log B log (A B ) = B log A log X 0

Series Two usual types – Geometric series: Such that for a constant g, n=1, 2, … – Mathematical progressions: Such that for some constant d, n=1, 2, …

– Geometric series A common one: Its companion: How to compute it? Let S =, That is, S = A 0 + A 1 + A 2 + … + A N-1 + A N AS = A 1 + A 2 + … + A N-1 + A N +A N+1 AS – S = A N+1 – 1 Therefore, If 0 < A < 1, then Why ?

For 0 < A < 1 and N tends to , Another sum that occurs frequently We write S = and multiply by 2, obtaining 2S = Subtracting these two equations yields S = Thus, S = 2.

– Arithmetic series … N-2 N-1 N Therefore, (N+1)*(N/2) = N+1 N/2 pairs How to compute ?

– Harmonic series For positive integers N, the N th harmonic number is H N = = – Other formulas

Modular Arithmetic – A is congruent to B modulo N, written A B (mod N), if N divides A-B. – Intuitively, this means that the remainder is the same when either A or B is divided by N. – Ex’s, Check the following – 20 ? 6 (mod 2) – 25 ? 10 (mod 3) – 20 ? 6 (mod 4) – 100 ? 23 (mod 6)

– If A B (mod N), then A+C B+C (mod N) AD BD (mod N) (A+C) – (B+C) = A – B Since A B (mod N), from the definition, N divides A-B. Thus, N divides (A+C)-(B+C) Therefore, A+C B+C (mod N) Since A B (mod N), based on the definition, there exists an integer k such that A-B = k N. Now, AD-BD = (A-B)D = k ND So, N divides AD-BD. Therefore, AD BD (mod N)

Proofs – Two most common ways of proving statements in data structure analysis: proof by induction and proof by contradiction. – The best way of proving that a theorem is false is by exhibiting a counterexample.

Proof by induction (two steps) – Base case: Establish that a theorem is true for some small value(s). This step is almost always trivial. – Induction step: An inductive hypothesis is assumed (which means that the theorem is assumed to be true for all cases up to some limit k) Using this assumption, the theorem is then shown to be true for the next value, which is typically k+1.

– Example 1: Fibonacci numbers F i =1 Fibonacci numbers: F 0 = 1, F 1 = 1, F 2 = 2, …, F i = F i-1 + F i-2 Base case: verify that the theorem is true for the trivial cases. F 1 = 1 < 5/3 F 2 = 2 < 25/9 Inductive hypothesis: We assume that the theorem is true for i = 1, 2, …, k. To prove the theorem, we need to show that F k+1 < (5/3) k+1 We have F k+1 = F k + F k-1 < (5/3) k + (5/3) k-1 (using inductive hypothesis) = (3/5) (5/3) k+1 + (3/5) 2 (5/3) k+1 = (3/5) (5/3) k+1 + (9/25)(5/3) k+1 = (3/5 + 9/25) (5/3) k+1 = (24/25) (5/3) k+1 < (5/3) k+1 which proves the theorem.

– Example 2: THEOREM 1.3 If N >= 1, then Proof: The proof is by induction. Base case: Obviously, the theorem is true when N = 1 Inductive hypothesis: Assume that the theorem is true for 1 <= k <= N. We need to establish that, under this assumption, the theorem is true for N+1. We have Applying the inductive hypothesis, we obtain Thus, = (N+2)(2N+3)

– Proof by contradiction Strategies: – Assume that the theorem is false – Show that this assumption implies that some know property is false, which indicates the original assumption was wrong. Example 1: The number of primes is infinite. A positive integer number is a prime if and only if only 1 and itself divide the number. Proof: We assume that there is a finite number of primes, so that there is some largest prime P k. Let P 1, P 2, …, P k be all the primes in order and consider N = P 1 P 2 … P k + 1 Clearly, N > P k, so by assumption N is not prime. However, none of P 1, P 2, …, P k divides N exactly. This is a contradiction, because every number is either prime or a product of primes. Hence, the original assumption is false, which implies that the theorem is true.

Example 1 is not a rational number. – Note: a rational number can be represented by a irreducible fraction of two integers Proof. By contradiction – (Who can do this?)

– Proof by counterexample Proof by counterexample is usually used to prove that a theorem is false. Constructing a counterexample is not as easy as it seems Example 1: The statement Fibonacci number F k <= k 2 is false. Proof: F 11 = 144 > Therefore, the statement is false.

A Brief Introduction to Recursion A function is recursive if itself is used in its definition. A recursive function must have a base (base cases) and a general relation which reduces a general case to simple case, and eventually to the base (or base cases). Ex’s?

A good way to understand recursion is through building a recursion tree The good points for recursion are – To write elegant codes – Easier analysis of the algorithm performance The bad points are – Time consuming (Why?) – Space consuming (Why?)

Four Basic Rules of Recursion Base cases: You must always have some base cases, which can be solved without recursion. Making progress: For cases that are to be solved recursively, the recursive call must be always be to a case that makes progress toward a base case. Design rule. Assume that all the recursive calls work. Compound interest rule. Never duplicate work by solving the same instance of a problem in separate recursive calls.