ALGEBRA+NUMBER THEORY +COMBINATORICS

Size: px
Start display at page:

Download "ALGEBRA+NUMBER THEORY +COMBINATORICS"

Transcription

1 ALGEBRA+NUMBER THEORY +COMBINATORICS COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming Challenges books.

2 Outline Algebra. Number Theory Combinatorics

3 Numerical Bases Binary Base-2 numbers are made up of the digits 0 and 1. They provide the integer representation used within computers, because these digits map naturally to on/off or high/low states. Octal Base-8 numbers are useful as a shorthand to make it easier to read binary numbers, since the bits can be read off from the right in groups of three. Thus = = Why do programmers think Christmas is Halloween? Because 31 Oct = 25 Dec! Decimal We use base-10 numbers because we learned to count on our ten fingers.

4 Numerical Bases Hexadecimal Base-16 numbers are an even easier shorthand to represent binary numbers Alphanumeric Base-36 numbers are the highest you can represent using the 10 numerical digits with the 26 letters of the alphabet.

5 Real Numbers The most important thing to remember about real numbers is that they are not real real numbers. Floating point arithmetic has limited precision. The fact that there always exists a number c between a and b if a < b. This is not true in real numbers as they are represented in a computer. The associativity of addition guarantees that (a + b ) + c = a + (b + c ). Unfortunately, this is not necessarily true in computer arithmetic because of round-off errors.

6 Types of Numbers Integers These are the counting numbers,,..., 2, 1, 0, 1, 2,...,. Rational Numbers These are the numbers which can be expressed as the ratio of two integers, i.e. c is rational if c = a/b for integers a and b Irrational Numbers There does not exist any pair of integers x and y such that x/y equals any of these numbers. Examples include π = , 2 = , and e = They can be computed using Taylor series expansions, but for all practical purposes it suffices to approximate them using the ten digits or so.

7 Dealing with Numbers Rounding Rounding is used to get a more accurate value for the least significant digit. Truncating Truncation is exemplified by the floor function, which converts a real number of an integer by chopping off the fractional part.

8 Fractions Exact rational numbers x/y are best represented by pairs of integers x, y, where x is the numerator and y is the denominator of the fraction. Addition We must find a common denominator before adding fractions Substraction Same as addition, since c d = c + 1 X d

9 Fractions Multiplication Since multiplication is repeated addition Division To divide fractions you multiply by the reciprocal of the denominator Note: It is important to reduce fractions to their simplest representation, i.e., replace 2/ 4 by 1/ 2 (use GCD).

10 Manipulating Polynomials Evaluation. Brute Force: computing each term c i x n independently and adding them together. It costs O(n 2 ) multiplications. Improvement 1: Note that x i = x i-1 x, so if we compute the terms from smallest degree to highest degree we can keep track of the current power of x, and get away with two multiplications per term (x i-1 x, and then c i x i ). Improvement 2: Employ Horner s rule.

11 Manipulating Polynomials Addition/Substraction. Easier than the same operations on long integers, since there is no borrowing or carrying. Simply add or subtract the coefficients of the ith terms for all i from zero to the maximum degree. Multiplication. The product of polynomials P(x) and Q(x) is the sum of the product of every pair of terms, where each term comes from a different polynomial: Such an all-against-all operation is called a convolution

12 Root Finding Given a polynomial P(x) and a target number t, the problem of root finding is identifying any or all x such that P(x) = t. If P(x) is a first-degree polynomial If P(x) is a second-degree polynomial

13 Root Finding There are more complicated formulae for solving thirdand fourth-degree polynomials. Beyond quadratic equations, numerical methods are typically used. Newton-Raphson (the basic idea is that of binary search)

14 Logarithms A logarithm is simply an inverse exponential function. Logarithms are still useful for multiplication A direct consequence of this is that So how can we compute a b for any a and b using the exp(x) and ln(x) functions? So the problem is reduced to one multiplication plus one call of each of these functions

15 Sum of Powers Pretty useful in many random situations

16 Fast Exponentiation Recursive computation of a n

17 Implementation Running time O(log n).

18 Outline Algebra Number Theory Combinatorics

19 Number Theory: Prime numbers A natural number starting from 2: {2, 3, 4,...} is considered as a prime if it is only divisible by 1 or itself. The first (and the only even) prime is 2. The next prime numbers are: 3, 5, 7, 11, 13, 17, 19, 23, 29,..., and infinitely many more primes. There are 25 primes in range [ ], 168 primes in [ ], 1000 primes in [ ], 1229 primes in [ ], etc...

20 Number Theory: Prime Testing Function Test by definition. Test if N is divisible by divisor [2...N-1] runs in O(N) Improvement 1 Test if N is divisible by a divisor [2... N] if N is divisible by p, then N = p X q. If q were smaller than p, then q or a prime factor of q would have divided N earlier. This is O( N) Improvement 2 test if N is divisible by divisor [3, 5, 7... N] (only test odd numbers). there is only one even prime number, i.e. number 2, which can be tested separately. This is O( N/2)

