Part I, Number Systems. CS131 Mathematics for Computer Scientists II Note 1 INTEGERS

Size: px
Start display at page:

Download "Part I, Number Systems. CS131 Mathematics for Computer Scientists II Note 1 INTEGERS"

Transcription

1 CS131 Part I, Number Systems CS131 Mathematics for Computer Scientists II Note 1 INTEGERS The set of all integers will be denoted by Z. So Z = {..., 2, 1, 0, 1, 2,...}. The decimal number system uses the ten digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. A positive integer n can then be represented by a string of these digits or equivalently by a sum of multiples of powers of ten. For example the string represents the number ( ) + ( ) + ( ) + (5 10) + 8. The binary system is of great importance in computing. Here there are just two digits 0 and 1 (called bits). A string of bits then represents a sum of multiples of powers of two. For example in the binary system represents (1 2 4 ) + (0 2 3 ) + (0 2 2 ) + (1 2 1 ) + (1 2 0 ). In decimal notation this becomes = 19. Subscripts are often used to indicate the base. For example we can write two = 19 ten Binary to Decimal Conversion. The string b n b n 1... b 2 b 1 b 0 of bits represents (b n 2 n ) + (b n 1 2 n 1 ) (b ) + (b 1 2) + b 0. Decimal to Binary Conversion. Divide repeatedly by 2 to get remainders r 0, r 1, r 2,..., r n. The binary representation is then r n r n 1... r 2 r 1 r 0. Remember that the last remainder is the first digit of the representation in the new base. Problem. Convert the decimal representation 244 to binary. 1 1

2 Solution R R R R R R R 1 0 R 1 Hence 244 ten = two Problem. The hexadecimal (base 16) system uses the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F where A,..., F represent ten,..., fifteen. Convert the hexadecimal representation 21BAD to decimal. Solution. The decimal representations of B,A and D are 11, 10 and 13 so 21BAD represents ( ) + ( ) + ( ) + ( ) + ( ) which simplifies to Conversion algorithms. Let b > 1 be an integer. To convert a base 10 representation to base b divide repeatedly by b converting the remainders r 1, r 2,..., r n to digits in base b. The base b representation is then r n r n 1... r 2 r 1. To convert a base b representation x n x n 1... x 2 x 1 x 0 to base 10 compute x n b n + x n 1 b n x 2 b 2 + x 1 b + x 0 converting each digit to base 10 if necessary. We now look at two important algorithms concerning integers. The Division Algorithm. numbers q, r Z with If a, b Z with b 0, then there are unique a = qb + r and 0 r < b q is called the quotient and r the remainder. If a, b Z with 0 < b < a then q and r can be computed by forming the numbers a b, a 2b,..., a nb, a (n+1)b stopping when the first strictly negative value a (n + 1)b < 0 is obtained. Then q = n and r = a nb. If a and b are integers with a = qb for some integer q then we say that b divides a. The greatest common divisor of two integers is defined to be the largest integer which divides them both. The greatest common divisor of 1 2

3 m and n will be denoted by gcd(m, n). Note that gcd(0, n) = n for every n > 0. The Euclidean algorithm makes repeated use of the division algorithm to calculate the greatest common divisor of two integers. The Euclidean Algorithm. Let r 1 and r 0 be integers with r 1 < r 0. (1) For each i define r i+1 to be the remainder when r i 1 is divided by r i. The last non-zero remainder obtained is equal to gcd(r 1, r 0 ). (2) The relations r i 1 = q i r i + r i+1 (1 i N) can be used to write this last non-zero remainder in terms of r 1 and r 0 giving gcd(r 1, r 0 ) = xr 1 + yr 0 for some integers xand y. To see why the algorithm works, note that since r i 1 q i r i = r i+1 any common divisor of r i 1 and r i must divide r i+1. We may say from this argument that that all remainders r i must inherit each other s common divisors. Hence we have gcd(r i, r i 1 ) = gcd(r i+1, r i ) since each pair has the same set of common divisors. Also 0 r i+1 < r i for every i so the remainders get smaller and must eventually reach 0. Now if r N is the last non-zero remainder gcd(r 1, r 0 ) = gcd(r 2, r 1 ) =... = gcd(r N 1, r N ) = gcd(r N, 0) = r N. Problem. Find the greatest common divisor of and and determine integers x and y such that gcd(16579, 30031) = x y Solution. We have gcd(16579, 30031) = = gcd(13452, 16579) = = gcd(3127, 13452) = = gcd(944, 3127) 3127 = = gcd(295, 944) 944 = = gcd(59, 295) 295 = = gcd(0, 59) =

