{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

exam1solutions

# exam1solutions - Math 374 Exam 1 Name 0 Read problems...

This preview shows pages 1–7. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Math 374. Exam 1. 2/13/09. Name: 0 Read problems carefully. Show all work. 0 No notes, calculator, or text. 0 The exam is approximately 15 percent of the total grade. 0 There are 100 points total. Partial credit may be given. l. (10 points) Construct a truth table for the following wff. Is it a tautology? For full credit, give all necessary columns. A'AB—>AVB. IJ 2. (20 points) Write the negation of each of the following sentences. (a) (5 points) The weather is sunny and cold. 77% mr’wr is M sauna or ii is m? MM. (b) (5 points) If the temperature in the room is hot, then we turn on the air conditioning. T1,; l—Cmﬁard'uv‘L ivx {AL PODW [S Mf) W V1 i, “/44 ‘h/Wh 914 Ma air OéMthm‘ra. (c) (5 points) Some dogs have no spots. All was MﬂC/ﬁmﬁfwﬁ (d) (5 points) Every student takes either a German class or a French class. \$9M SW W024 Mif’kr A Garwofags Mm" a 5W4 ob»: . 7..) 3. (20 points) (a) (10 points) Consider the following statements: A : It is sunny tomorrow. B : It rains tomorrow. C : We will play golf. Use the letters to translate the following sentence into a single propositional wff: ”If it is sunny tomorrow, then we will play golf; but we will not play golf if it rains tomorrow”. (A—aC/lACBF7C/l (b) (10 points) Consider the following predicate symbols: F(:z:) : 2: is a ﬁr tree. 0(z) : x is an oak tree. T(.’c, y) : a: is taller than y. Circle the predicate wff which corresponds to the sentence ”Some ﬁr trees are taller than all oak trees.” There is only one correct answer. (a) (3w)(F(-r) A (mom —> Tm»). é— 3W. Fm me. is g/m 24w Hm (b) (ammo A (Vy)(0(3/) —+ Tm»). W 9‘1; is WW3 - I (c) (Vm)(Vz/)(F(x)/\0(y)amazing—L. (A1323 Fir W3 W i (f 7 3'1 .7 (d) (Vy)(0(y)—1(3x)(F(;r)ffT(x,y))), W (NJ) (MIL Hews. ’ MW ‘ A \ . R,» art/M4 CALL heel H‘l/U. is 11 £1} +Y‘UL which R WHMt/f‘ 4 4. (20 points) (a) (10 points) Justify the steps given in the proof sequence of [A —+ (B v 0)] /\ B’ A C" —-' A’. The ﬁrst justiﬁcation is given to you. WFF Justiﬁcation l. A —> (B V C) hypothesis 2. B’ hypothesis 3. C’ hypothesis 4. B’ A 0’ conjunchbh (213i 5. (B v or 0Q fw7347( (4'3 ‘1. I '9'! 0" 53s I). (b) (10 points) Justify the last four steps in the proof sequence of (Vm)(A(-'r) —> B(\$)) —> ((317)A(:r)-+ (3x)B(m))- Note: The given proof sequence is correct; it has no ﬂaws. WFF Justiﬁcation 1. (Vzr)(.4(m) —> 13(1)) hypothesis 2. (aw-1m hypothesis (using the deduction rule) 3. A(a) l i (93 4. A(a) —» 3(a) (A i (Ii—i 5. 3(a) Midas ﬁlm/‘8 (314') o. (33:)B(rc) a?) (9\ 'JI 5. (15 points) (a) (6 points) Suppose that a Prolog database exists that gives information about actors and the movies they acted in. Some predicates in the database are as follows: A(:z, y) : actor x acted in movie y. C(m) : movie :1: is a comedy. b = Bob Smith (so the constant b represents the actor Bob Smith). Write a Prolog query to ﬁnd all comedies that Bob Smith acted in. Which (X: C(Xl M Mth (b) (9 points) Runners run a race. Suppose that a Prolog database exists that gives infor- mation about the runners and the order in which they ﬁnished the race. There were no ties. Some predicates in the database are as follows: one(:z, y) : runner :c ﬁnished exactly one place ahead of runner y. A(a:. y) : runner :r ﬁnished ahead of runner y (one or more places ahead of 3;). Write a recursive Prolog rule to deﬁne the predicate A(:1:, y). 6. (15 points) Verify the correctness of the following program segment with the precondition and postcondition shown. You will need to use the assignment and conditional rules. {r=—2} ifzr > Othen y=—4-x else y=3~z end if {y=-6} (1'1;ng free/IMSM M7 [email protected]+m. 7 will UM i7?“ J N74 @WC {Wt/wt -._-::) (FM/7”“ ...
View Full Document

{[ snackBarMessage ]}

### Page1 / 7

exam1solutions - Math 374 Exam 1 Name 0 Read problems...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online