21 Number Theory: Prime Testing Function Improvement 3. Test if N is divisible by prime divisors N This is O( #primes N ) This improvement is already good enough for contest problems. There are 500 odd numbers in [1... (10 6 )], but there are only 168 primes in the same range. This is O( N/ln( N)).

22 Generating List of Prime Numbers Use the Sieve of Eratosthenes algorithm. First, it sets all numbers in the range to be probably prime but set numbers 0 and 1 to be not prime. Then, it takes 2 as prime and crosses out all multiples of 2 Then it takes the next non-crossed number 3 as a prime and crosses out all multiples of 3. Then it takes 5 and crosses out all multiples of 5. After that, whatever left uncrossed within the range [0...N] are primes. This is roughly O(N log logn) opt sieve for smaller primes and reserve optimized prime testing function for larger primes

23 Finding Prime Factors A composite numbers N, i.e. the non-primes, can be written uniquely it as a multiplication of its prime factors. N = 240 = 2 X 2 X 2 X 2 X 3 X 5 = 2 4 X 3 X 5 (the latter form is called prime-power factorization). Divide and Conquer Spirit: An integer N can be expressed as: N = PF X N, where PF is a prime factor and N is another number which is N/PF i.e. we can reduce the size of N by taking out its factor PF We can keep doing this until eventually N = 1. Special case if N is actually a prime number. This is O(π( N)) = O( N/ln N).

24 Greatest Common Divisor (GCD) The largest positive integer d such that d a and d b where x y implies that x divides y. One practical usage of GCD is to simplify fraction, e.g. Used very frequently in number theoretical problems. Some facts: gcd(a, b) = gcd(a, b a) gcd(a, 0) = a

25 GCD: Euclidian Algorithm Repeated use of gcd(a, b) = gcd(a, b a) Example:

26 GCD: Euclidian Algorithm-Implementation Running time: O(log(a + b))

27 LCM: Least Common Multiple. The smallest positive integer l such that a l and b l lcm(a, b) = a X b/gcd(a, b). Implementation: The GCD of more than 2 numbers, e.g. gcd(a, b, c) is equal to gcd(a, gcd(b, c)), etc, and similarly for LCM. Both GCD and LCM algorithms run in O(log 10 n), where n = max(a, b).

28 Number Theory: Relatively Prime Two integers a and b are said to be relatively prime if gcd(a, b) = 1 e.g. 25 and 42. Problem of finding positive integers below N that are relatively prime to N. Use Euler s Totient (Phi) function. For example:

29 Number Theory: Solving Diophantine Equation David buys apples and oranges at a total cost of 8.39CAD. If an apple is 25 cents and an orange is 18 cents, how many of each type of fruit does David buys? This problem can be modeled as a linear equation with two variables: 25x + 18y = 839. Since we know that both x and y must be integers, this linear equation is called the Linear Diophantine Equation. We can solve Linear Diophantine Equation with two variables even if we only have one equation!

30 Number Theory: Solving Diophantine Equation Let a and b be integers with d = gcd(a, b). The equation ax + by = c has no integral solutions if d c is not true. But if d c, then there are infinitely many integral solutions. The first solution (x 0, y 0 ) can be found using the Extended Euclid algorithm, and the rest can be derived from x = x 0 + (b/d)n, y = y 0 (a/d)n, where n is an integer.

31 Number Theory: Extended Euclid

32 Number Theory: Solving Diophantine Equation For our problem above: 25x + 18y = 839, we have: a = 25, b = 18, extendedeuclid(25, 18) = (( 5, 7), 1), or 25 X ( 5) + 18 X 7 = 1. Multiplying the left and right hand side of the equation above by 839/gcd(25, 18) = 839, we have: 25 X ( 4195) + 18 X 5873 = 839. Thus, x = (18/1)n, y = 5873 (25/1)n. Since we need to have non-negative x and y, we have: n 0 and n 0, or 4195/18 n 5873/25, or n The only possible integer for n is 234.

33 Number Theory: Solving Diophantine Equation Thus x = X 234 = 17 and y = X 234 = 23, i.e. 17 apples (of 25 cents each) and 23 oranges (of 18 cents each) of a total of 8.39 CAD.

34 Number Theory: Fibonacci Numbers Leonardo Fibonacci s numbers are defined as fib(0) = 0, fib(1) = 1, and fib(n) = fib(n 1) + fib(n 2) for n 2. This generates the following familiar patterns: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 which can be derived with an O(n) DP technique. (One of their properties) Zeckendorf s theorem: every positive integer can be written in a unique way as a sum of one or more distinct Fibonacci numbers such that the sum does not include any two consecutive Fibonacci numbers.

35 Number Theory: Fibonacci Numbers Implementation 1 (recursive solution) Exponential time complexity. Implementation 2 (Dynamic Programming) O(n) complexity.

36 Number Theory: Fibonacci Numbers Implementation 3 (matrix exponentiation) Use fast exponentiation to compute the matrix power

Chapter 5. Number Theory. 5.1 Base b representations

Chapter 5. Number Theory. 5.1 Base b representations Chapter 5 Number Theory The material in this chapter offers a small glimpse of why a lot of facts that you ve probably nown and used for a long time are true. It also offers some exposure to generalization,

More information

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6 Math 131 notes Jason Riedy 6 October, 2008 Contents 1 Modular arithmetic 2 2 Divisibility rules 3 3 Greatest common divisor 4 4 Least common multiple 4 5 Euclidean GCD algorithm 5 6 Linear Diophantine

More information

Math Review. for the Quantitative Reasoning measure of the GRE General Test

Math Review. for the Quantitative Reasoning measure of the GRE General Test Math Review for the Quantitative Reasoning measure of the GRE General Test www.ets.org Overview This Math Review will familiarize you with the mathematical skills and concepts that are important for solving

More information

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93. Exercises Exercises 1. Determine whether each of these integers is prime. a) 21 b) 29 c) 71 d) 97 e) 111 f) 143 2. Determine whether each of these integers is prime. a) 19 b) 27 c) 93 d) 101 e) 107 f)