4 and now using the identities in the second column. 59 = = ( ) = = 10( ) = = ( ) = = 53( ) = Modular Arithmetic. Let n be an integer greater than 1. We say that two integers a and b are congruent modulo n and write a b mod n or a n b if a b is an integer multiple of n, i.e. a = b + kn where k is an integer. For example: 17 1 mod mod mod mod 7 n 0 mod n 1 n 1 mod n. Two congruences with the same modulus n can be added, subtracted and multiplied just like ordinary equations. Computer Representation of Integers. In binary encoding, numbers are stored in computer locations as strings of bits. In practice these strings all have the same length so only a finite number of integers can be represented. A common method for distinguishing between positive and negative integers is known as two s complement and permits the replacement of integer subtraction by integer addition. For example, using strings of length 3 (in practice the length is likely to be 32) we can represent 2 3 integers. The 8 integers 4, 3, 2, 1, 0, 1, 2, 3 can be represented as follows: n binary string representing n

5 Here the sign of an integer can be detected from the initial bit (positive integers start with 0, negative ones with 1). If the binary string representing a positive integer m is known then, the string representing m can be found from the fact that m ( (2 N 1) m ) N where 2 N 1 is represented by a string of N 1 s. Equivalently, to find the string representing m we interchange 0 s and 1 s in the string representing m and then add 1. For example, since 3 is represented by 011, then 3 is represented by = 101 In this system arithmetic is carried out modulo 2 N for some N so the answer will be correct only if it can be represented. For N = 32 we can represent 2 32 = integers which allows us to do arithmetic with integers lying between and ABSTRACT Content Integers - Binary, conversion algorithm, division algorithm, Euclidean algorithm, modular arithmetic, 2 s complement Numbers form the basis of all measurement science. In computer science, integers have an especially important role whether as data types in their own right, with corresponding operations of addition and multiplication or, in the case of N, as a tool for analysing the notion of computation itself. Hence an insight into their nature is essential. Concepts such as negative, rational and irrational numbers (all ideas resisted strongly when first created) can be rigorously defined in terms of the natural numbers which can themselves be defined in terms of their algebraic and analytical properties. In this Note we also look at the representation of numbers in bases other than 10 and conversion from one system to another. We also introduce modular arithmetic, a system commonly used by computers to represent negative integers. Two classical but still useful algorithms concerning the properties of integers are also described. The Euclidean algorithm and modular arithmetic are at the heart of many modern data encryption algorithms and so play an important role in data security. History The ancient Egyptians, Greeks, Romans and Babylonians all evolved number systems, although none had a zero. A symbol for zero was introduced from India via Arab mathematicians in about the 8th century AD. This was a vital contribution and allowed a place-value system to be devised on which the decimal system is based. It should be remembered that a number system with base 60 was widely used and lasted from about 1700 BC until about 500 AD. At this time, the Hindus created the decimal system (but without a zero) although using different symbols from those we use today. The 60 based system still survives in our division of the units of time (hours, minutes, seconds) and angle (degrees and minutes). The binary system was first developed by the mathematician and philosopher Leibniz in 17th century. Giuseppe Peano [ ] was an Italian mathematician who was a pioneer in symbolic logic. His concise logical definitions of natural numbers were devised in order to derive a complete system of notation for logic. 1 5

6 Peano s first work in logic, published in 1888, contained his rigorously axiomatically derived postulates for natural numbers. He acknowledged his debt for some of the work to German mathematician Richard Dedekind. Peano s work was used by the English philosopher and mathematician Bertrand Russell. Peano also applied the axiomatic method to other fields, such as geometry, first in 1889 and again in A treatise on this work contained the beginnings of geometrical calculus. Peano provided new definitions of the length of an arc of a curve and of the area of a surface. Formulario mathematico , comprising his work and that of collaborators, contains 4,200 theorems. 1 6

Extending The Natural Numbers. Whole Numbers. Integer Number Set. History of Zero

