CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague 27 October, CS1800 Discrete Structures Midterm Version A

Similar documents
CS1800 Discrete Structures Fall 2017 October, CS1800 Discrete Structures Midterm Version A

CS1800 Discrete Structures Fall 2016 Profs. Gold & Schnyder April 25, CS1800 Discrete Structures Final

CS1800 Discrete Structures Final Version A

MATH3302 Cryptography Problem Set 2

Fall 2017 September 20, Written Homework 02

Discrete Mathematics GCD, LCM, RSA Algorithm

CS1800 Discrete Structures Spring 2018 February CS1800 Discrete Structures Midterm Version A

Written examination. Tuesday, August 18, 2015, 08:30 a.m.

Midterm 2. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:

Mathematical Foundations of Public-Key Cryptography

Solutions to the Midterm Test (March 5, 2011)

Discrete Mathematics and Probability Theory Summer 2014 James Cook Midterm 1 (Version B)

Math 223, Spring 2009 Final Exam Solutions

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

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

University of Regina Department of Mathematics & Statistics Final Examination (April 21, 2009)

Notation Index. gcd(a, b) (greatest common divisor) NT-16

Introduction to Cybersecurity Cryptography (Part 5)

Number theory (Chapter 4)

Introduction to Public-Key Cryptosystems:

Public Key Cryptography

Implementation Tutorial on RSA

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

CPE 776:DATA SECURITY & CRYPTOGRAPHY. Some Number Theory and Classical Crypto Systems

Definition: For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Ahmet Burak Can Hacettepe University

3 The fundamentals: Algorithms, the integers, and matrices

basics of security/cryptography

Encryption: The RSA Public Key Cipher

Cryptography. pieces from work by Gordon Royle

Solution to Midterm Examination

4 Number Theory and Cryptography

Module 2 Advanced Symmetric Ciphers

Lecture 6: Introducing Complexity

Total Time = 90 Minutes, Total Marks = 50. Total /50 /10 /18

Discrete Mathematics and Probability Theory Summer 2014 James Cook Midterm 1

CSC 125 :: Final Exam December 14, 2011

Week No. 06: Numbering Systems

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

Question: Total Points: Score:

CS483 Design and Analysis of Algorithms

Final Exam Math 105: Topics in Mathematics Cryptology, the Science of Secret Writing Rhodes College Tuesday, 30 April :30 11:00 a.m.

COMP4109 : Applied Cryptography

10 Modular Arithmetic and Cryptography

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

UC Berkeley, CS 174: Combinatorics and Discrete Probability (Fall 2008) Midterm 1. October 7, 2008

Solution to Problem Set 3

Overview. Background / Context. CSC 580 Cryptography and Computer Security. March 21, 2017

Math 430 Midterm II Review Packet Spring 2018 SOLUTIONS TO PRACTICE PROBLEMS

Exam Security January 19, :30 11:30

Mathematics of Cryptography

8. Given a rational number r, prove that there exist coprime integers p and q, with q 0, so that r = p q. . For all n N, f n = an b n 2

ECE596C: Handout #11

Theme : Cryptography. Instructor : Prof. C Pandu Rangan. Speaker : Arun Moorthy CS

ICS141: Discrete Mathematics for Computer Science I

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1).

University of Florida EEL 3701 Fall 2014 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Wednesday, 15 October 2014

Introduction to Modern Cryptography. Benny Chor

Outline. Number Theory and Modular Arithmetic. p-1. Definition: Modular equivalence a b [mod n] (a mod n) = (b mod n) n (a-b)

Real scripts backgrounder 3 - Polyalphabetic encipherment - XOR as a cipher - RSA algorithm. David Morgan

Introduction to Cybersecurity Cryptography (Part 4)

CIS 551 / TCOM 401 Computer and Network Security

7. Prime Numbers Part VI of PJE

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

Introduction to Cybersecurity Cryptography (Part 4)

Cryptography and RSA. Group (1854, Cayley) Upcoming Interview? Outline. Commutative or Abelian Groups

Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013