More information

Q 2.0.2: If it s 5:30pm now, what time will it be in 4753 hours? Q 2.0.3: Today is Wednesday. What day of the week will it be in one year from today?

Q 2.0.2: If it s 5:30pm now, what time will it be in 4753 hours? Q 2.0.3: Today is Wednesday. What day of the week will it be in one year from today? 2 Mod math Modular arithmetic is the math you do when you talk about time on a clock. For example, if it s 9 o clock right now, then it ll be 1 o clock in 4 hours. Clearly, 9 + 4 1 in general. But on a

More information

Arithmetic, Algebra, Number Theory

Arithmetic, Algebra, Number Theory Arithmetic, Algebra, Number Theory Peter Simon 21 April 2004 Types of Numbers Natural Numbers The counting numbers: 1, 2, 3,... Prime Number A natural number with exactly two factors: itself and 1. Examples:

More information

CHAPTER 1 REAL NUMBERS KEY POINTS

CHAPTER 1 REAL NUMBERS KEY POINTS CHAPTER 1 REAL NUMBERS 1. Euclid s division lemma : KEY POINTS For given positive integers a and b there exist unique whole numbers q and r satisfying the relation a = bq + r, 0 r < b. 2. Euclid s division

More information

Applied Cryptography and Computer Security CSE 664 Spring 2017

Applied Cryptography and Computer Security CSE 664 Spring 2017 Applied Cryptography and Computer Security Lecture 11: Introduction to Number Theory Department of Computer Science and Engineering University at Buffalo 1 Lecture Outline What we ve covered so far: symmetric

More information

Lecture Notes. Advanced Discrete Structures COT S

Lecture Notes. Advanced Discrete Structures COT S Lecture Notes Advanced Discrete Structures COT 4115.001 S15 2015-01-13 Recap Divisibility Prime Number Theorem Euclid s Lemma Fundamental Theorem of Arithmetic Euclidean Algorithm Basic Notions - Section

More information

4 Number Theory and Cryptography

4 Number Theory and Cryptography 4 Number Theory and Cryptography 4.1 Divisibility and Modular Arithmetic This section introduces the basics of number theory number theory is the part of mathematics involving integers and their properties.

More information

8.5 Taylor Polynomials and Taylor Series

8.5 Taylor Polynomials and Taylor Series 8.5. TAYLOR POLYNOMIALS AND TAYLOR SERIES 50 8.5 Taylor Polynomials and Taylor Series Motivating Questions In this section, we strive to understand the ideas generated by the following important questions:

More information

3 The fundamentals: Algorithms, the integers, and matrices

3 The fundamentals: Algorithms, the integers, and matrices 3 The fundamentals: Algorithms, the integers, and matrices 3.4 The integers and division This section introduces the basics of number theory number theory is the part of mathematics involving integers

More information

4. Number Theory (Part 2)

4. Number Theory (Part 2) 4. Number Theory (Part 2) Terence Sim Mathematics is the queen of the sciences and number theory is the queen of mathematics. Reading Sections 4.8, 5.2 5.4 of Epp. Carl Friedrich Gauss, 1777 1855 4.3.

More information

Commutative Rings and Fields

Commutative Rings and Fields Commutative Rings and Fields 1-22-2017 Different algebraic systems are used in linear algebra. The most important are commutative rings with identity and fields. Definition. A ring is a set R with two

More information

Mathematics Tutorials. Arithmetic Tutorials Algebra I Tutorials Algebra II Tutorials Word Problems

Mathematics Tutorials. Arithmetic Tutorials Algebra I Tutorials Algebra II Tutorials Word Problems Mathematics Tutorials These pages are intended to aide in the preparation for the Mathematics Placement test. They are not intended to be a substitute for any mathematics course. Arithmetic Tutorials Algebra

More information

Complex Numbers: Definition: A complex number is a number of the form: z = a + bi where a, b are real numbers and i is a symbol with the property: i

Complex Numbers: Definition: A complex number is a number of the form: z = a + bi where a, b are real numbers and i is a symbol with the property: i Complex Numbers: Definition: A complex number is a number of the form: z = a + bi where a, b are real numbers and i is a symbol with the property: i 2 = 1 Sometimes we like to think of i = 1 We can treat

More information

not to be republished NCERT REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results

not to be republished NCERT REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results REAL NUMBERS CHAPTER 1 (A) Main Concepts and Results Euclid s Division Lemma : Given two positive integers a and b, there exist unique integers q and r satisfying a = bq + r, 0 r < b. Euclid s Division

More information

Optimisation and Operations Research

Optimisation and Operations Research Optimisation and Operations Research Lecture 12: Algorithm Analysis and Complexity Matthew Roughan http://www.maths.adelaide.edu.au/matthew.roughan/ Lecture_notes/OORII/