Extending The Natural Numbers. Whole Numbers. Integer Number Set. History of Zero Whole Numbers Are the whole numbers with the property of addition a group? Extending The Natural Numbers Natural or Counting Numbers {1,2,3 } Extend to Whole Numbers { 0,1,2,3 } to get an additive identity.

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

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

CSE 20: Discrete Mathematics

CSE 20: Discrete Mathematics Spring 2018 Summary So far: Today: Logic and proofs Divisibility, modular arithmetics Number Systems More logic definitions and proofs Reading: All of Chap. 1 + Chap 4.1, 4.2. Divisibility P = 5 divides

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

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer? Chapter 3: Theory of Modular Arithmetic 25 SECTION C Solving Linear Congruences By the end of this section you will be able to solve congruence equations determine the number of solutions find the multiplicative

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

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth Sets We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth century. Most students have seen sets before. This is intended

More information

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer? Chapter 3: Theory of Modular Arithmetic 25 SECTION C Solving Linear Congruences By the end of this section you will be able to solve congruence equations determine the number of solutions find the multiplicative

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

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

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

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

a the relation arb is defined if and only if = 2 k, k

a the relation arb is defined if and only if = 2 k, k DISCRETE MATHEMATICS Past Paper Questions in Number Theory 1. Prove that 3k + 2 and 5k + 3, k are relatively prime. (Total 6 marks) 2. (a) Given that the integers m and n are such that 3 (m 2 + n 2 ),

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

ICS141: Discrete Mathematics for Computer Science I

ICS141: Discrete Mathematics for Computer Science I ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Jan Stelovsky based on slides by Dr. Baek and Dr. Still Originals by Dr. M. P. Frank and Dr. J.L. Gross Provided by

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

COT 3100 Applications of Discrete Structures Dr. Michael P. Frank

COT 3100 Applications of Discrete Structures Dr. Michael P. Frank University of Florida Dept. of Computer & Information Science & Engineering COT 3100 Applications of Discrete Structures Dr. Michael P. Frank Slides for a Course Based on the Text Discrete Mathematics

More information

Chapter 4 Finite Fields

Chapter 4 Finite Fields Chapter 4 Finite Fields Introduction will now introduce finite fields of increasing importance in cryptography AES, Elliptic Curve, IDEA, Public Key concern operations on numbers what constitutes a number

More information

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z: NUMBER SYSTEMS Number theory is the study of the integers. We denote the set of integers by Z: Z = {..., 3, 2, 1, 0, 1, 2, 3,... }. The integers have two operations defined on them, addition and multiplication,

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

Conversions between Decimal and Binary

Conversions between Decimal and Binary Conversions between Decimal and Binary Binary to Decimal Technique - use the definition of a number in a positional number system with base 2 - evaluate the definition formula ( the formula ) using decimal

More information

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. Congruences Let n be a postive integer. The integers a and b are called congruent modulo n if they have the same

More information

Computer Architecture 10. Residue Number Systems

Computer Architecture 10. Residue Number Systems Computer Architecture 10 Residue Number Systems Ma d e wi t h Op e n Of f i c e. o r g 1 A Puzzle What number has the reminders 2, 3 and 2 when divided by the numbers 7, 5 and 3? x mod 7 = 2 x mod 5 =

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

Discrete mathematics is the study of techniques, ideas and modes of

Discrete mathematics is the study of techniques, ideas and modes of CHAPTER 1 Discrete Systems Discrete mathematics is the study of techniques, ideas and modes of reasoning that are indispensable in applied disciplines such as computer science or information technology.

More information

Algebra for error control codes

Algebra for error control codes Algebra for error control codes EE 387, Notes 5, Handout #7 EE 387 concentrates on block codes that are linear: Codewords components are linear combinations of message symbols. g 11 g 12 g 1n g 21 g 22

More information

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

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

More information

MAT 243 Test 2 SOLUTIONS, FORM A

MAT 243 Test 2 SOLUTIONS, FORM A MAT Test SOLUTIONS, FORM A 1. [10 points] Give a recursive definition for the set of all ordered pairs of integers (x, y) such that x < y. Solution: Let S be the set described above. Note that if (x, y)

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

Part IA Numbers and Sets

Part IA Numbers and Sets Part IA Numbers and Sets Definitions Based on lectures by A. G. Thomason Notes taken by Dexter Chua Michaelmas 2014 These notes are not endorsed by the lecturers, and I have modified them (often significantly)

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

1 Overview and revision

