CSE 311 Foundations of Computing I

Slides:



Advertisements
Similar presentations
Lecture 1 RMIT University, Taylor's University Learning Objectives
Advertisements

Prof. Johnnie Baker Module Basic Structures: Sets
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Instructor: Hayk Melikya
CSE115/ENGR160 Discrete Mathematics 03/13/12 Ming-Hsuan Yang UC Merced 1.
Number Theory and Cryptography
Sets 1.
Sets 1.
CSE 321 Discrete Structures Winter 2008 Lecture 8 Number Theory: Modular Arithmetic.
SETS A set B is a collection of objects such that for every object X in the universe the statement: “X is a member of B” Is a proposition.
Survey of Mathematical Ideas Math 100 Chapter 2
Survey of Mathematical Ideas Math 100 Chapter 2 John Rosson Thursday January 25, 2007.
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 2): The Fundamentals: Algorithms, the.
9/2/2015Discrete Structures1 Let us get into… Number Theory.
February 24, 2015Applied Discrete Mathematics Week 4: Number Theory 1 Modular Arithmetic Let a be an integer and m be a positive integer. We denote by.
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
MATH 224 – Discrete Mathematics
CompSci 102 Discrete Math for Computer Science February 16, 2012 Prof. Rodger.
Chapter The Integers and Division Division
Foundations of Computing I CSE 311 Fall It’s Boolean algebra again Definition for  based on  Definition for  based on  Complement works like.
CompSci 102 Discrete Math for Computer Science
CSE 311 Foundations of Computing I Lecture 9 Proofs and Set Theory Autumn 2012 CSE
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Chapter 2 With Question/Answer Animations. Section 2.1.
Introduction to Set theory. Ways of Describing Sets.
CSE 311 Foundations of Computing I Lecture 10 Set Theory Autumn 2012 Autumn 2012CSE
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Discrete Mathematics Set.
Foundations of Computing I CSE 311 Fall Review: Division Theorem Let a be an integer and d a positive integer. Then there are unique integers q.
CSE 311: Foundations of Computing Fall 2013 Lecture 11: Modular arithmetic and applications.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Divisibility and Modular Arithmetic
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
Ch04-Number Theory and Cryptography 1. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic.
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.
Week 8 - Wednesday.  What did we talk about last time?  Relations  Properties of relations  Reflexive  Symmetric  Transitive.
CSE 311 Foundations of Computing I Lecture 12 Modular Arithmetic and Applications Autumn 2012 CSE
CSE 311 Foundations of Computing I Lecture 11 Modular Exponentiation and Primes Autumn 2011 CSE 3111.
CSE 311: Foundations of Computing Fall 2013 Lecture 9: Set theory and functions.
Chapter 3 The Fundamentals: Algorithms, the integers, and matrices Section 3.4: The integers and division Number theory: the part of mathematics involving.
Number Theory. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic principles of divisibility,
Set. Outline Universal Set Venn Diagram Operations on Sets.
Lesson 2-18 AP Computer Science Principles
CS 210 Discrete Mathematics The Integers and Division (Section 3.4)
Lecture 04 Set Theory Profs. Koike and Yukita
CSE15 Discrete Mathematics 03/15/17
Computer Communication & Networks
Introduction to Cryptography
CSE 311 Foundations of Computing I
Number Theory and Cryptography
CSE 311 Foundations of Computing I
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Set Operations Section 2.2.
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CSE 311: Foundations of Computing
CSE 311 Foundations of Computing I
CSE 321 Discrete Structures
CSE 321 Discrete Structures
Discrete Math for CS CMPSC 360 LECTURE 14 Last time:
Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007
CSE 321 Discrete Structures
Copyright © Zeph Grunschlag,
Number Theory.
CSE 321 Discrete Structures
Presentation transcript:

CSE 311 Foundations of Computing I Lecture 10 Divisibility and Modular Arithmetic Autumn 2011 Autumn 2011 CSE 311

Announcements Reading assignments Homework 4 Today: Coming soon . . . 4.1-4.2 7th Edition 3.4, 3.6 up to p. 227 6th Edition 2.4, 2.5 up to p. 177 5th Edition Homework 4 Coming soon . . . Autumn 2011 CSE 311

Highlights from last lecture Set theory and ties to logic Lots of terminology Complement, Universe of Discourse, Cartesian Product, Cardinality, Power Set, Empty Set, N, Z, Z+, Q, R, Subset, Proper Subset, Venn Diagram, Set Difference, Symmetric Difference, De Morgan’s Laws, Distributive Laws Bit vector representation of characteristic functions Bitwise operations for Set operations Autumn 2011 CSE 311

Unix/Linux file permissions ls –l drwxr-xr-x ... Documents/ -rw-r--r-- ... file1 Permissions maintained as bit vectors Letter means bit is 1 - means bit is 0. How is chmod og+r implemented? Autumn 2011 CSE 311

A simple identity If x and y are bits: (x  y)  y = ? What if x and y are bit-vectors? Autumn 2011 CSE 311

Private Key Cryptography Alice wants to be able to communicate message secretly to Bob so that eavesdropper Eve who hears their conversation, cannot tell what Alice’s message is Alice and Bob can get together and privately share a secret key K ahead of time. Autumn 2011 CSE 311

One-time pad Later, Alice has n-bit message m to send to Bob Alice and Bob privately share random n-bit vector K Eve does not know K Later, Alice has n-bit message m to send to Bob Alice computes C = m  K Alice sends C to Bob Bob computes m = C  K which is (m  K)  K Eve cannot figure out m from C unless she can guess K Autumn 2011 CSE 311

Russell’s Paradox S = { x | x  x } /

Number Theory (and applications to computing) Branch of Mathematics with direct relevance to computing Many significant applications Cryptography Hashing Security Important tool set

Modular Arithmetic Arithmetic over a finite domain In computing, almost all computations are over a finite domain

What are the values computed? [-128, 127] public void Test1() { byte x = 250; byte y = 20; byte z = (byte) (x + y); Console.WriteLine(z); } public void Test2() { sbyte x = 120; sbyte y = 20; sbyte z = (sbyte) (x + y); Console.WriteLine(z); } 14 -116

Autumn 2011 CSE 311

Arithmetic mod 7 a +7 b = (a + b) mod 7 a 7 b = (a  b) mod 7 + 1 2 3 1 2 3 4 5 6 X 1 2 3 4 5 6

Divisibility Integers a, b, with a ≠ 0, we say that a divides b is there is an integer k such that b = ak. The notation a | b denotes a divides b. Autumn 2011 CSE 311

Division Theorem Let a be an integer and d a positive integer. Then there are unique integers q and r, with 0 ≤ r < d, such that a = dq + r. q = a div d r = a mod d Note: r ≥ 0 even if a < 0. Not quite the same as a%d Autumn 2011 CSE 311

Modular Arithmetic Let a and b be integers, and m be a positive integer. We say a is congruent to b modulo m if m divides a – b. We use the notation a ≡ b (mod m) to indicate that a is congruent to b modulo m. Autumn 2011 CSE 311

Modular arithmetic Let a and b be integers, and let m be a positive integer. Then a ≡ b (mod m) if and only if a mod m = b mod m. Autumn 2011 CSE 311

Modular arithmetic Let m be a positive integer. If a ≡ b (mod m) and c ≡ d (mod m), then a + c ≡ b + d (mod m) and ac ≡ bd (mod m) Autumn 2011 CSE 311

Example Let n be an integer, prove that n2 ≡ 0 (mod 4) or n2 ≡ 1 (mod 4) Autumn 2011 CSE 311