More information

Executive Assessment. Executive Assessment Math Review. Section 1.0, Arithmetic, includes the following topics:

Executive Assessment. Executive Assessment Math Review. Section 1.0, Arithmetic, includes the following topics: Executive Assessment Math Review Although the following provides a review of some of the mathematical concepts of arithmetic and algebra, it is not intended to be a textbook. You should use this chapter

More information

SEVENTH EDITION and EXPANDED SEVENTH EDITION

SEVENTH EDITION and EXPANDED SEVENTH EDITION SEVENTH EDITION and EXPANDED SEVENTH EDITION Slide 5-1 Chapter 5 Number Theory and the Real Number System 5.1 Number Theory Number Theory The study of numbers and their properties. The numbers we use to

More information

Remainders. We learned how to multiply and divide in elementary

Remainders. We learned how to multiply and divide in elementary Remainders We learned how to multiply and divide in elementary school. As adults we perform division mostly by pressing the key on a calculator. This key supplies the quotient. In numerical analysis and

More information

PRACTICE PROBLEMS: SET 1

PRACTICE PROBLEMS: SET 1 PRACTICE PROBLEMS: SET MATH 437/537: PROF. DRAGOS GHIOCA. Problems Problem. Let a, b N. Show that if gcd(a, b) = lcm[a, b], then a = b. Problem. Let n, k N with n. Prove that (n ) (n k ) if and only if

More information

Counting in Different Number Systems

Counting in Different Number Systems Counting in Different Number Systems Base 1 (Decimal) is important because that is the base that we first learn in our culture. Base 2 (Binary) is important because that is the base used for computer codes

More information

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri MATH 1101 haalshehri@ksu.edu.sa 1 Introduction To Number Systems First Section: Binary System Second Section: Octal Number System Third Section: Hexadecimal System 2 Binary System 3 Binary System The binary

More information

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 9.1 Chapter 9 Objectives

More information

Essential Mathematics

Essential Mathematics Appendix B 1211 Appendix B Essential Mathematics Exponential Arithmetic Exponential notation is used to express very large and very small numbers as a product of two numbers. The first number of the product,

More information

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. 2 Arithmetic This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. (See [Houston, Chapters 27 & 28]) 2.1 Greatest common divisors Definition 2.16. If a, b are integers, we say

More information

Lecture 7: Number Theory Steven Skiena. skiena

Lecture 7: Number Theory Steven Skiena.   skiena Lecture 7: Number Theory Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Number Theory and Divisibility G-d created

More information

2 Elementary number theory

2 Elementary number theory 2 Elementary number theory 2.1 Introduction Elementary number theory is concerned with properties of the integers. Hence we shall be interested in the following sets: The set if integers {... 2, 1,0,1,2,3,...},

More information

Chapter 2. Divisibility. 2.1 Common Divisors

Chapter 2. Divisibility. 2.1 Common Divisors Chapter 2 Divisibility 2.1 Common Divisors Definition 2.1.1. Let a and b be integers. A common divisor of a and b is any integer that divides both a and b. Suppose that a and b are not both zero. By Proposition

More information

Exam 2 Review Chapters 4-5

Exam 2 Review Chapters 4-5 Math 365 Lecture Notes S. Nite 8/18/2012 Page 1 of 9 Integers and Number Theory Exam 2 Review Chapters 4-5 Divisibility Theorem 4-1 If d a, n I, then d (a n) Theorem 4-2 If d a, and d b, then d (a+b).

More information

Section 3-4: Least Common Multiple and Greatest Common Factor

Section 3-4: Least Common Multiple and Greatest Common Factor Section -: Fraction Terminology Identify the following as proper fractions, improper fractions, or mixed numbers:, proper fraction;,, improper fractions;, mixed number. Write the following in decimal notation:,,.

More information

Discrete Structures Lecture Primes and Greatest Common Divisor

Discrete Structures Lecture Primes and Greatest Common Divisor DEFINITION 1 EXAMPLE 1.1 EXAMPLE 1.2 An integer p greater than 1 is called prime if the only positive factors of p are 1 and p. A positive integer that is greater than 1 and is not prime is called composite.

More information

Objective Type Questions

Objective Type Questions DISTANCE EDUCATION, UNIVERSITY OF CALICUT NUMBER THEORY AND LINEARALGEBRA Objective Type Questions Shyama M.P. Assistant Professor Department of Mathematics Malabar Christian College, Calicut 7/3/2014

More information

PROBLEMS ON CONGRUENCES AND DIVISIBILITY

PROBLEMS ON CONGRUENCES AND DIVISIBILITY PROBLEMS ON CONGRUENCES AND DIVISIBILITY 1. Do there exist 1,000,000 consecutive integers each of which contains a repeated prime factor? 2. A positive integer n is powerful if for every prime p dividing

More information

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations.

EE260: Digital Design, Spring n Digital Computers. n Number Systems. n Representations. n Conversions. n Arithmetic Operations. EE 260: Introduction to Digital Design Number Systems Yao Zheng Department of Electrical Engineering University of Hawaiʻi at Mānoa Overview n Digital Computers n Number Systems n Representations n Conversions

More information

Exercise on Continued Fractions

