CS1800 Discrete Structures Final Version B

Similar documents
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 Fall 2016 Profs. Aslam, Gold, Ossowski, Pavlu, & Sprague December 16, CS1800 Discrete Structures Final

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

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

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

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

Instructions. Definitions. Name: CMSC 341 Fall Question Points I. /12 II. /30 III. /10 IV. /12 V. /12 VI. /12 VII.

Review for Midterm Exam

CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators)

Algorithms Activity 6: Applications of BFS

Problem 1. Which of the following is true of functions =100 +log and = + log? Problem 2. Which of the following is true of functions = 2 and =3?

Indicate the option which most accurately completes the sentence.

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

CS 161 Fall 2015 Final Exam

Midterm solutions. n f 3 (n) = 3

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

CS 373: Combinatorial Algorithms, Spring 1999

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

Faculty of Science FINAL EXAMINATION

Multiple-choice (35 pt.)

END-TERM EXAMINATION

Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1

We don t have much time, so we don t teach them [students]; we acquaint them with things that they can learn. Charles E. Leiserson

Prelim 2. CS 2110, November 20, 2014, 7:30 PM Extra Total Question True/False Short Answer

CS 170 Second Midterm ANSWERS 7 April NAME (1 pt): SID (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt):

Total Score /1 /20 /41 /15 /23 Grader

Discrete Mathematics and Probability Theory Spring 2016 Rao and Walrand Midterm 1

CSC Design and Analysis of Algorithms. Lecture 4 Brute Force, Exhaustive Search, Graph Traversal Algorithms. Brute-Force Approach

Final Exam May 6, 2015

CS521 \ Notes for the Final Exam

CS 125 Section #10 Midterm 2 Review 11/5/14

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

CSE 332 Autumn 2013: Midterm Exam (closed book, closed notes, no calculators)

Faculty of Science FINAL EXAMINATION COMP-250 A Introduction to Computer Science School of Computer Science, McGill University

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.

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

Student number: Datenstrukturen & Algorithmen page 1

CS220/MATH320 Applied Discrete Mathematics Instructor: Marc Pomplun Practice Exam. Sample Solutions

Prelim 2, CS2110. SOLUTION

Midterm CSE 21 Fall 2012

CS 112 Final May 8, 2008 (Lightly edited for 2012 Practice) Name: BU ID: Instructions

CSE 20 DISCRETE MATH. Fall

Introduction to Sets and Logic (MATH 1190)

Introduction to Algorithms May 14, 2003 Massachusetts Institute of Technology Professors Erik Demaine and Shafi Goldwasser.

Integers. Dr. Steve Goddard Giving credit where credit is due

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

Problem Score Maximum MC 34 (25/17) = 50 Total 100

Final Exam Review. CS231 Algorithms Handout # 40 Prof. Lyn Turbak December 13, 2001 Wellesley College

University of Toronto Department of Electrical and Computer Engineering. Midterm Examination. ECE 345 Algorithms and Data Structures Fall 2012

UML CS Algorithms Qualifying Exam Fall, 2003 ALGORITHMS QUALIFYING EXAM

CS 373: Combinatorial Algorithms, Fall Name: Net ID: Alias: U 3 / 4 1

Exam I Principles of Imperative Computation, Summer 2011 William Lovas. May 27, 2011

Prelim 2, CS :30 PM, 25 April Total Question Name Short Search/ Collections Trees Graphs

Discrete Math: Selected Homework Problems

University of Toronto Department of Electrical and Computer Engineering. Midterm Examination. ECE 345 Algorithms and Data Structures Fall 2010

2.) From the set {A, B, C, D, E, F, G, H}, produce all of the four character combinations. Be sure that they are in lexicographic order.

DISCRETE MATHEMATICS

Discrete Mathematics and Probability Theory Fall 2015 Rao Midterm 1

Ideally your algorithms for both parts should run in linear time. You will receive partial credit for a polynomial-time algorithm.

Math 454 Final Exam, Fall 2005

Homework Assignment #3 Graph

Questions Total Points Score

Prelim 2 Solutions. CS 2110, November 20, 2014, 7:30 PM Extra Total Question True/False Short Answer

CS170 Discussion Section 4: 9/18

CSE332 Summer 2010: Final Exam

Exam 3 Practice Problems

Question 2 (Strongly Connected Components, 15 points). What are the strongly connected components of the graph below?

W4231: Analysis of Algorithms

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

ECE368 Exam 2 Spring 2016

Introduction to Algorithms October 12, 2005 Massachusetts Institute of Technology Professors Erik D. Demaine and Charles E. Leiserson Quiz 1.

CPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60

Midterm I Exam Principles of Imperative Computation André Platzer Ananda Gunawardena. February 23, Name: Andrew ID: Section:

Exam Principles of Imperative Computation, Summer 2011 William Lovas. June 24, 2011

Sorting. There exist sorting algorithms which have shown to be more efficient in practice.

CS583 Lecture 01. Jana Kosecka. some materials here are based on Profs. E. Demaine, D. Luebke A.Shehu, J-M. Lien and Prof. Wang s past lecture notes

COSC 2007 Data Structures II Final Exam. Part 1: multiple choice (1 mark each, total 30 marks, circle the correct answer)

Fall 2018 September 18, Written Homework 02

Questions Total Points Score

CS 251, LE 2 Fall MIDTERM 2 Tuesday, November 1, 2016 Version 00 - KEY

CS302 Data Structures using C++