1 Overview and revision MTH6128 Number Theory Notes 1 Spring 2018 1 Overview and revision In this section we will meet some of the concerns of Number Theory, and have a brief revision of some of the relevant material from Introduction

More information

Algorithms CMSC Basic algorithms in Number Theory: Euclid s algorithm and multiplicative inverse

Algorithms CMSC Basic algorithms in Number Theory: Euclid s algorithm and multiplicative inverse Algorithms CMSC-27200 Basic algorithms in Number Theory: Euclid s algorithm and multiplicative inverse Instructor: László Babai Last updated 02-14-2015. Z denotes the set of integers. All variables in

More information

4 PRIMITIVE ROOTS Order and Primitive Roots The Index Existence of primitive roots for prime modulus...

4 PRIMITIVE ROOTS Order and Primitive Roots The Index Existence of primitive roots for prime modulus... PREFACE These notes have been prepared by Dr Mike Canfell (with minor changes and extensions by Dr Gerd Schmalz) for use by the external students in the unit PMTH 338 Number Theory. This booklet covers

More information

Beautiful Mathematics

Beautiful Mathematics Beautiful Mathematics 1. Principle of Mathematical Induction The set of natural numbers is the set of positive integers {1, 2, 3,... } and is denoted by N. The Principle of Mathematical Induction is a

More information

Number Systems. There are 10 kinds of people those that understand binary, those that don t, and those that expected this joke to be in base 2

Number Systems. There are 10 kinds of people those that understand binary, those that don t, and those that expected this joke to be in base 2 Number Systems There are 10 kinds of people those that understand binary, those that don t, and those that expected this joke to be in base 2 A Closer Look at the Numbers We Use What is the difference

More information

REVIEW Chapter 1 The Real Number System

REVIEW Chapter 1 The Real Number System REVIEW Chapter The Real Number System In class work: Complete all statements. Solve all exercises. (Section.4) A set is a collection of objects (elements). The Set of Natural Numbers N N = {,,, 4, 5, }

More information

Number Theory Notes Spring 2011

Number Theory Notes Spring 2011 PRELIMINARIES The counting numbers or natural numbers are 1, 2, 3, 4, 5, 6.... The whole numbers are the counting numbers with zero 0, 1, 2, 3, 4, 5, 6.... The integers are the counting numbers and zero

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 8 February 1, 2012 CPSC 467b, Lecture 8 1/42 Number Theory Needed for RSA Z n : The integers mod n Modular arithmetic GCD Relatively

More information

CHAPTER 3. Congruences. Congruence: definitions and properties

CHAPTER 3. Congruences. Congruence: definitions and properties CHAPTER 3 Congruences Part V of PJE Congruence: definitions and properties Definition. (PJE definition 19.1.1) Let m > 0 be an integer. Integers a and b are congruent modulo m if m divides a b. We write

More information

Some Facts from Number Theory

Some Facts from Number Theory Computer Science 52 Some Facts from Number Theory Fall Semester, 2014 These notes are adapted from a document that was prepared for a different course several years ago. They may be helpful as a summary

More information

EDULABZ INTERNATIONAL NUMBER SYSTEM

EDULABZ INTERNATIONAL NUMBER SYSTEM NUMBER SYSTEM 1. Find the product of the place value of 8 and the face value of 7 in the number 7801. Ans. Place value of 8 in 7801 = 800, Face value of 7 in 7801 = 7 Required product = 800 7 = 00. How

More information

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes. INTEGERS PETER MAYR (MATH 2001, CU BOULDER) In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes. 1. Divisibility Definition. Let a, b

More information

Homework #2 solutions Due: June 15, 2012

Homework #2 solutions Due: June 15, 2012 All of the following exercises are based on the material in the handout on integers found on the class website. 1. Find d = gcd(475, 385) and express it as a linear combination of 475 and 385. That is

More information

MATH Fundamental Concepts of Algebra

MATH Fundamental Concepts of Algebra MATH 4001 Fundamental Concepts of Algebra Instructor: Darci L. Kracht Kent State University April, 015 0 Introduction We will begin our study of mathematics this semester with the familiar notion of even

More information

ECE 646 Lecture 5. Mathematical Background: Modular Arithmetic