Exercise on Continued Fractions Exercise on Continued Fractions Jason Eisner, Spring 1993 This was one of several optional small computational projects assigned to undergraduate mathematics students at Cambridge University in 1993. I

More information

Glossary. Glossary 981. Hawkes Learning Systems. All rights reserved.

Glossary. Glossary 981. Hawkes Learning Systems. All rights reserved. A Glossary Absolute value The distance a number is from 0 on a number line Acute angle An angle whose measure is between 0 and 90 Addends The numbers being added in an addition problem Addition principle

More information

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. College Algebra for STEM

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. College Algebra for STEM Undergraduate Notes in Mathematics Arkansas Tech University Department of Mathematics College Algebra for STEM Marcel B. Finan c All Rights Reserved 2015 Edition To my children Amin & Nadia Preface From

More information

3.4. ZEROS OF POLYNOMIAL FUNCTIONS

3.4. ZEROS OF POLYNOMIAL FUNCTIONS 3.4. ZEROS OF POLYNOMIAL FUNCTIONS What You Should Learn Use the Fundamental Theorem of Algebra to determine the number of zeros of polynomial functions. Find rational zeros of polynomial functions. Find

More information

1.1.1 Algebraic Operations

1.1.1 Algebraic Operations 1.1.1 Algebraic Operations We need to learn how our basic algebraic operations interact. When confronted with many operations, we follow the order of operations: Parentheses Exponentials Multiplication

More information

Intermediate Math Circles February 26, 2014 Diophantine Equations I

Intermediate Math Circles February 26, 2014 Diophantine Equations I Intermediate Math Circles February 26, 2014 Diophantine Equations I 1. An introduction to Diophantine equations A Diophantine equation is a polynomial equation that is intended to be solved over the integers.

More information

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions

Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions Warm-up Problems 1. What is a prime number? Give an example of an even prime number and an odd prime number. A prime number

More information

Algorithms (II) Yu Yu. Shanghai Jiaotong University

Algorithms (II) Yu Yu. Shanghai Jiaotong University Algorithms (II) Yu Yu Shanghai Jiaotong University Chapter 1. Algorithms with Numbers Two seemingly similar problems Factoring: Given a number N, express it as a product of its prime factors. Primality:

More information

Number Theory. Zachary Friggstad. Programming Club Meeting

Number Theory. Zachary Friggstad. Programming Club Meeting Number Theory Zachary Friggstad Programming Club Meeting Outline Factoring Sieve Multiplicative Functions Greatest Common Divisors Applications Chinese Remainder Theorem Throughout, problems to try are

More information

Daniel A. Klain. Essentials of Number Theory. Draft

Daniel A. Klain. Essentials of Number Theory. Draft Daniel A. Klain Essentials of Number Theory Daniel A. Klain Essentials of Number Theory Preliminary Edition last updated June 30, 2017 Copyright c 2017 by Daniel A. Klain Permission is granted to copy

More information

Helping Students Understand Algebra

Helping Students Understand Algebra Helping Students Understand Algebra By Barbara Sandall, Ed.D., and Mary Swarthout, Ph.D. COPYRIGHT 2005 Mark Twain Media, Inc. ISBN 10-digit: 1-58037-293-7 13-digit: 978-1-58037-293-0 Printing No. CD-404020

More information

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases

Lecture 2. The Euclidean Algorithm and Numbers in Other Bases Lecture 2. The Euclidean Algorithm and Numbers in Other Bases At the end of Lecture 1, we gave formulas for the greatest common divisor GCD (a, b), and the least common multiple LCM (a, b) of two integers

More information

Unit 2-1: Factoring and Solving Quadratics. 0. I can add, subtract and multiply polynomial expressions

Unit 2-1: Factoring and Solving Quadratics. 0. I can add, subtract and multiply polynomial expressions CP Algebra Unit -1: Factoring and Solving Quadratics NOTE PACKET Name: Period Learning Targets: 0. I can add, subtract and multiply polynomial expressions 1. I can factor using GCF.. I can factor by grouping.

More information

Introduction to Number Theory

Introduction to Number Theory INTRODUCTION Definition: Natural Numbers, Integers Natural numbers: N={0,1,, }. Integers: Z={0,±1,±, }. Definition: Divisor If a Z can be writeen as a=bc where b, c Z, then we say a is divisible by b or,

More information

REAL NUMBERS. Any positive integer a can be divided by another positive integer b in such a way that it leaves a remainder r that is smaller than b.

REAL NUMBERS. Any positive integer a can be divided by another positive integer b in such a way that it leaves a remainder r that is smaller than b. REAL NUMBERS Introduction Euclid s Division Algorithm Any positive integer a can be divided by another positive integer b in such a way that it leaves a remainder r that is smaller than b. Fundamental

More information

Maths Scheme of Work. Class: Year 10. Term: autumn 1: 32 lessons (24 hours) Number of lessons

Maths Scheme of Work. Class: Year 10. Term: autumn 1: 32 lessons (24 hours) Number of lessons Maths Scheme of Work Class: Year 10 Term: autumn 1: 32 lessons (24 hours) Number of lessons Topic and Learning objectives Work to be covered Method of differentiation and SMSC 11 OCR 1 Number Operations

More information

Part 2 - Beginning Algebra Summary

