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

Similar documents
CPSC 121 Midterm 1 Friday February 5th, Signature: Section (circle one): Morning Afternoon

CPSC 121 Sample Final Examination December 2013

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

CPSC 320 Midterm 2. July 13, 2007

Question Marks 1 /12 2 /6 3 /14 4 /8 5 /5 6 /16 7 /34 8 /25 Total /120

Question Marks 1 /20 2 /16 3 /7 4 /10 5 /16 6 /7 7 /24 Total /100

Question Marks 1 /11 2 /4 3 /13 4 /5 5 /11 6 /14 7 /32 8 /6 9 /11 10 /10 Total /117

Full Name: CS Account:

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

Question Marks 1 /16 2 /13 3 /12 4 /15 5 /8 6 /15 7 /8 8 /5 9 /8 Total /100

EXAMINATION INSTRUCTIONS

EXAMINATION INSTRUCTIONS

UNIVERSITY REGULATIONS

The University of British Columbia Final Examination - December 02, 2014 Mathematics 308. Closed book examination. No calculators.

UNIVERSITY REGULATIONS

EXAMINATION INSTRUCTIONS

THE UNIVERSITY OF BRITISH COLUMBIA CPSC 110: MIDTERM 1 Part B May 26, Important notes about this examination

THE UNIVERSITY OF BRITISH COLUMBIA CPSC 261: MIDTERM 1 February 14, 2017

CPSC 311, 2010W1 Midterm Exam #2

Computer Science 304

The University of Oregon May 16, 2015 Oregon Invitational Mathematics Tournament:

CPSC 411, 2015W Term 2 Midterm Exam Date: February 25, 2016; Instructor: Ron Garcia

The University of Oregon May 16, 2015 Oregon Invitational Mathematics Tournament:

CE161-4-AU UNIVERSITY OF ESSEX. Undergraduate Examinations 2014 DIGITAL SYSTEMS ARCHITECTURE. Time allowed: TWO hours

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #1 Examination 12:30 noon, Tuesday, February 14, 2012

CPSC 126 SAMPLE FINAL EXAMINATION ANSWERS April, 2003

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012

This examination has 11 pages. Check that you have a complete paper.

MATH 253/101,102,103,105 Page 1 of 12 Student-No.:

CPSC 410? Advanced Software Engineering Mid-term Examination (Term I ) SOLUTION Instructor: Gail Murphy

CS 411 Midterm Feb 2008

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

CPSC 410 Advanced Software Engineering Mid-term Examination (Term I ): Solution Instructor: Gail Murphy

EXAMINATION INSTRUCTIONS

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

UNIVERSITY REGULATIONS

The University of British Columbia Computer Science 304 Practice Final Examination

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

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

Section 2.4: Arguments with Quantified Statements

CPSC 121 Midterm 2 Friday November 13th, 2015

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

EXAMINATION INSTRUCTIONS

CSE 20 DISCRETE MATH. Fall

CS1800 Discrete Structures Final Version A

Student Number: UTORid: Question 0. [1 mark] Read and follow all instructions on this page, and fill in all fields.

Back to the knights and knaves island

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

UNIVERSITY OF SWAZILAND Faculty of Science

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

Read this before starting!

READ AND OBSERVE THE FOLLOWING RULES:

Summary of Course Coverage

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

Read this before starting!

15110 PRINCIPLES OF COMPUTING SAMPLE EXAM 2

Discrete structures - CS Fall 2017 Questions for chapter 2.1 and 2.2

Propositional Logic Formal Syntax and Semantics. Computability and Logic

CSE 20 DISCRETE MATH. Winter

COMPUTER SCIENCE Paper 1

UNIVERSITY OF SWAZILAND Faculty of Science

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

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

CPSC 311, 2011W1 Midterm Exam #2 2011/11/09

Read this before starting!

Read this before starting!

COMPUTER SCIENCE. Paper 1

Dr. S. Shirani COE2DI4 Midterm Test #1 Oct. 14, 2010

CIS 110 Introduction to Computer Programming. February 29, 2012 Midterm

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

Graph Theory Questions from Past Papers

CS/ECE 252: INTRODUCTION TO COMPUTER ENGINEERING UNIVERSITY OF WISCONSIN MADISON

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

Read this before starting!

Propositional Logic. Part I

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

University of Toronto Mississauga. Flip to the back cover and write down your name and student number.

Section 2.2: Introduction to the Logic of Quantified Statements

ENEL Digital Circuits Midterm Examination

CS 540: Introduction to Artificial Intelligence

SEMESTER 1, 2011 EXAMINATIONS. CITS1200 Java Programming FAMILY NAME: GIVEN NAMES:

a. Given that we search depth first from left to right, list all leaf nodes above that we need to search/expand. (35 Points)

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

COMP SCI 3EA3 Specifications and Correctness Duration of Examination: 50 minutes

MIDTERM EXAMINATION #2 OPERATING SYSTEM CONCEPTS U N I V E R S I T Y O F W I N D S O R S C H O O L O F C O M P U T E R S C I E N C E

Chapter 3. Set Theory. 3.1 What is a Set?

CSE505, Fall 2012, Midterm Examination October 30, 2012

Lecture 2 Finite Automata

Chapter 3 Data Representation

GOZO COLLEGE. Boys Secondary Victoria - Gozo, Malta Ninu Cremona. Half Yearly Examination

COMPUTER SCIENCE PAPER 1

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

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

4 Operations On Data 4.1. Foundations of Computer Science Cengage Learning

ENEL 353: Digital Circuits Midterm Examination