ECE 646 Lecture 5. Mathematical Background: Modular Arithmetic ECE 646 Lecture 5 Mathematical Background: Modular Arithmetic Motivation: Public-key ciphers RSA as a trap-door one-way function PUBLIC KEY message ciphertext M C = f(m) = M e mod N C M = f -1 (C) = C

More information

Grade 7/8 Math Circles Winter March 20/21/22 Types of Numbers

Grade 7/8 Math Circles Winter March 20/21/22 Types of Numbers Faculty of Mathematics Waterloo, Ontario N2L 3G1 Centre for Education in Mathematics and Computing Grade 7/8 Math Circles Winter 2018 - March 20/21/22 Types of Numbers Introduction Today, we take our number

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

Elementary Number Theory. Franz Luef

Elementary Number Theory. Franz Luef Elementary Number Theory Congruences Modular Arithmetic Congruence The notion of congruence allows one to treat remainders in a systematic manner. For each positive integer greater than 1 there is an arithmetic

More information

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, }

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, } Integers and Division 1 The Integers and Division This area of discrete mathematics belongs to the area of Number Theory. Some applications of the concepts in this section include generating pseudorandom

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 9 September 30, 2015 CPSC 467, Lecture 9 1/47 Fast Exponentiation Algorithms Number Theory Needed for RSA Elementary Number Theory

More information

Number Theory. Modular Arithmetic

Number Theory. Modular Arithmetic Number Theory The branch of mathematics that is important in IT security especially in cryptography. Deals only in integer numbers and the process can be done in a very fast manner. Modular Arithmetic

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

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635 COMP239: Mathematics for Computer Science II Prof. Chadi Assi assi@ciise.concordia.ca EV7.635 The Euclidean Algorithm The Euclidean Algorithm Finding the GCD of two numbers using prime factorization is

More information

MAT246H1S - Concepts In Abstract Mathematics. Solutions to Term Test 1 - February 1, 2018

MAT246H1S - Concepts In Abstract Mathematics. Solutions to Term Test 1 - February 1, 2018 MAT246H1S - Concepts In Abstract Mathematics Solutions to Term Test 1 - February 1, 2018 Time allotted: 110 minutes. Aids permitted: None. Comments: Statements of Definitions, Principles or Theorems should

More information

Lecture 4: Number theory

Lecture 4: Number theory Lecture 4: Number theory Rajat Mittal IIT Kanpur In the next few classes we will talk about the basics of number theory. Number theory studies the properties of natural numbers and is considered one of

More information

Standard forms for writing numbers

Standard forms for writing numbers Standard forms for writing numbers In order to relate the abstract mathematical descriptions of familiar number systems to the everyday descriptions of numbers by decimal expansions and similar means,

More information

Lecture 3.1: Public Key Cryptography I

Lecture 3.1: Public Key Cryptography I Lecture 3.1: Public Key Cryptography I CS 436/636/736 Spring 2015 Nitesh Saxena Today s Informative/Fun Bit Acoustic Emanations http://www.google.com/search?source=ig&hl=en&rlz=&q=keyboard+acoustic+em

More information

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer. CHAPTER 2 INTRODUCTION TO NUMBER THEORY ANSWERS TO QUESTIONS 2.1 A nonzero b is a divisor of a if a = mb for some m, where a, b, and m are integers. That is, b is a divisor of a if there is no remainder

More information

Number Theory: Applications. Number Theory Applications. Hash Functions II. Hash Functions III. Pseudorandom Numbers

Number Theory: Applications. Number Theory Applications. Hash Functions II. Hash Functions III. Pseudorandom Numbers Number Theory: Applications Number Theory Applications Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Results from Number Theory have many applications

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Today's learning goals Determine whether a relation is an equivalence relation by determining whether it is Reflexive Symmetric

More information

NOTES ON SIMPLE NUMBER THEORY

NOTES ON SIMPLE NUMBER THEORY NOTES ON SIMPLE NUMBER THEORY DAMIEN PITMAN 1. Definitions & Theorems Definition: We say d divides m iff d is positive integer and m is an integer and there is an integer q such that m = dq. In this case,

More information

For your quiz in recitation this week, refer to these exercise generators:

For your quiz in recitation this week, refer to these exercise generators: Monday, Oct 29 Today we will talk about inverses in modular arithmetic, and the use of inverses to solve linear congruences. For your quiz in recitation this week, refer to these exercise generators: GCD

More information

Simple Math: Cryptography

