CS1800 Discrete Structures
Fall 2023
Exam1
Due: Oct 17, 2023
Exam Instructions:
• This exam is an individual effort, you may not view or share exam content (including the pdf of exam questions) until grades have been released.
• You are welcome to use any book, previous materials from this course or traditional internet searches to complete this exam
• ChatGPT and similar tools may not be used
• If you have questions, please write a private question on piazza, we’ll be monitoring it through-out the day
• Your work must be easiliy legible to be graded, please tag your questions as is done for HW.
• Upload your completed exam to gradescope within the given time limit. (If some major chal-lenge prevents you from uploading, please email your Professor the pdf within the given time limit.)
• Unless otherwise specified, be sure to show your detailed work to earn full credit
Problem 1 [12 pts (4, 4, 4)]: Two’s complement & overflow
Consider the addition of (1111)2 and (0101)2 in a 4-bit two’s complement number system:
i Compute the addition in binary (your output must also be 4-bits).
ii Write the decimal equivalent of the operation above. For example, you might write 5 + 3 = 8.
iii Is there an overflow in this operation? Explain why or why not in one sentence.
Problem 2 [20 pts (5 each)]: English to Logic
Express each sentence using logical operators, conditionals and quantifiers. Provide the simplest form of the statement possible (using the least number of operators, conditionals and quantifiers). Use the variables and predicates provided.
i There is somebody who can ride their bike backwards.
(x is a person and back(x) is the event that person x can ride their bike backwards.)
ii If any car was made in the past 10 years then it has side curtain airbags and seat belts.
(x is a car, recent(x) is the event car x was made in the past 10 years and airbag(x), belt(x) represent the corresponding feature.)
iii Everybody loves chocolate or vanilla ice cream, but nobody likes both flavors.
(x is a person and choc(x) and van(x) represent person x liking those chocolate and vanilla, respectively.)
iv All the students in the earliest recitation bring a coffee to recitation, and no other student brings a coffee to recitation.
(x is a student, early(x) represents that student x is in the earliest recitation and coffee(x) represents student x brings a coffee to recitation.)
Problem 3 [12 pts (2 each)]: Tarksi World
Using the following predicates:
square(x) is true if x is a square (otherwise it is false)
star(x) is true if x is a star (otherwise it is false)
circ(x) is true if x is a circle (otherwise it is false)
shade(x) is true if x is shaded (otherwise it is false)
next to(x, y) is true if x and y are adjacent horizontally, vertically or diagonally. No object is next to itself.
For each of the statements below, determine whether the statement is true or false. You need not justify your response.
i star(c) V 一shade(c)
ii 二x circ(x) V shade(x)
iii Ax shade(x) Λ 一shade(x)
iv Ax square(x) 一 一shade(x)
v AxAg(star(x) V 一shade(x) Vnext to(x, g)) 一 (shade(g) V circ(g))
vi A y 二x shade(x) Vnext to(x,y)
Problem 4 [12 pts (6 each)]: Set Operations
In increasing order, list all the numbered items which belong to each set. For example, if the given set were A one could correctly respond with [1, 2, 4, 5].
i ((A n C) — B) n C
ii AC U (B n UC)
Problem 5 [14 pts]: Boolean Algebra
Simplify the expression below. Your simplified expression should have the least possible number of set operators (n, U, c ). Show each step by applying and labelling the identity used (e.g. DeMorgan, Indempotent). You’re welcome to use logic set identities.pdf to see the names of each identity.
(A U (A n Bc))c
Problem 6 [10 pts]: saronterthen
How many different orderings are there of the letters in the word:
northeastern
Please leave any counting operations (factorial, combination, permutation etc) in your response (e.g. write 3! instead of 6).
Problem 7 [20 pts (5 each) ]How many 10-bit values?
Count the number of binary strings of length 10 exist under each of the following restrictions.
Please leave your answers unsimplified (e.g. write 53 instead of 125).
i no restrictions.
ii The string has at least one 1.
iii The string contains exactly five 1s.
iv The string contains exactly five 1’s or begins with a 0. (It may both contain five 1’s and begin with a 0).