Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Compound Propositions - Discrete Mathematics - Solved Exam, Exams of Discrete Mathematics

During the study of discrete mathematics, I found this course very informative and applicable.The main points in these lecture slides are:Compound Propositions, Logical Connectives, One Interpretation, Truth Table, Simple Equivalent Expressions, Tautology, Pair of Expressions, Demorgan Law, Distributive Law, Domain of Discourse, Empty Set

Typology: Exams

2012/2013

Uploaded on 04/27/2013

atmaja
atmaja 🇮🇳

4.2

(45)

182 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Name: Net ID: Univ. ID #
Midterm Exam 1, CS 173, Spring 2003
Tuesday,February 25, 2003
SOLUTIONS
Read the following instructions before you start to work.
This is a closed-book, closed-notes exam!
No calculators, paper, notebooks, or anything
else. If you broughtanything with you other than pencils, erasers, or pens, please leave them
at the front of the room with the proctor.
Printyour name, Net-ID, and University ID in the slots above, and printyour name at the
top of every page.
Write your answers in the spaces provided. You can use the backs of sheets for scratch. See
the proctor if you need more scratch paper.
Read each question carefully and make sure you understand exactly what it is asking. If you
give a beautiful answer to the wrong question, you'll get no credit. Simplify your answers
as much as possible. Correct but unnecessarily complicated answers might not receive full
credit.
For reasons of consistency, the proctors will only answer syntactic questions about the exam
(e.g. is that an \a" or an \e"). If you think the question is ambiguous, make and state your
reasonable assumptions and answer the question.
Don't spend too much time on any single problem. You have 105 minutes, and there are 110
points on the exam, so if a problem looks like it will takeyou much longer in minutes than
its pointvalue, you might leave it for later. Remember,
this exam is curved
.
Ambiguously marked answers will receive no credit.
Points for each problem are indicated.
For True/False questions, your score is the number correctly marked minus the number in-
correctly marked. For all other problem types there is no penalty for incorrect answers.
Make sure you have all 8 pages.
1
pf3
pf4
pf5
pf8

Partial preview of the text

Download Compound Propositions - Discrete Mathematics - Solved Exam and more Exams Discrete Mathematics in PDF only on Docsity!

Name: Net ID: Univ. ID #

Midterm Exam 1, CS 173, Spring 2003

Tuesday, February 25, 2003

SOLUTIONS

Read the following instructions b efore you start to work.

 This is a closed-b o ok, closed-notes exam! No calculators, pap er, noteb o oks, or anything else. If you brought anything with you other than p encils, erasers, or p ens, please leave them at the front of the ro om with the pro ctor.

 Print your name, Net-ID, and University ID in the slots ab ove, and print your name at the top of every page.

 Write your answers in the spaces provided. You can use the backs of sheets for scratch. See the pro ctor if you need more scratch pap er.

 Read each question carefully and make sure you understand exactly what it is asking. If you give a b eautiful answer to the wrong question, you'll get no credit. Simplify your answers as much as p ossible. Correct but unnecessarily complicated answers might not receive full credit.

 For reasons of consistency, the pro ctors will only answer syntactic questions ab out the exam (e.g. is that an \a" or an \e"). If you think the question is ambiguous, make and state your reasonable assumptions and answer the question.

 Don't sp end to o much time on any single problem. You have 105 minutes, and there are 110 p oints on the exam, so if a problem lo oks like it will take you much longer in minutes than its p oint value, you might leave it for later. Rememb er, this exam is curved.

 Ambiguously marked answers will receive no credit.

 Points for each problem are indicated.

 For True/False questions, your score is the numb er correctly marked minus the numb er in- correctly marked. For all other problem typ es there is no p enalty for incorrect answers.

 Make sure you have all 8 pages.

  1. [4 p oints] Write each of the following statements in the form \If... Then... ".

(a) x is even only if y is o dd. Solution: If x is even then y is o dd.

(b) It is hot whenever it is sunny. Solution: If it is sunny then it is hot.

(c) Studying is suÆcient for passing. Solution: If you study then you pass

(d) Studying is necessary for passing. Solution: If you pass then you studied

  1. [5 p oints] Write each of the following comp ound prop ositions using logical connectives and symb ols, where c, d, r , and w , mean \it is cold", \it is dry", \it is rainy", and \it is windy", resp ectively.

(a) It is neither cold nor dry. Solution: :c ^ :d. (Or: :(c _ d).)

(b) it is rainy if it is not dry. Solution: :d! r.

