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

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

CPSC 121 Sample Final Examination December 2013

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

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

CPSC 320 Midterm 2. July 13, 2007

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

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

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

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

Full Name: CS Account:

UNIVERSITY REGULATIONS

UNIVERSITY REGULATIONS

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

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

EXAMINATION INSTRUCTIONS

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

EXAMINATION INSTRUCTIONS

EXAMINATION INSTRUCTIONS

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

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

CPSC 311, 2010W1 Midterm Exam #2

CPSC 126 SAMPLE FINAL EXAMINATION ANSWERS April, 2003

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

Computer Science 304

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

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

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

CS 411 Midterm Feb 2008

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

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

The University of British Columbia Computer Science 304 Practice Final Examination

UNIVERSITY REGULATIONS

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

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

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

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

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

CPSC 121 Midterm 2 Friday November 13th, 2015

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

Read this before starting!

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

EXAMINATION INSTRUCTIONS

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

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

Grade 7/8 Math Circles February 11/12, Counting I

15110 PRINCIPLES OF COMPUTING SAMPLE EXAM 2

Read this before starting!

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

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

FUJAA GENERAL EXAMINATION REQUIREMENTS & PROCEDURE

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

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

Read this before starting!

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

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

CS1800 Discrete Structures Final Version A

Part 2,Number Systems Questions

CSE 20 DISCRETE MATH. Winter

EXAMINATION INSTRUCTIONS

1. Prove that if you have tri-state buffers and inverters, you can build any combinational logic circuit. [4]

Read this before starting!

COMPUTER SCIENCE. Paper 1

COMPUTER SCIENCE Paper 1

Computer Science 217

COMP combinational logic 1 Jan. 18, 2016

UNIVERSITY OF SWAZILAND Faculty of Science

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

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

READ AND OBSERVE THE FOLLOWING RULES:

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

UNM - PNM STATEWIDE MATHEMATICS CONTEST XLI. February 7, 2009 Second Round Three Hours

CSE 20 DISCRETE MATH. Fall

CS 2505 Computer Organization I

Groups of two-state devices are used to represent data in a computer. In general, we say the states are either: high/low, on/off, 1/0,...

Basic Operations and Equivalent Expressions - Step-by-Step Lesson

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

Last Name Student Number. Last Name Student Number

CS150 Sample Final. Name: Section: A / B

CERTIFICATE OF SECONDARY EDUCATION EXAMINATION NOVEMBER, 2015 TIMETABLE

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

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

Question Total Possible Test Score Total 100

Section 001. Read this before starting! You may use one sheet of scrap paper that you will turn in with your test.

Section 001. Read this before starting!

Summary of Course Coverage

60-265: Winter ANSWERS Exercise 4 Combinational Circuit Design

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

Cambridge International Examinations Cambridge International Advanced Level

Binary Values. CSE 410 Lecture 02

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

Propositional Calculus. Math Foundations of Computer Science

Read this before starting!

Section 2.4: Arguments with Quantified Statements

Chapter 3 Data Representation

Fractions with a denominator of 10, 100 or can be written as decimals. A decimal is any number which has a decimal comma.

ENEL Digital Circuits Midterm Examination

CPSC 121: Models of Computation Assignment #5

York University. AP/ITEC Section M INTRODUCTION TO DATA STRUCTURES Winter Midterm Test

Candidate Exam Briefing

Transcription:

CPSC 121 Midterm 1 Friday February 5th, 2016 Name: Student ID: Signature: Section (circle one): Morning Afternoon You have 70 minutes to write the 8 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 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 [3] 1. Is the following statement a tautology, a contradiction or neither? Justify your answer using a truth table: (p q) (p q) [6] 2. Using a sequence of logical equivalences, prove that ( p q) ( (r q) p) p ( q r) Write the name of the law you applied at each step.

page 3 out of 7 [9] 3. Consider the following digital circuit: [3] a. Write a propositional logic expression which is the direct translation of this circuit to propositional logic. Do not simplify your expression. [4] b. Simplify your answer from part (a) using a sequence of logical equivalences. Write the name of the law you applied at each step. [2] c. Draw the simplified circuit corresponding to your answer for part (b). Hint: you should only need 3 gates.

page 4 out of 7 [11] 4. Assume that we use 6 bits to represent signed binary integers (using two s complement). [3] a. What is the 6-bit binary representation of the signed decimal value 15? What is the corresponding hexadecimal representation using 2 digits? [3] b. What is the 6-bit binary representation of the hexadecimal value 2E? What is the corresponding signed decimal value? [1] c. With 6 bits, what is the smallest (most negative) signed binary integer that you can represent? [2] d. What is the sum of the two 6-bit signed binary integers from parts (a) and (b)? What is the corresponding decimal value? [2] e. Why is your decimal answer from part (d) positive?

page 5 out of 7 [12] 5. Three mafiosi (Don Cortizone, Don Maledictione and Don Sanconvictione) went to the horse races. Inspector Montalbano, who is watching them, learns that If Don Sanconvictione bet on Gallant Fox in the third race, then Don Maledictione paid Secretariat s jockey to lose. If Don Cortizone provided EPO to Whirlaway, then Don Sanconvictione and Don Maledictione bet on Count Fleet in the seventh race. Either Don Maledictione did not win any of his bets, or Don Sanconvictione was responsible for War Admiral s sickness (or both). If Don Sanconvictione and Don Maledictione bet on Count Fleet in the seventh race and Don Sanconvictione was responsible for War Admiral s sickness, then Don Maledictione did not pay Secretariat s jockey to lose. After the races were over, Detective Catarella brought him proof that not only Don Cortizone provided EPO to Whirlaway, but also that Don Maledictione won all five of his bets. [3] (a) Rewrite each of these statements using propositional logic. Make sure to define the propositions you are using by underlining part of the sentence above (for instance Don Sanconvictione bet on Gallant Fox in the third race ) and putting the letter (for instance, g ) next to it. [9] (b) Using your answer from part (a), known logical equivalences and the rules of inference, prove that Don Sanconvictione did not bet on Gallant Fox in the third race. Write the name of the equivalence law or the inference rule you applied at each step.

page 6 out of 7 [6] 6. Consider the following definitions: C: the set of all colors. S: the set of all shoppers. I: the set of all items (dress, shoes, pants, hats, gloves, shirts, etc). Knows(x, y): shopper x knows shopper y. Bought(x, y, z): shopper x bought item y in color z. translate each of the following English statements into predicate logic. For instance, Mrs. Nelly bought a colored skirt would be translated as x C, Bought(Mrs. Nelly, skirt, x). [3] a. A shopper who knows Cédric bought a blue shirt. [3] b. Every shopper who bought green gloves knows a shopper who bought a red hat. [6] 7. Using the same definitions as for the previous question, translate each of the following predicate logic statements into English. [3] a. x I, y C, Bought(Nicolas, x, y) Bought(Chen, x, y). [3] b. x S, y S, Bought(y, dress, pink) Knows(x, y).

page 7 out of 7 [7] 8. A triangular number (or triangle number) counts the objects that can form an equilateral triangle, as in the diagram below. The n th triangular number is the sum of the first n integers, as shown in the following figure illustrating the first four triangular numbers (what is the fifth one?): Design a circuit that takes a 4-bit unsigned binary integer x 3 x 2 x 1 x 0 as input, and outputs True if this integer is a triangular number, and False otherwise. You may assume that 0 is not a triangular number.