CS1800 Discrete Structures Fall 2017 October 25, CS1800 Discrete Structures Midterm Version B

Similar documents
CS1800 Discrete Structures Fall 2017 October 25, CS1800 Discrete Structures Midterm Version B

CS1800 Discrete Structures Summer 2017 Prof. Schnyder May 26, CS1800 Discrete Structures Midterm Practice Exam

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague December 16, CS1800 Discrete Structures Final

CS1800 Discrete Structures Final Version A

CS1800 Discrete Structures Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague December 16, CS1800 Discrete Structures Final

CS1800 Discrete Structures Final Version B

ECE 2030B 1:00pm Computer Engineering Spring problems, 5 pages Exam Two 10 March 2010

ECE 2030D Computer Engineering Spring problems, 5 pages Exam Two 8 March 2012

CS1800 Discrete Structures Spring 2017 Profs. Gold & Schnyder April 28, CS1800 Discrete Structures Final

r=1 The Binomial Theorem. 4 MA095/98G Revision

CSE 20 DISCRETE MATH. Fall

DISCRETE MATHEMATICS

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two 26 February 2014

Summary of Course Coverage

Brief History. Graph Theory. What is a graph? Types of graphs Directed graph: a graph that has edges with specific directions

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM

CSE 20 DISCRETE MATH. Winter

1. (15 points) Solve the decanting problem for containers of sizes 199 and 179; that is find integers x and y satisfying.

LECTURE NOTES ON PUBLIC- KEY CRYPTOGRAPHY. (One-Way Functions and ElGamal System)

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics. Numbers & Number Systems

Public-key encipherment concept

! Addition! Multiplication! Bigger Example - RSA cryptography

ECE 2020B Fundamentals of Digital Design Spring problems, 6 pages Exam Two Solutions 26 February 2014

Discrete Structures. Fall Homework3

Number System. Introduction. Decimal Numbers

Introduction to Computer Science-103. Midterm

Public Key Algorithms

Admin ENCRYPTION. Admin. Encryption 10/29/15. Assignment 6. 4 more assignments: Midterm next Thursday. What is it and why do we need it?

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

About the Author. Dependency Chart. Chapter 1: Logic and Sets 1. Chapter 2: Relations and Functions, Boolean Algebra, and Circuit Design

Public Key Cryptography and RSA

ECE 646 Fall 2009 Final Exam December 15, Multiple-choice test

Lecture 2 Algorithms with numbers

CS Network Security. Nasir Memon Polytechnic University Module 7 Public Key Cryptography. RSA.

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

Chapter 9. Public Key Cryptography, RSA And Key Management