Simple Math: Cryptography 1 Introduction Simple Math: Cryptography This section develops some mathematics before getting to the application. The mathematics that I use involves simple facts from number theory. Number theory is

More information

Numbers. Çetin Kaya Koç Winter / 18

Numbers. Çetin Kaya Koç   Winter / 18 Çetin Kaya Koç http://koclab.cs.ucsb.edu Winter 2016 1 / 18 Number Systems and Sets We represent the set of integers as Z = {..., 3, 2, 1,0,1,2,3,...} We denote the set of positive integers modulo n as

More information

What is Binary? Digital Systems and Information Representation. An Example. Physical Representation. Boolean Algebra

What is Binary? Digital Systems and Information Representation. An Example. Physical Representation. Boolean Algebra What is Binary? Digital Systems and Information Representation CSE 102 Underlying base signals are two valued: 0 or 1 true or false (T or F) high or low (H or L) One bit is the smallest unambiguous unit

More information

Algebra. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example.

Algebra. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example. Coding Theory Massoud Malek Algebra Congruence Relation The definition of a congruence depends on the type of algebraic structure under consideration Particular definitions of congruence can be made for

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

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand 1 Divisibility, prime numbers By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a k for some integer k. Notation

More information

cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications

cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications n-bit unsigned integer representation Represent integer x as sum of powers of 2: If x = n 1 i=0 b i 2 i where each b i

More information

The Euclidean Algorithm and Multiplicative Inverses

The Euclidean Algorithm and Multiplicative Inverses 1 The Euclidean Algorithm and Multiplicative Inverses Lecture notes for Access 2009 The Euclidean Algorithm is a set of instructions for finding the greatest common divisor of any two positive integers.

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

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5) CSE 54 Discrete Mathematics & Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices Integers & Algorithms (Section 2.5) by Kenneth H. Rosen, Discrete Mathematics & its Applications,

More information

MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology.

MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology. MATH 501 Discrete Mathematics Lecture 6: Number theory Prof. Dr. Slim Abdennadher, slim.abdennadher@guc.edu.eg German University Cairo, Department of Media Engineering and Technology 1 Number theory Number

More information

CS483 Design and Analysis of Algorithms

CS483 Design and Analysis of Algorithms CS483 Design and Analysis of Algorithms Lectures 2-3 Algorithms with Numbers Instructor: Fei Li lifei@cs.gmu.edu with subject: CS483 Office hours: STII, Room 443, Friday 4:00pm - 6:00pm or by appointments

More information

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24 Direct Proof MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Direct Proof Fall 2014 1 / 24 Outline 1 Overview of Proof 2 Theorems 3 Definitions 4 Direct Proof 5 Using

More information

NUMBERS AND CODES CHAPTER Numbers

NUMBERS AND CODES CHAPTER Numbers CHAPTER 2 NUMBERS AND CODES 2.1 Numbers When a number such as 101 is given, it is impossible to determine its numerical value. Some may say it is five. Others may say it is one hundred and one. Could it

More information

Section 4.2. Place-Value or Positional- Value Numeration Systems. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

Section 4.2. Place-Value or Positional- Value Numeration Systems. Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 4.2 Place-Value or Positional- Value Numeration Systems What You Will Learn Place-Value or Position-Value Numeration Systems 4.2-2 Place-Value System (or Positional-Value System) The value of the

More information

Beyond Whole Number Bases

Beyond Whole Number Bases Beyond Whole Number Bases Figure 1: Here is a Venn diagram representing the various subsets of the real numbers. As you can see there are many types of real numbers, why restrict ourselves to positive

More information

C-N Math 207 Discrete Math

C-N Math 207 Discrete Math C-N Math 207 - Massey, 1 / 70 C-N Math 207 Discrete Math Kenneth Massey September 16, 2011 Question C-N Math 207 - Massey, 2 / 70 Introduction What is the smallest positive number? Sets C-N Math 207 -

More information

C-N Math 207 Discrete Math

C-N Math 207 Discrete Math C-N Math 207 Discrete Math Kenneth Massey September 16, 2011 C-N Math 207 - Massey, 1 / 70 Question Introduction What is the smallest positive number? C-N Math 207 - Massey, 2 / 70 Sets Introduction a

More information

Ch 4.2 Divisibility Properties