Prelim 2 Solution. CS 2110, November 19, 2015, 5:30 PM Total. Sorting Invariants Max Score Grader

Computer Science E-22 Practice Final Exam

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

Virtual University of Pakistan

(Refer Slide Time 3:31)

Midterm I Exam Principles of Imperative Computation Frank Pfenning. February 17, 2011

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

Lecture 1 (Part 1) Introduction/Overview

CSE 332, Spring 2010, Midterm Examination 30 April 2010

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Summer I Instructions:

Read this before starting!

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

CIS 121 Data Structures and Algorithms Midterm 3 Review Solution Sketches Fall 2018

Integers Sep 3, 2002

OF VICTORIA EXAMINATIONS- DECEMBER 2011 CSC

INDIAN STATISTICAL INSTITUTE

CSE 20 DISCRETE MATH. Winter

CSE101: Design and Analysis of Algorithms. Ragesh Jaiswal, CSE, UCSD

Transcription:

CS1800 Discrete Structures Fall 2017 Profs. Aslam, Gold, & Pavlu December 15, 2017 CS1800 Discrete Structures Final Version B 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. SHOW YOUR WORK FOR ALL PROBLEMS. 5. You have two hours to complete the exam. Section Title Points Section 1 [11 points] Binary and Other Bases Section 2 [12 points] Logic and Circuits Section 3 [12 points] Modular Arithmetic and Algorithms Section 4 [10 points] Sets and Set Operations Section 5 [10 points] Counting Section 6 [14 points] Probability Section 7 [15 points] Algorithms, Recurrences, Growth of Functions Section 8 [16 points] Proofs Total Name: CS1800 (Lecture) Instructor: 1

Section 1 [11 pts (4,3,4) ]: Binary and Other Bases 1. Add the 8-bit two s complement numbers 11010111 and 01010101. Give the binary and interpret your result as a decimal integer. 2. What is the minimum number of bits necessary to represent the number -18 in two s complement? 3. Give the hex representation of the decimal number 25600. Hint: Write the number as a product of familiar numbers. 2

Section 2 [12 pts (2,3,4,3)]: Logic and Circuits 1. What is the name of the logic gate that is true iff at least one input is true? 2. Write a formula in conjunctive normal form that is true iff at least one of a, b, or c is true, and at least one of b, c, or d is false. You must use the operators,, and. 3. Draw a circuit that takes a three-bit binary number a 2 a 1 a 0 as input (a 0 is the least significant bit), and returns true precisely when the number is divisible by 4. Don not use more than three gates. 4. Simplify the expression (a b) ( a ( b a)). 3

Section 3 [12 pts (4, 4, 4)]: Modular Arithmetic and Algorithms 1. Let y = (7 x + 4) mod 23 be a linear cipher. (a) Use the Extended Euclidean Algorithm to determine the multiplicative inverse of 7 (mod 23). (b) If y = 10 was the message received, determine the message x that was sent. Your answer should be an integer in the range 0 x < 23. 2. Consider the RSA public key (4, 33). Calculate the totient function φ(n), then describe what is wrong with the key. 4

Section 4 [10 pts (3,4,3)]: Sets and Set Operations For the following problems, let A = {a, b, c}, B = {b, c, d}, C = {d, e, f, g}, with universe U = {a, b, c, d, e, f, g}. 1. Write out the set that results from the operations (A B). 2. How many elements are in P(P(A B))? 3. If D = {x x N, 1 x 2 9}, what is D? 5

Section 5 10 pts (4,6): Counting For these problems, we expect your answers to be simplified into integers for full credit. 1. A contest is held among 20 people and there are three possible outcomes: a single person is declared the winner, or a tie is declared among two people, or a tie is declared among three people. How many different possible results are there in this contest? 2. A group of 9 people will be broken into 3 teams of 3. How many ways are there to do this? (Groups do not have IDs or order; they are defined by the subset of the teammates in the group). 6

Section 6 [14 pts (4,4,3,3)]: Probability You can leave your answers unsimplified in this section. 1. What is the probability of getting a different value on each die when rolling 6 6-sided dice? 2. What is the expected number of (aces + kings) in a hand of 7 random cards? (there are 4 aces and 4 kings in the deck of 52 cards) 3. What is the entropy of a symbol sequence with frequencies 1/4, 1/4, and 1/2? 7

Section 7 [15 pts (4,4,3,4)]: Algorithms, Recurrences, Growth of Functions 1. Given the beginning of a sequence a 1 = 1, a 2 = 3, a 3 = 9, a 4 = 19, a 5 = 33, a 6 = 51,..., find the general closed-form formula. 2. Is 3 n = O(2 n )? Argue why or why not, using the definition of big-o. 3. Between Selection Sort or Insertion Sort, which makes fewer comparisons on arrays that are almost sorted, save for a handful of items swapped with their neighbors? Explain your reasoning. 4. Which relations hold (ω, Ω, Θ, O, o) between the asymptotic growth rates of the following two recurrences: T (N) = 4T (N/4) + N and R(N) = 2R(N/2) + N? 8

Section 8 [16 pts (8, 8)]: Proofs 1. Prove that a n = 78n 2 6n is a multiple of 12, for any positive integer n. Hint: it can be done by factorizing the expression or by induction. 2. A graph G = (V, E) is connected and undirected; a breadth-first search (BFS) traversal finds a path to vertex u of length 3 and finds a path to vertex v of length 7. Prove that the shortest path between u and v has at least 4 edges. 9