Part 2 - Beginning Algebra Summary Part - Beginning Algebra Summary Page 1 of 4 1/1/01 1. Numbers... 1.1. Number Lines... 1.. Interval Notation.... Inequalities... 4.1. Linear with 1 Variable... 4. Linear Equations... 5.1. The Cartesian

More information

LP03 Chapter 5. A prime number is a natural number greater that 1 that has only itself and 1 as factors. 2, 3, 5, 7, 11, 13, 17, 19, 23, 29,

LP03 Chapter 5. A prime number is a natural number greater that 1 that has only itself and 1 as factors. 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, LP03 Chapter 5 Prime Numbers A prime number is a natural number greater that 1 that has only itself and 1 as factors. 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, Question 1 Find the prime factorization of 120.

More information

A group of figures, representing a number, is called a numeral. Numbers are divided into the following types.

A group of figures, representing a number, is called a numeral. Numbers are divided into the following types. 1. Number System Quantitative Aptitude deals mainly with the different topics in Arithmetic, which is the science which deals with the relations of numbers to one another. It includes all the methods that

More information

A number that can be written as, where p and q are integers and q Number.

A number that can be written as, where p and q are integers and q Number. RATIONAL NUMBERS 1.1 Definition of Rational Numbers: What are rational numbers? A number that can be written as, where p and q are integers and q Number. 0, is known as Rational Example:, 12, -18 etc.

More information

Table of Contents. 2013, Pearson Education, Inc.

Table of Contents. 2013, Pearson Education, Inc. Table of Contents Chapter 1 What is Number Theory? 1 Chapter Pythagorean Triples 5 Chapter 3 Pythagorean Triples and the Unit Circle 11 Chapter 4 Sums of Higher Powers and Fermat s Last Theorem 16 Chapter

More information

and LCM (a, b, c) LCM ( a, b) LCM ( b, c) LCM ( a, c)

and LCM (a, b, c) LCM ( a, b) LCM ( b, c) LCM ( a, c) CHAPTER 1 Points to Remember : REAL NUMBERS 1. Euclid s division lemma : Given positive integers a and b, there exists whole numbers q and r satisfying a = bq + r, 0 r < b.. Euclid s division algorithm

More information

Fall 2017 September 20, Written Homework 02

Fall 2017 September 20, Written Homework 02 CS1800 Discrete Structures Profs. Aslam, Gold, & Pavlu Fall 2017 September 20, 2017 Assigned: Wed 20 Sep 2017 Due: Fri 06 Oct 2017 Instructions: Written Homework 02 The assignment has to be uploaded to

More information

Grade 7/8 Math Circles. Continued Fractions

Grade 7/8 Math Circles. Continued Fractions Faculty of Mathematics Waterloo, Ontario N2L 3G Centre for Education in Mathematics and Computing A Fraction of our History Grade 7/8 Math Circles October th /2 th Continued Fractions Love it or hate it,

More information

CMSC Discrete Mathematics SOLUTIONS TO SECOND MIDTERM EXAM November, 2005

CMSC Discrete Mathematics SOLUTIONS TO SECOND MIDTERM EXAM November, 2005 CMSC-37110 Discrete Mathematics SOLUTIONS TO SECOND MIDTERM EXAM November, 2005 Instructor: László Babai Ryerson 164 e-mail: laci@cs This exam contributes 20% to your course grade. 1. (6 points) Let a

More information

Winter Camp 2009 Number Theory Tips and Tricks

Winter Camp 2009 Number Theory Tips and Tricks Winter Camp 2009 Number Theory Tips and Tricks David Arthur darthur@gmail.com 1 Introduction This handout is about some of the key techniques for solving number theory problems, especially Diophantine

More information

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory.

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory. CSS322: Security and Cryptography Sirindhorn International Institute of Technology Thammasat University Prepared by Steven Gordon on 29 December 2011 CSS322Y11S2L06, Steve/Courses/2011/S2/CSS322/Lectures/number.tex,

More information

GUIDED NOTES. College. Algebra. + Integrated. Review

GUIDED NOTES. College. Algebra. + Integrated. Review GUIDED NOTES College Algebra + Integrated Review Editor: Kara Roche Content Contributors: Daniel Breuer, Jennifer Comer Lead Designer: Tee Jay Zajac Designers: B. Syam Prasad, Patrick Thompson, James Smalls

More information

5: The Integers (An introduction to Number Theory)

5: The Integers (An introduction to Number Theory) c Oksana Shatalov, Spring 2017 1 5: The Integers (An introduction to Number Theory) The Well Ordering Principle: Every nonempty subset on Z + has a smallest element; that is, if S is a nonempty subset

More information

Fast Polynomial Multiplication

Fast Polynomial Multiplication Fast Polynomial Multiplication Marc Moreno Maza CS 9652, October 4, 2017 Plan Primitive roots of unity The discrete Fourier transform Convolution of polynomials The fast Fourier transform Fast convolution

More information

Number Theory Proof Portfolio

Number Theory Proof Portfolio Number Theory Proof Portfolio Jordan Rock May 12, 2015 This portfolio is a collection of Number Theory proofs and problems done by Jordan Rock in the Spring of 2014. The problems are organized first by

More information

Lesson 1: Natural numbers

