University of Illinois at Chicago Department of Computer Science. Final Examination. CS 151 Mathematical Foundations of Computer Science Fall 2012

Similar documents
Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

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

CS158 Section B Exam 1 Key

University of New Mexico Department of Computer Science. Final Examination. CS 362 Data Structures and Algorithms Spring, 2006

Homework 1 CS 1050 A Due:

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

CPSC 121 Midterm 1 Friday October 14th, Signature: Section (circle one): 11:00 15:30 17:00

Section 2.2: Introduction to the Logic of Quantified Statements

Strategies for Proofs

CSE 20 DISCRETE MATH. Fall

Math 454 Final Exam, Fall 2005

Indicate the option which most accurately completes the sentence.

Introduction to Sets and Logic (MATH 1190)

Practice Final. Read all the problems first before start working on any of them, so you can manage your time wisely

CSE 20 DISCRETE MATH. Winter

Summary of Course Coverage

Program Verification & Testing; Review of Propositional Logic

CS 3512, Spring Instructor: Doug Dunham. Textbook: James L. Hein, Discrete Structures, Logic, and Computability, 3rd Ed. Jones and Barlett, 2010

A Survey of Mathematics with Applications 8 th Edition, 2009

Do not turn this page until you have received the signal to start. In the meantime, please read the instructions below carefully.

(l) Represent each of the sets A, B and C using bit strings. Then, use bit string representation and bitwise logical operations to find

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

CS 173, Running Time Analysis, Counting, and Dynamic Programming. Tandy Warnow

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

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

MATH 139 W12 Review 1 Checklist 1. Exam Checklist. 1. Introduction to Predicates and Quantified Statements (chapters ).

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

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

Warmup Problem. Translate the following sentence from English into Propositional Logic. I want to eat ice cream even though I am on a diet.

CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5

Do not start the test until instructed to do so!

Inference rule for Induction

Recursively Defined Functions

1 / 43. Today. Finish Euclid. Bijection/CRT/Isomorphism. Fermat s Little Theorem. Review for Midterm.

THE UNIVERSITY OF BRITISH COLUMBIA CPSC 121: MIDTERM 2 Group March 12, 2014

Lamé s Theorem. Strings. Recursively Defined Sets and Structures. Recursively Defined Sets and Structures

Graph Theory Questions from Past Papers

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

University of New Mexico Department of Computer Science. Midterm Examination. CS 561 Data Structures and Algorithms Fall, 2013

CS 373: Combinatorial Algorithms, Spring 1999

CS1800 Discrete Structures Final Version A

Guidelines for Writing Mathematical Proofs

Today. Finish Euclid. Bijection/CRT/Isomorphism. Review for Midterm.

Searching Algorithms/Time Analysis

Exam 1 Review. MATH Intuitive Calculus Fall Name:. Show your reasoning. Use standard notation correctly.

Answer Key #1 Phil 414 JL Shaheen Fall 2010

Solutions to Selected Exercises

ENEL Digital Circuits Midterm Examination

Lecture Notes 15 Number systems and logic CSS Data Structures and Object-Oriented Programming Professor Clark F. Olson

The set consisting of all natural numbers that are in A and are in B is the set f1; 3; 5g;

Final Exam May 6, 2015

Notes for Recitation 8

AXIOMS FOR THE INTEGERS

Announcements. CS243: Discrete Structures. Strong Induction and Recursively Defined Structures. Review. Example (review) Example (review), cont.

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

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

Midterm Exam 2 CS313K Logic, Sets, and Functions Spring, 2009

Computer Science Foundation Exam

CSE505, Fall 2012, Midterm Examination October 30, 2012

Logik für Informatiker Logic for computer scientists

Excel Functions & Tables

Quiz 1 Solutions. [1 point] No hackers are willing to waltz. Solution. x R(x) S(x) [1 point] No artists are unwilling to waltz.

Computer Science Foundation Exam

Algorithms Exam TIN093/DIT600

University of New Mexico Department of Computer Science. Final Examination. CS 561 Data Structures and Algorithms Fall, 2011

Warmup Problem. Describe how structural induction differs from our MATH 135 notion of induction. 1/25

THE LOGIC OF QUANTIFIED STATEMENTS

Midterm 2 Solutions. CS70 Discrete Mathematics and Probability Theory, Spring 2009

Example Examination. Allocated Time: 100 minutes Maximum Points: 250

LET S GET STARTED WITH NUMBERS. Xin Li Math Circle, Spring 2018 University of Central Florida

Section 2.4: Arguments with Quantified Statements

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

Geometry. Pacing Guide. Kate Collins Middle School

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

CS154 Midterm Examination. May 4, 2010, 2:15-3:30PM

Geometry Midterm Review Mr. Pisciotta

Practice Problems: All Computer Science majors are people. Some computer science majors are logical thinkers. Some people are logical thinkers.

DISCRETE MATHEMATICS

correlated to the Michigan High School Mathematics Content Expectations

CPSC 121: Models of Computation Assignment #5

CPSC 311: Analysis of Algorithms (Honors) Exam 1 October 11, 2002

Exercise Max. Points Total 80

CMSC Theory of Algorithms Second Midterm

LOGIC AND DISCRETE MATHEMATICS

correlated to the Michigan High School Content Expectations Geometry

Mathematical Induction

Discrete Mathematics Exam File Fall Exam #1