Ch 4.2 Divisibility Properties Ch 4.2 Divisibility Properties - Prime numbers and composite numbers - Procedure for determining whether or not a positive integer is a prime - GCF: procedure for finding gcf (Euclidean Algorithm) - Definition:

More information

Number Theory and Group Theoryfor Public-Key Cryptography

Number Theory and Group Theoryfor Public-Key Cryptography Number Theory and Group Theory for Public-Key Cryptography TDA352, DIT250 Wissam Aoudi Chalmers University of Technology November 21, 2017 Wissam Aoudi Number Theory and Group Theoryfor Public-Key Cryptography

More information

Introduction to Information Security

Introduction to Information Security Introduction to Information Security Lecture 5: Number Theory 007. 6. Prof. Byoungcheon Lee sultan (at) joongbu. ac. kr Information and Communications University Contents 1. Number Theory Divisibility

More information

Elementary Number Theory Review. Franz Luef

Elementary Number Theory Review. Franz Luef Elementary Number Theory Review Principle of Induction Principle of Induction Suppose we have a sequence of mathematical statements P(1), P(2),... such that (a) P(1) is true. (b) If P(k) is true, then

More information

2.5 정수와알고리즘 (Integers and Algorithms)

2.5 정수와알고리즘 (Integers and Algorithms) 이산수학 () 2.5 정수와알고리즘 (Integers and Algorithms) 2006 년봄학기 문양세강원대학교컴퓨터과학과 Introduction Base-b representations of integers. (b진법표현 ) Especially: binary, hexadecimal, octal. Also, two s complement representation

More information

MATH 115 Concepts in Mathematics

MATH 115 Concepts in Mathematics South Central College MATH 115 Concepts in Mathematics Course Outcome Summary Course Information Description Total Credits 4.00 Total Hours 64.00 Concepts in Mathematics is a general education survey course

More information

Base-b representations of integers. (b 진법표현 ) Algorithms for computer arithmetic: Euclidean algorithm for finding GCD s.

Base-b representations of integers. (b 진법표현 ) Algorithms for computer arithmetic: Euclidean algorithm for finding GCD s. 이산수학 () 정수와알고리즘 (Integers and Algorithms) 2011년봄학기 강원대학교컴퓨터과학전공문양세 Introduction Base-b representations of integers. (b 진법표현 ) Especially: binary, hexadecimal, octal. Also, two s complement representation

More information

Notes. Number Theory: Applications. Notes. Number Theory: Applications. Notes. Hash Functions I

Notes. Number Theory: Applications. Notes. Number Theory: Applications. Notes. Hash Functions I Number Theory: Applications Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Fall 2007 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 3.4 3.7 of Rosen cse235@cse.unl.edu

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

Number Theory. Introduction

Number Theory. Introduction Number Theory Introduction Number theory is the branch of algebra which studies the properties of the integers. While we may from time to time use real or even complex numbers as tools to help us study

More information

Introduction to Number Theory. The study of the integers

Introduction to Number Theory. The study of the integers Introduction to Number Theory The study of the integers of Integers, The set of integers = {... 3, 2, 1, 0, 1, 2, 3,...}. In this lecture, if nothing is said about a variable, it is an integer. Def. We

More information

C.T.Chong National University of Singapore

C.T.Chong National University of Singapore NUMBER THEORY AND THE DESIGN OF FAST COMPUTER ALGORITHMS C.T.Chong National University of Singapore The theory of numbers has long been considered to be among the purest of pure mathematics. Gauss ( 1777-1855)

More information

MATH 361: NUMBER THEORY FOURTH LECTURE

MATH 361: NUMBER THEORY FOURTH LECTURE MATH 361: NUMBER THEORY FOURTH LECTURE 1. Introduction Everybody knows that three hours after 10:00, the time is 1:00. That is, everybody is familiar with modular arithmetic, the usual arithmetic of the

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

Finite Fields. Mike Reiter

Finite Fields. Mike Reiter 1 Finite Fields Mike Reiter reiter@cs.unc.edu Based on Chapter 4 of: W. Stallings. Cryptography and Network Security, Principles and Practices. 3 rd Edition, 2003. Groups 2 A group G, is a set G of elements

More information

Number Theory A focused introduction

Number Theory A focused introduction Number Theory A focused introduction This is an explanation of RSA public key cryptography. We will start from first principles, but only the results that are needed to understand RSA are given. We begin

More information