Lesson 1: Natural numbers Lesson 1: Natural numbers Contents: 1. Number systems. Positional notation. 2. Basic arithmetic. Algorithms and properties. 3. Algebraic language and abstract reasoning. 4. Divisibility. Prime numbers.

More information

Math From Scratch Lesson 29: Decimal Representation

Math From Scratch Lesson 29: Decimal Representation Math From Scratch Lesson 29: Decimal Representation W. Blaine Dowler January, 203 Contents Introducing Decimals 2 Finite Decimals 3 2. 0................................... 3 2.2 2....................................

More information

An Introduction to Mathematical Thinking: Algebra and Number Systems. William J. Gilbert and Scott A. Vanstone, Prentice Hall, 2005

An Introduction to Mathematical Thinking: Algebra and Number Systems. William J. Gilbert and Scott A. Vanstone, Prentice Hall, 2005 Chapter 2 Solutions An Introduction to Mathematical Thinking: Algebra and Number Systems William J. Gilbert and Scott A. Vanstone, Prentice Hall, 2005 Solutions prepared by William J. Gilbert and Alejandro

More information

With Question/Answer Animations. Chapter 4

With Question/Answer Animations. Chapter 4 With Question/Answer Animations Chapter 4 Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their properties. Key ideas in number theory include divisibility

More information

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime. PUTNAM TRAINING NUMBER THEORY (Last updated: December 11, 2017) Remark. This is a list of exercises on Number Theory. Miguel A. Lerma Exercises 1. Show that the sum of two consecutive primes is never twice

More information

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively 6 Prime Numbers Part VI of PJE 6.1 Fundamental Results Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively D (p) = { p 1 1 p}. Otherwise

More information

Math 2 Variable Manipulation Part 2 Powers & Roots PROPERTIES OF EXPONENTS:

Math 2 Variable Manipulation Part 2 Powers & Roots PROPERTIES OF EXPONENTS: Math 2 Variable Manipulation Part 2 Powers & Roots PROPERTIES OF EXPONENTS: 1 EXPONENT REVIEW PROBLEMS: 2 1. 2x + x x + x + 5 =? 2. (x 2 + x) (x + 2) =?. The expression 8x (7x 6 x 5 ) is equivalent to?.

More information

Radiological Control Technician Training Fundamental Academic Training Study Guide Phase I

Radiological Control Technician Training Fundamental Academic Training Study Guide Phase I Module 1.01 Basic Mathematics and Algebra Part 4 of 9 Radiological Control Technician Training Fundamental Academic Training Phase I Coordinated and Conducted for the Office of Health, Safety and Security

More information

Math 110 FOUNDATIONS OF THE REAL NUMBER SYSTEM FOR ELEMENTARY AND MIDDLE SCHOOL TEACHERS

Math 110 FOUNDATIONS OF THE REAL NUMBER SYSTEM FOR ELEMENTARY AND MIDDLE SCHOOL TEACHERS 4-1Divisibility Divisibility Divisibility Rules Divisibility An integer is if it has a remainder of 0 when divided by 2; it is otherwise. We say that 3 divides 18, written, because the remainder is 0 when

More information

Integers and Division

Integers and Division Integers and Division Notations Z: set of integers N : set of natural numbers R: set of real numbers Z + : set of positive integers Some elements of number theory are needed in: Data structures, Random

More information

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory).

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory). Wednesday, February 21 Today we will begin Course Notes Chapter 5 (Number Theory). 1 Return to Chapter 5 In discussing Methods of Proof (Chapter 3, Section 2) we introduced the divisibility relation from

More information

4 Powers of an Element; Cyclic Groups

4 Powers of an Element; Cyclic Groups 4 Powers of an Element; Cyclic Groups Notation When considering an abstract group (G, ), we will often simplify notation as follows x y will be expressed as xy (x y) z will be expressed as xyz x (y z)

More information

2WF15 - Discrete Mathematics 2 - Part 1. Algorithmic Number Theory

2WF15 - Discrete Mathematics 2 - Part 1. Algorithmic Number Theory 1 2WF15 - Discrete Mathematics 2 - Part 1 Algorithmic Number Theory Benne de Weger version 0.54, March 6, 2012 version 0.54, March 6, 2012 2WF15 - Discrete Mathematics 2 - Part 1 2 2WF15 - Discrete Mathematics

More information

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. Chapter 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. If n > 1

More information

Mathematical Foundations of Cryptography

Mathematical Foundations of Cryptography Mathematical Foundations of Cryptography Cryptography is based on mathematics In this chapter we study finite fields, the basis of the Advanced Encryption Standard (AES) and elliptical curve cryptography

More information

Discrete Mathematics GCD, LCM, RSA Algorithm

Discrete Mathematics GCD, LCM, RSA Algorithm Discrete Mathematics GCD, LCM, RSA Algorithm Abdul Hameed http://informationtechnology.pk/pucit abdul.hameed@pucit.edu.pk Lecture 16 Greatest Common Divisor 2 Greatest common divisor The greatest common

More information

Notes on Continued Fractions for Math 4400

Notes on Continued Fractions for Math 4400 . Continued fractions. Notes on Continued Fractions for Math 4400 The continued fraction expansion converts a positive real number α into a sequence of natural numbers. Conversely, a sequence of natural