(c) To b e cold, it must b e windy or rainy. Solution: c! (w _ r )

(d) It is cold or dry, but not b oth. Solution: c  d (Or (c _ d) ^ (:c _ :d))

(e) Unless it is windy and dry, it is raining. Solution: There is some disagreement ab out what \A unless B" means. One interpretation is that if B holds, A do es not. The other interpretation is the same, but adds also that if B do esn't hold, then A do es. So, \unless B , A" can b e written either as :B! A, or (second interpretation) :B $ A (which is the same as A  B ). Acceptable answers: :(w ^ d)! r :(w ^ d) $ r (w ^ d)  r.

  1. [4 p oints] For each of the following, if the pair of expressions are logically equivalent, circle \T", otherwise circle \F". (a) Solution: True (p  q ) {and{ :(p $ q ) (b) Solution: False :(p $ q ) {and{ :(p! q ) (c) Solution: True p! q {and{ :q! :p (d) Solution: True :p $ q {and{ p $ :q (e) Solution: False p -and- q (f ) Solution: False p! (q! r ) {and{ p! (q ^ r ) (g) Solution: False p _ (q ^ r ) {and{ (p ^ q ) _ (p ^ r ) (h) Solution: True p! (:q ^ r ) {and{ :p _ :(r! q )
  2. [6 p oints] Match each of the following with the correct English statement by writing the letter next to the numb er. (DO NOT draw \matching" lines.)

(b) (1) 9 x 8 y T (x; y ). (a) Every course has at least one student. (d) (2) 9 y 8 xT (x; y ): (b) Some student is enrolled in every course. (e) (3) 8 x 9 y T (x; y ): (c) No student is taking every course. (i) (4) :9x 9 y T (x; y ): (d) Some course is b eing taken by all students. (g) (5) 9 x 8 y :T (x; y ): (e) Every student is taking at least one course. (a) (6) 8 y 9 xT (x; y ): (f ) Some course has an enrollment of 0. (f ) (7) 9 y 8 x:T (x; y ): (g) Some students are not taking any courses. (g) (8) :8x 9 y T (x; y ): (h) No course is b eing taken by all students. (h) (9) :9y 8 xT (x; y ): (i) No student is taking any course. (b) (10) :8x 9 y :T (x; y ): (j) All students are having a party. (g) (11) :8x:8y :T (x; y ): (k) The rain in Spain falls mainly on the plain. (c) (12) 8 x 9 y :T (x; y ): (l) No students cho ose this answer.

  1. [10 p oints] Prove that :(p _ (:p ^ q )) and :p ^ :q are equivalent using logical equivalences.

Solution: :(p _ (:p ^ q )) = :p ^ :(:p ^ q )) by DeMorgan = :p ^ (p _ :q )) by DeMorgan again = :p ^ p) _ (:p ^ :q ) by distributive law = F _ (:p ^ :q ) since p ^ :p = F. = :p ^ :q since F _ x = x.

  1. [10 p oints] Supp ose the variable x has domain of discourse the set of all students, and y the set of all courses, and we de ne the following predicates: U (y ) : y is an upp er-level course. C (y ) : y is a CS course. F (x) : x is a freshman. A(x) : x is a part-time student. B (x) : x is a full-time student. T (x; y ) : student x is taking course y.

Write each of the following statements using the ab ove predicates and any needed quanti ers:

(a) Harvey is taking CS 173. Solution: T (Harvey, CS173)

(b) Not all freshman are full-time students. Solution: 9 xF (x) ^ :B (x), OR :( 8 x(F (x)! B (x))). OR 9 x:(F (x)! B (x)). Note however that 8 x:(F (x)! B (x)) is incorrect.

(c) No CS course is upp er-level. Solution: :9y (C (y ) ^ U (y )) OR 8 y (C (y )! :U (y )).

(d) There is a part-time student who is not taking any CS course. Solution: 9 x 8 y A(x) ^ (C (y )! :T (x; y )). OR 9 x(A(x) ^ 8 y (C (y )! :T (x; y )))

(e) Every part-time freshman is taking some upp er-level CS course. Solution: 8 x(A(x) ^ F (x))! 9 y (U (y ) ^ C (y ) ^ T (x; y )). OR 8 x 9 y A(x) ^ F (x)! U (y ) ^ C (y ) ^ T (x; y ).

  1. [1 p oint] Find the sets A and B if B A = f 2 ; 10 g; A B = f 1 ; 5 ; 7 ; 8 g; and A \ B = f 3 ; 6 ; 9 g: Solution: A = f 1 ; 3 ; 5 ; 6 ; 7 ; 8 ; 9 g; B = f 2 ; 3 ; 6 ; 9 ; 10 g
  2. [4 p oints] Denote the empty set by ;. What is the Power-set of f;; 1 ; f 1 gg?

Solution: f;; f;g; f 1 g; ff 1 gg; f;; 1 g; f;; f 1 gg; f 1 ; f 1 gg; f;; 1 ; f 1 ggg

  1. [5 p oints] Let A = fa; b; cg: Mark each of the following True (T) or False (F).

(a) True fb; cg 2 P (A).

(b) True ffagg  P (A).

(c) True f;g  P (A):

(d) True ;  A  A.

(e) False fa; cg 2 A  A:

  1. [8 p oints] A large sum of money has b een stolen from a bank. The criminals were seen driving away from the scene. Afterwards, Artie, Bernie, Charlie, and Dufus were questioned. Supp ose the following facts have b een established:

(a) Artie is afraid of spiders. (b) Bernie do es not know how to drive. (c) Charlie never pulls a job without using b oth Artie and Dufus. (d) Dufus never works with less than two other p eople. (e) No one other than Artie, Bernie, Charlie, and Dufus was involved in the robb ery.

Prove by contradiction that Artie must b e guilty. Your pro of should b e a sequence of state- ments, and for each statement you make you should explain exactly why it follows from previous statements and the facts ab ove, which you should refer to by letter.

Solution: Assume that Artie is not guilty. By (c), Charlie cannot b e guilty, since he must work with Artie if he is guilty. By (e), the only remaining p ossibilities are Bernie and Dufus. By (d), Dufus is not guilty, since he needs two accomplices, and only one (Bernie) remains. This leaves only Bernie, who by (b) could not have done it alone. So, if Artie is not guilty, then nob o dy is, but this contradicts the fact that a crime was committed and (e).

Other arguments are p ossible, but a bit more verb ose. If you didn't do a pro of by contradic- tion, then you had a harder time solving the problem, and you didn't get full credit (max 7, if everything else was correct.)

We can also do this symb olically, though that is not what was asked for. Moreover, it is not easy to do that way completely. (You'd have to intro duce predicates D (x) for \x drives", and G(x) for \x is guilty". The last statement would also give you trouble.)

  1. [20 p oints]

A diamond cutter cuts n-carat diamonds into n single 1-carat diamonds. Whenever he makes a cut, the diamond is split into two smaller diamonds with a whole numb er of carats (no fractions). He is paid for each cut as follows: When a diamond is cut into two pieces, he receives a numb er of dollars equal to the pro duct of the size in carats of the resulting two pieces. For example, if he cuts a 9-carat diamond into a 4 and a 5-carat diamond, he'd make 4 times 5, or 20 dollars for that single cut. If he then cuts the 5-carat diamond into a 2-carat and 3-carat diamond, he'd make 6 dollars more. He continues to split the pieces (currently 4-carats, 3-carats, and 2-carats) in any manner, collecting money for each cut, until there are 9 1-carat diamonds left. A rather counterintuitive fact: no matter how he do es this, the total amount of money that he makes for splitting up an n-carat diamond into n 1-carat diamonds is always the same: n(n 1)= 2 dollars. For example, regardless of how he cuts up a 9-carat diamond, he will make 36 dollars. Prove by induction that this is indeed true: No matter what sequence of cuts is used to cut an n-carat diamond into n 1-carat diamonds, the total amount of money made will always b e n(n 1)= 2 dollars, assuming as ab ove that the amount paid for a single cut is the pro duct of the resulting sizes. Solution: Base Case: A 1-carat diamond earns 0 dollars, and 0 = 1(1 1)=2.

Inductive Step: Assume inductively that for any k -carat diamond with k < n, the amount of money made regardless of how it is cut is exactly k (k 1)=2. Now consider an n-carat diamond. The rst cut must divide the diamond into two pieces, one of size k , the other of size n k , for some k such that 1 < k < n and 1 < n k < n. The amount of money made by the rst cut is thus k (n k ). By the inductive hyp othesis, regardless of how the two pieces are cut, the total they yield for the work are k (k 1)= 2 and (n k )(n k 1)=2, resp ectively. Thus, the total amount of money made is: k (n k ) + k (k 1)= 2 + (n k )(n k 1)=2. This simpli es to n(n 1)= 2 (which we'd exp ect you to show).