University of Florida EEL 3701 Summer 2015 Dr. Eric. M. Schwartz Department of Electrical & Computer Engineering Tuesday, 30 June 2015

Public Key Encryption

Number Theory and Algebra: A Brief Introduction

Security Issues in Cloud Computing Modern Cryptography II Asymmetric Cryptography

University of New Mexico Department of Computer Science. Midterm Examination. CS 261 Mathematical Foundations of Computer Science Spring, 2010

Part IA Numbers and Sets

Cryptography. P. Danziger. Transmit...Bob...

Number theory. Myrto Arapinis School of Informatics University of Edinburgh. October 9, /29

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

Solutions to the Mathematics Masters Examination

University of Regina Department of Mathematics and Statistics Math (Fall 2013) Final Exam December 10, 2013

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

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

COMS W4995 Introduction to Cryptography September 29, Lecture 8: Number Theory

Exercise Sheet Cryptography 1, 2011

The RSA Cipher and its Algorithmic Foundations

Discrete Mathematics and Probability Theory Summer 2015 Chung-Wei Lin Midterm 1

Number Theory: Representations of Integers

Topics in Cryptography. Lecture 5: Basic Number Theory

Public Key Cryptography. All secret key algorithms & hash algorithms do the same thing but public key algorithms look very different from each other.

Fundamentals of Digital Design

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2

Powers in Modular Arithmetic, and RSA Public Key Cryptography

Cryptography: A Fairy Tale for Mathematicians and Starring Mathematicians!

Introduction to Cryptography. Lecture 6

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

Conversions between Decimal and Binary

RSA. Ramki Thurimella

University of Florida EEL 3701 Fall 1996 Dr. Eric M. Schwartz

CSE 311: Foundations of Computing. Lecture 12: Two s Complement, Primes, GCD

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE

Name: Mathematics 1C03

Do not start until you are given the green signal

ECE 646 Lecture 5. Motivation: Mathematical Background: Modular Arithmetic. Public-key ciphers. RSA keys. RSA as a trap-door one-way function

Transcription:

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague 27 October, 2016 CS1800 Discrete Structures Midterm Version A Instructions: 1. The exam is closed book and closed notes. You may not use a calculator or any other electronic device. 2. The exam is worth 100 total points. The points for each problem are given in the problem statement and in the table below. 3. You should write your answers in the space provided; use the back sides of these sheets, if necessary. 4. You have two hours to complete the exam. Section Title Points Section 1[15 points] Binary and Hexadecimal Section 2 [10 points] Logic Section 3 [12 points] Modular Arithmetic Section 4 [10 points] Primes and GCDs Section 5 [8 points] Modular Arithmetic Algorithms Section 6 [20 points] Sets Section 7 [8 points] Counting Section 8 [17 points] Permutations and Combinations Total Name: Recitation Time/Loc: NU ID#: Recitation TA: 1

Section 1 [15 pts (5,3,2,5)]: Binary and Hexadecimal 1. Write the number 30 (base 10) in (a) 8 digits of binary and (b) 2 digits of hexadecimal. Sol: (a) 00011110 (b) 0x1e 2. Convert the two s complement number 11110000 to decimal. Sol: -16 3. How many 1 s are in the binary representation of the eight digit hex number 0xFFFFFFFE? (You shouldn t need to convert a large number to binary to answer this.) Sol: 4 per F plus 3 for the E = 31 4. Assume we are using two s complement, and add 11110000 and 00001111. Express the result (again interpreted as two s complement) in decimal. Sol: 11110000 + 00001111 = 11111111 = -1 2

Section 2 [10 pts (4, 2, 4)]: Logic 1. Write a truth table for the formula (a b) (a b). Sol: a b Out 0 0 0 0 1 1 1 0 1 1 1 0 2. Give the name of the logical operator that is equivalent to the formula of the preceding question. Sol: XOR 3. Use the truth table to construct an equivalent formula to the one in the first question in disjunctive normal form (clauses containing and s joined by or s). Sol: ( a b) (a b) 3