Introduction to Computer Programming CSCI-UA 2. Review Midterm Exam 1

CSC 172 Data Structures and Algorithms. Fall 2017 TuTh 3:25 pm 4:40 pm Aug 30- Dec 22 Hoyt Auditorium

CS140 Operating Systems and Systems Programming Midterm Exam

CPSC 121 Sample Final Examination December 2013

Integrated Math 1. Integrated Math, Part 1

Michigan Edition. correlated to the. Michigan Merit Curriculum Course / Credit Requirements Geometry

DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

Discrete Structures. Fall Homework3

CSE 505, Fall 2008, Midterm Examination 29 October Please do not turn the page until everyone is ready.

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

Outline. Introduction. 2 Proof of Correctness. 3 Final Notes. Precondition P 1 : Inputs include

Transcription:

University of Illinois at Chicago Department of Computer Science Final Examination CS 151 Mathematical Foundations of Computer Science Fall 2012 Thursday, October 18, 2012 Name: Email: Print your name and email, neatly in the space provided above; print your name at the upper right corner of every page. Please print legibly. This is a closed book exam. Nothing else is permitted. You are permitted to use only your brain. Show your work! You will not get partial credit if we cannot figure out how you arrived at your answer. Write your answers in the space provided for the corresponding problem. Let us know if you need more paper. If any question is unclear, ask us for clarification. GOOD LUCK! Q Pts Score Grader Logic 55 Induction1 20 Induction2 25 Total 100

CS 151 Midterm Exam Fall 2012 2 Name: 1. Logic. (a) (4 points) Write the truth table for the compound proposition (p q) ( r q) (b) (4 points) Give a logically equivalent proposition to the one above (c) (4 points) Are the following system specifications consistent? Whenever the system software is being upgraded, users cannot access the system. If users can access the system, then they can save new files. If users cannot save new files, then the system software is not being upgraded.

CS 151 Midterm Exam Fall 2012 3 Name: (d) (4 points each) Let P (x) := Student x gets an A on the midterm, Q(x, y) := Student x does exercise y in the book, R(x) := Student x gets an A in this class. Write the following propositions using P, Q, and R, quantifiers and logical connectives. i. There are students who get an A in this course but do not do every exercise in the book. ii. All students who get an A on the midterm and do every exercise in the book get an A in this class. iii. There are students who do not get an A on the midterm but get an A in this class.

CS 151 Midterm Exam Fall 2012 4 Name: iv. To get an A in this class it is necessary for student Fluffy to get an A on the midterm. v. Write the converse, contrapositive, and the inverse of the statement (iii) above.

CS 151 Midterm Exam Fall 2012 5 Name: vi. Translate the following statement into English: x Students y Exercises Q(x, y) vii. Translate the following statement into English: x Students y Exercises (Q(x, y) R(x)) viii. Write the negation of the statement above and translate it into English.

CS 151 Midterm Exam Fall 2012 6 Name: (e) (4 points) Determine whether the following argument is correct and explain why. All students who get an A in this class do well in the undergraduate program and get a great job. Puffy got a great job. Puffy was a student in this class. Therefore, Puffy got an A on tin this class. (f) (7 points) Prove that if n is an integer an 3n + 2 is even, then n is even using a proof by contradiction.

CS 151 Midterm Exam Fall 2012 7 Name: 2. Algebraic Induction (20 points). In the following steps you will prove by induction the following claim: ( ) 2 For all positive integers n n i=1 i3 = n(n+1) 2 (a) (2 points) We would like to have the claim in the form n n 0 P (n). What should be the constant n 0 and the proposition P (n)? (b) (2 points) What is the statement P (n 0 ) (for the n 0 you defined above)? (c) (3 points) Show that P (n 0 ) is true (for the n 0 you defined above), thus completing the Base Case of the proof.

CS 151 Midterm Exam Fall 2012 8 Name: (d) (3 points) What is the Inductive Hypothesis? (e) (3 points) Write the statement of the Inductive Step.

CS 151 Midterm Exam Fall 2012 9 Name: (f) (5 points) Complete the proof of the Inductive Step, indicating where you use the Inductive Hypothesis. (g) (2 points) Explain why these steps show that this formula is true whenever n is a positive integer.

CS 151 Midterm Exam Fall 2012 10 Name: 3. Structural Induction (25 points). We will define a special set S of strings. A string of length 1 is a. A string of length 2 is either aa, ba, or ca. If s 1 and s 2 are strings then s 1 s 2 a (the concatenation (gluing together) of strings s 1, s 2 and a ) is also a string. Let P (n) be the statement there are more a s than other letters in strings of length n. We will prove by strong induction (on the length of a string) the claim that P (n) is true for all n 3. (a) (2 points) What is the statement P (3)? (b) (2 points) Write all the strings of length 3 in S (c) (3 points) Explain why P (3) is true, thus completing the Base Case of the proof. Explain why n = 3 must be the base case.

CS 151 Midterm Exam Fall 2012 11 Name: (d) (4 points) What is the Inductive Hypothesis? (e) (3 points) Write the statement of the Inductive Step.

CS 151 Midterm Exam Fall 2012 12 Name: (f) (7 points) Complete the proof of the Inductive Step, indicating where you use the Inductive Hypothesis. (g) (2 points) Explain why these steps show that this formula is true whenever n is a positive integer.