RSA (material drawn from Avi Kak Lecture 12, Lecture Notes on "Computer and Network Security" Used in asymmetric crypto.

CS669 Network Security

Number Theory Open, Round 1 Test #101

1 Elementary number theory

Discrete mathematics , Fall Instructor: prof. János Pach

Public Key Algorithms

Number Systems. Both numbers are positive

Introduction to Sets and Logic (MATH 1190)

Public Key Cryptography

Algorithms (III) Yu Yu. Shanghai Jiaotong University

Fundamentals of Programming Session 2

Euclid's Algorithm. MA/CSSE 473 Day 06. Student Questions Odd Pie Fight Euclid's algorithm (if there is time) extended Euclid's algorithm

ECE 341 Midterm Exam

Algorithms (III) Yijia Chen Shanghai Jiaotong University

Integers and Mathematical Induction

Advanced Computer Architecture-CS501

Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

Understanding Cryptography by Christof Paar and Jan Pelzl. Chapter 9 Elliptic Curve Cryptography

Overview. Public Key Algorithms I

Elements of Cryptography and Computer and Networking Security Computer Science 134 (COMPSCI 134) Fall 2016 Instructor: Karim ElDefrawy

Computer Security. 08. Cryptography Part II. Paul Krzyzanowski. Rutgers University. Spring 2018

1. Chapter 1, # 1: Prove that for all sets A, B, C, the formula

Lecture 6: Overview of Public-Key Cryptography and RSA

CS/EE1012 INTRODUCTION TO COMPUTER ENGINEERING SPRING 2013 HOMEWORK I. Solve all homework and exam problems as shown in class and sample solutions

Math Introduction to Advanced Mathematics

UNCA CSCI 255 Exam 1 Spring February, This is a closed book and closed notes exam. It is to be turned in by 1:45 PM.

Discrete Mathematics SECOND EDITION OXFORD UNIVERSITY PRESS. Norman L. Biggs. Professor of Mathematics London School of Economics University of London

University of Waterloo Department of Electrical and Computer Engineering ECE250 Algorithms and Data Structures Fall 2014

Time: 8:30-10:00 pm (Arrive at 8:15 pm) Location What to bring:

BINARY SYSTEM. Binary system is used in digital systems because it is:

ENEL Digital Circuits Midterm Examination

Number Systems CHAPTER Positional Number Systems

Solutions to Final. Solutions to Final. May 18th CS170 David Wolfe ALWAYS TRUE SOMETIMES TRUE NEVER TRUE

4/8/17. Admin. Assignment 5 BINARY. David Kauchak CS 52 Spring 2017

STUDENT NUMBER: MATH Final Exam. Lakehead University. April 13, Dr. Adam Van Tuyl

CDS130 Mid-term exam: Sample

Discrete Mathematics and Probability Theory Spring 2017 Rao Midterm 2

Chapter 3: Arithmetic for Computers

Honors Precalculus: Solving equations and inequalities graphically and algebraically. Page 1

Math Exam 2 Solutions. Problem 1 (8 points) Problem 2 (8 points) Problem 3 (12 points) Problem 4 (26 points) Problem 5 (14 points)

Midterm 1. CS Intermediate Data Structures and Algorithms. October 23, 2013

U.C. Berkeley CS170 : Algorithms, Fall 2013 Midterm 1 Professor: Satish Rao October 10, Midterm 1 Solutions

Algorithmic number theory Cryptographic hardness assumptions. Table of contents

Introduction to Cryptography and Security Mechanisms: Unit 5. Public-Key Encryption

Number representations

Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc.

Korea University of Technology and Education

Module 7 Highlights. Mastered Reviewed. Sections ,

CS 31: Intro to Systems Binary Representation. Kevin Webb Swarthmore College September 6, 2018

Midterm Exam Review. CS 2420 :: Fall 2016 Molly O'Neil

CS 121 Digital Logic Design. Chapter 1. Teacher Assistant. Hadeel Al-Ateeq

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Section A Arithmetic ( 5) Exercise A

CS 341 Homework 1 Basic Techniques

Arithmetic Processing

Computer Security 3/23/18

3/22/17. Admin. Assignment 6 ENCRYPTION. David Kauchak CS52 Spring Survey: How is the class going? Survey: respondents. 24 total respondents

Lecture 8 Mathematics

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

Transcription:

CS1800 Discrete Structures Fall 2017 October 25, 2017 Instructions: CS1800 Discrete Structures Midterm Version B 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[14 points] Binary, Octal, and Hexadecimal Section 2 [12 points] Logic Section 3 [14 points] Modular Arithmetic & Algorithms Section 4 [12 points] Modular Cryptosystems Section 5 [6 points] Sets Section 6 [12 points] Counting Section 7 [15 points] Permutations and Combinations Section 8 [15 points] Proofs Total Name: Instructor: NU ID#: 1

Section 1 [14 pts (6, 3, 2, 3)]: Binary, Octal, and Hexadecimal 1. Convert the base 2 number 101011 to (a) decimal, (b) hexadecimal, (c) octal (base 8). Solution: (a) 1+2+8+32 = 43. (b) 2B (by converting binary 10 and 1011). (c) 53 (by converting binary 101 and 011). 2. Find the 8-bit two s complement representation of 37. Solution: Flip 00100101 to 11011010, add 1 to get the answer: 11011011. 3. Assuming we are using an 8-bit two s complement representation, name the smallest positive value that would produce overflow when added to the number 4. Solution: 124 4. Suppose we add the decimal numbers 119 and 13 using 8-bit two s complement arithmetic. What is the result (expressed in decimal notation)? Solution: 01110111 + 00001101 = 10000100, which is two s complement for -124. 2

Section 2 [12 pts (4, 4, 4)]: Logic 1. Simplify the expression (a b) (a ( b a)) Solution: a 2. Draw a logical circuit with three inputs that evaluates to true exactly when at least two of its three inputs are true. Solution: 3. Rewrite the expression a b c using only (or) and (not) operators instead of (and). Solution: ( a b c) 3

Section 3 [14 pts (5,3,3,3)]: Modular Arithmetic and Algorithms 1. (a) Use fast exponentiation (repeated squaring) to compute 4 16 mod 11. Solution: 4 2 = 16 = 5 4 4 = 5 2 = 25 = 3 4 8 = 3 2 = 9 4 16 = 9 2 = 81 = 4 (b) Use your work from the previous problem to compute 4 22 mod 11. Solution: This is (4 16 )(4 4 )(4 2 ) mod 11 = (4 3 5) mod 11 = 60 mod 11 = 5. 2. Find the GCD of 8100 and 1800, using whatever method you prefer. Solution: One is 9*9*100 and the other is 2*9*100, so: 900. 3. Use Euclid s algorithm to find gcd(253, 175). Show all steps. Solution: gcd(253, 175) = gcd(175,78) = gcd(78,19) = gcd(19,2) = gcd(2,1) = 1 4. How many integers between 1 and 128 are relatively prime to 128? Solution: 64 4

Section 4 [12 pts (5, 4, 3)]: Modular Cryptosystems 1. Find coefficients a and b for the decryption function x = ay + b mod 26 of the linear cipher y = 5x + 15 mod 26. Solution: a = 21, b = 23 2. Suppose that the RSA public key (7, 33) has been used to produce ciphertext 2. (a) What is the private key? Solution: 3 (b) Decrypt the message. Solution: 2 3 = 8 5

Section 5 [6 pts (2,2,2)]: Sets If our universe is the integers Z, and O represents all odd integers, and S represents the set of integers divisible by 7, describe the following sets using union, intersection, and complement. 1. The set of all odd integers divisible by 7. Solution: O S 2. The set of all even integers. Solution: O 3. The set of all integers that are even or divisible by 7. Solution: O S 6

Section 6 [12 pts (4, 4, 4)]: Counting For this section and the next, you can leave your answer unsimplified, but at least give the numbers to multiply. 1. A movie theater has three showtimes this Saturday: morning, afternoon, and evening and 20 movies to choose from. (a) In how many ways can it select a different movie for each time slot? Solution: P(20,3) = 20!/17! = 20*19*18 = 6840.. (b) In how many ways can it select a movie for each time slot, possibly with repetition, so that not all movies are the same? Solution: 20 3 20 = 7980. 2. Suppose that the movie theater sold 700 tickets last Saturday. How many people, at least, attended the most popular of the three shows? Solution: ceiling(700/3) = 234 7

Section 7 [15 pts (3, 3, 4, 5)]: Permutations and Combinations In this section as well, you need not multiply out your answer. In a certain country, license plates consist of three vowels (from A, E, I, O, U) and three digits (from 0, 1,..., 9). 1. How many license plates are possible if the three vowels must precede the three digits and repetitions are allowed? For example, AAU577 is a valid license plate but A5AU77 is not. Solution: 5 3 10 3 2. How many license plates are possible if the three vowels must precede the three digits and repetitions are not allowed? For example, AEU579 is a valid license plate but A5EU79 is not. Solution: P(5,3)*P(10,3) = 5*4*3*10*9*8 3. How many license plates are possible if the three vowels may be anywhere and repetitions are allowed? For example, 57A7AU is a valid license plate. Solution: ( 6 3 ) 5 3 10 3 = (6 5 4/3 2)5 3 10 3 4. How many license plates are possible if the three vowels may be anywhere and repetitions aren t allowed? For example, 57A9EU is a valid license plate. Solution: C(6, 3)P (5, 3)P (10, 3) = (6 5 4/3 2) 5 4 3 10 9 8 8

Section 8 [15 pts (7,8)]: Proofs 1. Prove that if p divides n, then φ(n) (n n/p). Do not use any formulas for φ(n). Solution: φ(n) is the number of integers in [1,n) that are relatively prime to n. The numbers p, 2p,..., (n/p)p are not relatively prime to n since they share a factor of p. Since there are (n/p) of these, subtracting these from n gives the bound; there might be fewer relatively prime numbers, but there aren t more. 2. Prove that for all odd n, the sum of ( n i) for 0 i n/2 is 2 n 1. Solution: The sum of ( n i) for 0 i n is 2 n, since this is the number of possible subsets of n for any size, and the individual terms are the sizes of subsets of specific sizes. For odd n, there are an even number of such terms: 0 plus 1... n. And we know binomial coefficients are symmetric from the fact that ( n r total sum of all ( n i), thus 2 n 1. ) ( = n n r). Thus these coefficients must be worth half the 9