More information

Questionnaire for CSET Mathematics subset 1

Questionnaire for CSET Mathematics subset 1 Questionnaire for CSET Mathematics subset 1 Below is a preliminary questionnaire aimed at finding out your current readiness for the CSET Math subset 1 exam. This will serve as a baseline indicator for

More information

Quantitative Aptitude

Quantitative Aptitude WWW.UPSCMANTRA.COM Quantitative Aptitude Concept 1 1. Number System 2. HCF and LCM 2011 Prelims Paper II NUMBER SYSTEM 2 NUMBER SYSTEM In Hindu Arabic System, we use ten symbols 0, 1, 2, 3, 4, 5, 6, 7,

More information

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook)

Proofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook) Proofs Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm Reading (Epp s textbook) 4.3 4.8 1 Divisibility The notation d n is read d divides n. Symbolically,

More information

7.2 Applications of Euler s and Fermat s Theorem.

7.2 Applications of Euler s and Fermat s Theorem. 7.2 Applications of Euler s and Fermat s Theorem. i) Finding and using inverses. From Fermat s Little Theorem we see that if p is prime and p a then a p 1 1 mod p, or equivalently a p 2 a 1 mod p. This

More information

An Introduction to Proof-based Mathematics Harvard/MIT ESP: Summer HSSP Isabel Vogt

An Introduction to Proof-based Mathematics Harvard/MIT ESP: Summer HSSP Isabel Vogt An Introduction to Proof-based Mathematics Harvard/MIT ESP: Summer HSSP Isabel Vogt Class Objectives Field Axioms Finite Fields Field Extensions Class 5: Fields and Field Extensions 1 1. Axioms for a field

More information

Numbers. 2.1 Integers. P(n) = n(n 4 5n 2 + 4) = n(n 2 1)(n 2 4) = (n 2)(n 1)n(n + 1)(n + 2); 120 =

Numbers. 2.1 Integers. P(n) = n(n 4 5n 2 + 4) = n(n 2 1)(n 2 4) = (n 2)(n 1)n(n + 1)(n + 2); 120 = 2 Numbers 2.1 Integers You remember the definition of a prime number. On p. 7, we defined a prime number and formulated the Fundamental Theorem of Arithmetic. Numerous beautiful results can be presented

More information

COMPUTER ARITHMETIC. 13/05/2010 cryptography - math background pp. 1 / 162

COMPUTER ARITHMETIC. 13/05/2010 cryptography - math background pp. 1 / 162 COMPUTER ARITHMETIC 13/05/2010 cryptography - math background pp. 1 / 162 RECALL OF COMPUTER ARITHMETIC computers implement some types of arithmetic for instance, addition, subtratction, multiplication

More information

5.1. Primes, Composites, and Tests for Divisibility

5.1. Primes, Composites, and Tests for Divisibility CHAPTER 5 Number Theory 5.1. Primes, Composites, and Tests for Divisibility Definition. A counting number with exactly two di erent factors is called a prime number or a prime. A counting number with more

More information

ECEN 5022 Cryptography

ECEN 5022 Cryptography Elementary Algebra and Number Theory University of Colorado Spring 2008 Divisibility, Primes Definition. N denotes the set {1, 2, 3,...} of natural numbers and Z denotes the set of integers {..., 2, 1,

More information

CMPUT 403: Number Theory

CMPUT 403: Number Theory CMPUT 403: Number Theory Zachary Friggstad February 26, 2016 Outline Factoring Sieve Multiplicative Functions Greatest Common Divisors Applications Chinese Remainder Theorem Factoring Theorem (Fundamental

More information

Chapter 5: The Integers

Chapter 5: The Integers c Dr Oksana Shatalov, Fall 2014 1 Chapter 5: The Integers 5.1: Axioms and Basic Properties Operations on the set of integers, Z: addition and multiplication with the following properties: A1. Addition

More information

UNIT 4 NOTES: PROPERTIES & EXPRESSIONS

UNIT 4 NOTES: PROPERTIES & EXPRESSIONS UNIT 4 NOTES: PROPERTIES & EXPRESSIONS Vocabulary Mathematics: (from Greek mathema, knowledge, study, learning ) Is the study of quantity, structure, space, and change. Algebra: Is the branch of mathematics

More information

Arithmetic and Algebra

Arithmetic and Algebra Arithmetic and Algebra Daniel Butnaru daniel.butnaru@uni-konstanz.de 15. Dezember 2006 Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 1/39 Outline 1 Introduction 2 Big Number Arithmetic

More information

Chuck Garner, Ph.D. May 25, 2009 / Georgia ARML Practice

Chuck Garner, Ph.D. May 25, 2009 / Georgia ARML Practice Some Chuck, Ph.D. Department of Mathematics Rockdale Magnet School for Science Technology May 25, 2009 / Georgia ARML Practice Outline 1 2 3 4 Outline 1 2 3 4 Warm-Up Problem Problem Find all positive

More information

1 Continued Fractions

1 Continued Fractions Continued Fractions To start off the course, we consider a generalization of the Euclidean Algorithm which has ancient historical roots and yet still has relevance and applications today.. Continued Fraction

More information

8 Primes and Modular Arithmetic

8 Primes and Modular Arithmetic 8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.

More information