Section 3 [12 pts (5,2,5)]: Modular Arithmetic 1. Use fast exponentiation (repeated squaring) to find 2 30 (mod 7). Show your work; if you see another method besides fast exponentiation, you may use it only to check your work. Sol: 1 (clear from Fermat s Little Theorem); 2 2 = 4, 2 4 = 2, 2 8 = 4, 2 16 = 2, 2 4 2 4 = 4 4 4 = 2 4 = 8 = 1 2. Fill in the blank: a has a multiplicative inverse mod n if and only if a and n are Sol: relatively prime or coprime or synonyms thereof. 3. Derive a formula for φ(n) = {x : x N, 1 x n, gcd(x, n) = 1} when n = p i for some prime p. Sol: (p 1)p i 1, or equivalently, p i p i 1 4

Section 4 [10 pts (4,2,4)]: Primes and GCDs 1. If the prime factorization of m is p 2 q 5 r 10 and the prime factorization of n is pq 10 r 2 s 5, where p, q, r, and s are primes, find (a) gcd(m,n) and (b) lcm(m,n). Sol: (a) pq 5 r 2 (b) p 2 q 10 r 10 s 5 2. What is the prime factorization of 60? Sol: 2 2 3 5 3. Use Euclid s algorithm to find the gcd of 143 and 121. Show your work. Sol: 143 mod 121 = 22, 121 mod 22 = 11, 22 mod 11 = 0, so: 11 5

Section 5 [8 pts (2, 1, 5)]: Modular Arithmetic Algorithms 1. Find two messages (numbers) whose ciphertext is the same as their plaintext for any RSA key (e, n). Sol: 0 and 1 2. If (e, n) is some RSA public key and d is the matching private key, simplify M 100ed mod n. Sol: M 100 mod n 3. If an equation describing a linear cipher is y = 9x mod 26, write an equation for decryption x =.... You must use the Extended Euclidean algorithm and show your work for full credit. Sol: x = 3y mod 26 6

Section 6 [20 pts (2,2,2,2,3,3,3,3)]: Sets Assume for the following questions that A = {1, 2, 3}, B = {3, 4, 5}, C = {5, 6, 7}, and the universe U = {x : x N, 0 x 10}. 1. What is (A B) C? Sol: {3, 5, 6, 7} 2. What is A (B C)? Sol: {3} 3. What is A B C? Sol: or {} or empty set 4. What is B A? Sol: {4, 5} 5. What is A B C? Sol: {0, 8, 9, 10} 6. What is (A B) (B A)? Sol: {(3, 3)} 7. What is the power set P((B A) C)? Sol: {, {4}} 8. What is P(A)? Sol: 8 7

Section 7 [8 pts (4, 4)]: Counting 1. How many 8-bit numbers either start or end with a 1 in binary? (10000000 starts with a 1, but 01000000 does not.) Sol: 2 7 start + 2 7 end - 2 6 in intersection = 256-64 = 192 2. (a) How many students must be in the same room to be certain two of them share a birthday month? (b) What is the name of the specific kind of logical reasoning used here? Sol: (a) 13 (b) the Pigeonhole Principle 8

Section 8 [17 pts (4, 4, 5, 4)]: Permutations and Combinations 1. How many ways can five people arrange themselves so that one of them is taking a photo, and the other four are in some order from left to right that counts as a different photo for different orderings? (Calculate the number.) Sol: 5! = 120 2. How many 8-bit numbers have exactly half their bits set to 1? (Again, calculate the actual number; giving an expression is partal credit. Cancellation of terms will help you.) ) Sol: = 70 ( 8 4 3. How many 4-digit PINs composed of digits 0 through 9 have exactly two 9 s? (Again, calculate an exact answer for full credit.) ) Sol: 9 9 = 6 81 = 486 ( 4 2 4. How many ways are there to merge the sorted lists (1, 2, 3, 4) and (A, B, C, D) into a sequence of 8 symbols where all elements of each list are still in the correct order? (For example, AB12C34D is such a sequence, but ABDC1234 is not, only because D and C are out of order.) ) Sol: = 70 ( 8 4 9