PREMOCK GCE EXAMINATIONS

Computer Science 217

Math Circle Beginners Group October 18, 2015 Solutions

Midterm spring. CSC228H University of Toronto

Transcription:

CPSC 121 Midterm 1 Friday October 14th, 2016 Name: Student ID: Signature: Section (circle one): 11:00 15:30 17:00 You have 70 minutes to write the 9 questions on this examination. A total of 60 marks are available. Justify all of your answers. You are allowed to bring in one hand-written, double-sided 8.5 x 11in sheet of notes, and nothing else. Keep your answers short. If you run out of space for a question, you have written too much. The number in square brackets to the left of the question number indicates the number of marks allocated for that question. Use these to help you determine how much time you should spend on each question. Use the back of the pages for your rough work. Good luck! UNIVERSITY REGULATIONS: Question 1 2 3 4 5 6 7 8 9 Total Marks Each candidate should be prepared to produce, upon request, his/her UBC card. No candidate shall be permitted to enter the examination room after the expiration of one half hour, or to leave during the first half hour of the examination. CAUTION: candidates guilty of any of the following, or similar, dishonest practices shall be immediately dismissed from the examination and shall be liable to disciplinary action. 1. Having at the place of writing, or making use of, any books, papers or memoranda, electronic equipment, or other memory aid or communication devices, other than those authorised by the examiners. 2. Speaking or communicating with other candidates. 3. Purposely exposing written papers to the view of other candidates. The plea of accident or forgetfulness shall not be received. Candidates must not destroy or mutilate any examination material; must hand in all examination papers; and must not take any examination material from the examination room without permission of the invigilator.

page 2 out of 7 [12] 1. [1] a. For what truth values of a and b is a b false? [3] b. Is (a b) (a b) ( a b) a tautology, a contradiction, or a contingency? Justify your answer. [8] c. Using a sequence of logical equivalence, prove that (p q) ( p q) p q Please write the name of the law(s) you applied at each step. Hint: What you showed in part b above may be helpful.

page 3 out of 7 [6] 2. [3] a. Consider the following digital circuit. Write a propositional logic expression which is the direct translation of this circuit to propositional logic. Do not simplify your expression. [3] b. Draw the circuit corresponding to the following propositional logic expression. (a ( b c)) (a d)

page 4 out of 7 [10] 3. Assume that we use 6 bits to represented binary integers. If the binary integer is interpreted as a signed integer, then we will represent it using two s complement. [3] a. Consider the 6-bit binary integer 110101. If we interpret it as a signed binary integer, what is the corresponding decimal value? If we interpret it as an unsigned binary integer, what is the corresponding decimal value? [3] b. Consider the hexadecimal value 1F. What is the corresponding binary value? What is the corresponding decimal value? [1] c. Write down the two binary integers from parts (a) and (b). Then add them together in binary. What is the resulting binary integer (assuming that we only have 6 bits to represent it)? Please write down your answer in this form A + B = C where A, B, and C are binary numbers. For example, this can be a possible answer: 001000 + 101010 = 111100. [1] d. Consider your answer A + B = C from part (c). Suppose that we interpret all three binary integers A, B, and C as unsigned binary integers. Convert all three binary integers into decimal values and write down the same addition in decimal. For example, this can be a possible answer: 30 + 60 = 120. [2] e. Does your answer from part (d) make sense? Why or why not?

page 5 out of 7 [8] 4. Determine the validity of the following argument using rules of inference and/or logical equivalences. You must state what inference rule or logical equivalence you use at each step. Do not rewrite the premises; start your proof at step 6. 1. p q 2. (s r) t 3. (t m) u 4. r q 5. u m p s [3] 5. You were asked to prove that an argument such as the following is valid: 1. premise 1 2. premise 2 3. premise 3 p s but instead of proving p s you succeeded in proving (p s). A teaching assistant verified your proof and confirmed (correctly!) that you did not make a mistake. What are the two possible reasons for the perplexing conclusion you reached?

page 6 out of 7 [6] 6. Consider the following definitions: P : the set of all people living around 200 BC. T : the set of tools/weapons available at that time. G(x): person x is Greek R(x): person x is Roman W(x, y): person x wielded weapon y Talked(x, y): person x talked to person y Fought(x, y): person x fought person y Translate each of the following English statements into predicate logic. For instance, Alex wielded some weapon would be translated as x T, W(Alex, x). [3] a. A Greek wielding a bronze sword (an element of T ) fought a Roman wielding an iron shield (another element of T ). [3] b. People who used cudgels (an element of T ) fought every Greek they talked to. [3] 7. Using the same definitions in the previous question, translate the following predicate logic statements into English: x P, (G(x) y P, R(y) Talked(x, y)) ( z P, G(z) x z Talked(x, z)) [3] 8. Why do we almost never translate an English sentence into a predicate logic statement of the form x D, P (x) Q(x)?

page 7 out of 7 [9] 9. In this question, you will design a circuit that takes as input a 4-bit unsigned binary integer x 3 x 2 x 1 x 0, and outputs its integer square root as a 2-bit unsigned binary integer y 1 y 0. By integer square root, we mean that any fractional part is discarded. For instance, the integer square root of 11 is 3 because 11 = 3.3166... a. Write a proposition for the value of y 1. Any correct proposition will be worth at least 1.5/2. In order to get 2/2, you need to write one that is not too ugly. Hint: our solution is very short. b. Write a proposition for the value of y 0. Any correct proposition will be worth at least 2.5/4. In order to get 4/4, you need to write one that is not too ugly. c. Finally draw your circuit below.