Midterm Exam PDF
Document Details

Uploaded by EuphoricArlington
Tags
Summary
This document contains a set of questions related to propositional logic and discrete mathematics, focusing on logical connectives, truth tables, and more. It is a useful resource for practicing propositional logic problems.
Full Transcript
Which of the following sentences is a proposition? 3 + 2 = 6 Take this pencil Can you help me? x + 2 = 6 Why should you study discrete mathematics? Let p be a proposition. The statement βIt is not the case that pβ is denoted by Β¬ππ ππ β Β¬ππ β ππ ππ β§ Β¬ππ Β¬ππ β¨ ππ Let p and q be...
Which of the following sentences is a proposition? 3 + 2 = 6 Take this pencil Can you help me? x + 2 = 6 Why should you study discrete mathematics? Let p be a proposition. The statement βIt is not the case that pβ is denoted by Β¬ππ ππ β Β¬ππ β ππ ππ β§ Β¬ππ Β¬ππ β¨ ππ Let p and q be propositions. The proposition that is true when both p and q are true and is false otherwise is denoted by ππ β§ ππ ππ β¨ ππ ππ β ππ ππ β ππ ππ β ππ Let p and q be propositions. The proposition that is false when p and q are both false and is true otherwise is denoted by ππ β¨ ππ ππ β ππ ππ β§ ππ ππ β ππ ππ β ππ Let p and q be propositions. The proposition that is true when exactly one of p and q is true and is false otherwise is denoted by ππ β ππ ππ β¨ ππ ππ β ππ ππ β§ ππ ππ β ππ Let p and q be propositions. The proposition that is false when p is true and q is false and is true otherwise is denoted by ππ β ππ ππ β§ ππ ππ β ππ ππ β ππ ππ β¨ ππ Let p and q be propositions. The proposition that is true when p and q have the same truth values and is false otherwise is denoted by ππ β ππ ππ β ππ ππ β¨ ππ ππ β ππ ππ β§ ππ Find the converse of ππ β Β¬ππ Β¬ππ β ππ ππ β Β¬ππ ππ β ππ Β¬ππ β Β¬ππ ππ β ππ Find the contrapositive of Β¬ππ β ππ Β¬ππ β ππ ππ β Β¬ππ ππ β Β¬ππ Β¬ππ β Β¬ππ ππ β ππ Find the bitwise OR of the bit strings 1011 0010 and 0110 0110 1111 0110 0010 0011 0011 0011 1010 1001 0111 1100 Find the bitwise AND of the bit strings 1010 1010 and 1001 1001 1000 1000 0101 0101 1100 1100 0011 0011 1011 1011 Find the bitwise XOR of the bit strings 0111 0101 and 1101 0101 1010 0000 1111 0111 0101 0100 0110 1010 1101 0101 Construct the truth table for the proposition (ππ β ππ) β¨ (Β¬ππ β ππ) p q (ππ β ππ) β¨ (Β¬ππ β ππ) T T T T F T F T T F F T p q (ππ β ππ) β¨ (Β¬ππ β ππ) T T T T F T F T F F F T p q (ππ β ππ) β¨ (Β¬ππ β ππ) T T T T F F F T T F F F p q (ππ β ππ) β¨ (Β¬ππ β ππ) T T F T F F F T T F F F p q (ππ β ππ) β¨ (Β¬ππ β ππ) T T F T F T F T T F F F Construct the truth table for the proposition ππβ¨(Β¬ππ β ππ). p q r ππβ¨(Β¬ππ β ππ) T T T F T T F F T F T F T F F T F T T T F T F T F F T T F F F F p q r ππβ¨(Β¬ππ β ππ) T T T T T T F T T F T T T F F F F T T T F T F T F F T T F F F T p q r ππβ¨(Β¬ππ β ππ) T T T T T T F F T F T T T F F F F T T T F T F F F F T T F F F F p q r ππβ¨(Β¬ππ β ππ) T T T T T T F T T F T T T F F T F T T T F T F T F F T T F F F F p q r ππβ¨(Β¬ππ β ππ) T T T F T T F F T F T T T F F T F T T F F T F T F F T F F F F T Let p, q and r be the propositions βYou get an A on the final examβ, βYou do every exercise in this bookβ and βYou get an A in this classβ respectively. Write the proposition βGetting an A on the final and doing every exercise in this book is sufficient for getting an A in this classβ using p, q and r and logical connectives (ππ β§ ππ) β ππ ππ β (ππ β§ ππ) (ππ β¨ ππ) β ππ (ππ β§ ππ) β ππ Β¬ππ β (Β¬ππ β§ Β¬ππ) Let p and q be the propositions βYou get an A on the final examβ and βYou get an A in this classβ respectively. Write the proposition βTo get an A in this class, it is necessary for you to get an A on the finalβ using p, q and logical connectives ππ β ππ ππ β ππ ππ β ππ ππ β¨ ππ Β¬ππ β Β¬ππ Find the implication that is false If 2 + 3 = 5, then pigs can fly If 2 + 3 = 6, then God exists If 2 + 3 = 4, then 3 + 3 = 5 If pigs can fly, then 1 + 3 = 5 If 2 + 3 = 5, then 1 + 3 = 4 Let p and q be the propositions βIt is below freezingβ and βIt is snowingβ respectively. Express the proposition (ππ β¨ ππ) β§ (ππ β Β¬ππ) as an English sentence It is either below freezing or it is snowing, but it is not snowing if it is below freezing It is below freezing or snowing, but it is not snowing only if it is below freezing It is below freezing but not snowing If it is below freezing, then it is not snowing It is either below freezing or snowing, and it is not below freezing if it is snowing Let p and q be the propositions βYou miss the final examinationβ and βYou pass the courseβ respectively. Express the proposition Β¬ππ β ππ as an English sentence If you donβt miss the final examination then you pass the course, and conversely That you donβt miss the final examination is necessary for passing the course Missing the final examination is sufficient for passing the course by you You donβt miss the final examination or you pass the course If you donβt pass the course, you miss the final examination A compound proposition is a tautology if it is always true, no matter what the truth values of the propositions that occur in it it is always false, no matter what the truth values of the propositions that occur in it it is always true whenever each of the propositions that occur in it is true it is only false when each of the propositions that occur in it is false it is always true whenever all the propositions that occur in it have the same truth values The propositions p and q are logically equivalent if ππ β ππ is a tautology ππ β¨ ππ is a contradiction Β¬( ππ β§ ππ) is a contradiction ππ β¨ ππ is a tautology (ππ β ππ) β§ (Β¬ππ β Β¬ππ) is a tautology Find the proposition that is a tautology Β¬(ππ β¨ ππ) β (Β¬ππ β§ Β¬ππ) (ππ β ππ) β (Β¬ππ β¨ ππ) Β¬(ππ β¨ ππ) β (ππ β¨ ππ) (ππ β ππ) β (Β¬ππ β ππ) (Β¬ππ β¨ Β¬ππ) β (ππ β ππ) Which of the following logical equivalences is a distributive law? ππ β§ (ππ β¨ ππ) β (ππ β§ ππ) β¨ (ππ β§ ππ) ππ β¨ (ππ β¨ ππ) β (ππ β¨ ππ) β¨ ππ ππ β¨ ππ β ππ β¨ ππ ππ β§ (ππ β§ ππ) β ππ β§ (ππ β§ ππ) ππ β§ ππ β ππ β§ ππ Find the proposition that is logically equivalent to ππ β ππ Β¬ππ β¨ ππ Β¬(ππβ¨ππ) ππ β¨ ππ Β¬ππ β¨ ππ Β¬( ππ β§ ππ) Find the proposition that is logically equivalent to Β¬ππ β¨ Β¬ππ Β¬( ππ β§ ππ) Β¬( ππ β¨ ππ) (ππ β ππ) β¨ (ππ β ππ) Β¬(ππβ¨ππ) Β¬ππ β ππ A proposition is a contingency if it is neither a tautology nor a contradiction it is both a tautology and a contradiction it is not a contradiction it is not a tautology it is not logically equivalent to any tautology Find a compound proposition involving the propositions p, q and r that is true when p and q are false and r is true, but is false otherwise Β¬ππ β§ Β¬ππ β§ ππ ππ β¨ ππ β¨ ππ (Β¬ππ β§ Β¬ππ) β¨ ππ (ππ β§ ππ) β¨ Β¬ππ (ππ β ππ) β§ ππ Find a compound proposition involving the propositions p, q and r that is false when p is false and q and r are true, but is true otherwise ππ β¨ Β¬ππ β¨ Β¬ππ Β¬ππ β§ ππ β§ ππ ππ β§ Β¬ππ β§ Β¬ππ ππ β Β¬(ππ β§ ππ) Β¬ππ β¨ ππ β¨ ππ Find a compound proposition involving the propositions p, q and r that is true when p and q are true and r is false, but is false otherwise ππ β§ ππ β§ Β¬ππ (ππ β¨ Β¬ππ) β§ (ππ β¨ Β¬ππ) (ππ β¨ ππ) β§ Β¬ππ ππ β Β¬(ππ β§ ππ) (ππ β§ ππ) β ππ Let P(x) be the statement βx spends less than three hours every weekday in classβ, where the universe of discourse for x is the set of students. Express the proposition ββπ₯π₯Β¬ππ(π₯π₯)β in English There is a student who spends no less than three hours every weekday in class Every student doesnβt spend more than three hours every weekday in class There is a student who doesnβt spend more than three hours every weekday in class There is a student who spends less than two hours every weekday in class Every student spends no more than six hours every weekday in class Let P(x, y) be the statement βx has taken yβ, where the universe of discourse for x is the set of all students in your class and for y is the set of all computer courses at your school. Express the proposition βπ¦π¦βπ₯π₯π₯π₯(π₯π₯, π¦π¦) in English There is a computer course at your school taken by all students in your class There is a computer course at your school taken by at least one student in your class For every student in your class there is a computer course at your school taken by him (or her). For each of the computer courses at your school there is a student at your class who has taken it There is a student at your class who has taken all computer courses at your school Let P(x) be the statement βx can speak Kazakhβ and let Q(x) be the statement βx knows the computer language Delphiβ, where the universe of discourse for x is the set of all students at your university. Express the sentence βThere is a student at your university who can speak Kazakh but who doesnβt know Delphiβ in terms of P(x), Q(x), quantifiers and logical connectives. βπ₯π₯(ππ(π₯π₯) β§ Β¬ππ(π₯π₯)) βπ₯π₯(ππ(π₯π₯) β¨ Β¬ππ(π₯π₯)) βπ₯π₯(ππ(π₯π₯) β Β¬ππ(π₯π₯)) βπ₯π₯(ππ(π₯π₯) β ππ(π₯π₯)) βπ₯π₯(Β¬ππ(π₯π₯) β¨ ππ(π₯π₯)) Let S(x, y) be the statement βπ₯π₯ + π¦π¦ = π₯π₯ β π¦π¦β, where the universe of discourse for both variables is the set of integers. Which of the following statements is true? βπ₯π₯βπ¦π¦π¦π¦(π₯π₯, π¦π¦) βπ₯π₯βπ¦π¦Β¬ππ(π₯π₯, π¦π¦) βπ₯π₯βπ¦π¦π¦π¦(π₯π₯, π¦π¦) βπ¦π¦βπ₯π₯π₯π₯(π₯π₯, π¦π¦) βπ¦π¦βπ₯π₯π₯π₯(π₯π₯, π¦π¦) Let S(x, y) be the statement βx + 3y = 3x β yβ, where the universe of discourse for both variables is the set of integers. Which of the following statements is true? βπ¦π¦βπ₯π₯π₯π₯(π₯π₯, π¦π¦) βπ₯π₯βπ¦π¦Β¬ππ(π₯π₯, π¦π¦) βπ₯π₯βπ¦π¦π¦π¦(π₯π₯, π¦π¦) βπ₯π₯βπ¦π¦π¦π¦(π₯π₯, π¦π¦) βπ¦π¦βπ₯π₯π₯π₯(π₯π₯, π¦π¦) Rewrite the statement Β¬βπ¦π¦βπ₯π₯π₯π₯(π₯π₯, π¦π¦) so that negations appear only within predicates (that is, so that no negation is outside a quantifier or an expression involving logical connectives) βπ¦π¦βπ₯π₯Β¬ππ(π₯π₯, π¦π¦) βπ¦π¦βπ₯π₯π₯π₯(π₯π₯, π¦π¦) βπ¦π¦βπ₯π₯Β¬ππ(π₯π₯, π¦π¦) βπ₯π₯βπ¦π¦Β¬ππ(π₯π₯, π¦π¦) βπ₯π₯βπ¦π¦π¦π¦(π₯π₯, π¦π¦) Which of the following statements is true if the universe of discourse for all variables is the set of all integers? βππβππ(ππ2 + 1 < ππ β 1) βππ(ππ2 = 8) βn(n2 β₯1) βππ(ππ2 β₯ 1) βππβππ(ππ < ππ3 ) βππβππ(ππ > ππ β¨ ππ2 β€ ππ2 ) Which of the following statements is true if the universe of discourse of each variable is the set of real numbers? βπ₯π₯(π₯π₯2 = 8) βπ₯π₯βπ¦π¦(π₯π₯ = π¦π¦2 ) βπ₯π₯βπ¦π¦(π₯π₯ β π¦π¦ = 4) βπ₯π₯βπ¦π¦(π₯π₯ + π¦π¦ β π¦π¦ + π₯π₯) βπ¦π¦βπ₯π₯(π₯π₯3 = π¦π¦) When the statement βπ¦π¦βπ₯π₯π₯π₯(π₯π₯, π¦π¦) is false? There is a y such that P(x, y) is false for every x For every y there is an x for which P(x, y) is true There is an x such that P(x, y) is false for every y There is a pair x, y for which P(x, y) is false For every y there is an x for which P(x, y) is false When the statement βπ¦π¦βπ₯π₯π₯π₯(π₯π₯, π¦π¦) is true? There is a y for which P(x, y) is true for every x For every y there is an x for which P(x, y) is true For every x there is a y for which P(x, y) is false There is a pair x, y for which P(x, y) is true There is an x for which P(x, y) is true for every y List the members of the set {x | x is a negative integer greater than (β 8)} {β 7, β 6, β 5, β 4, β 3, β 2, β1} {β 8, β7, β 6, β 5, β 4, β 3, β 2, β1} {β9, β10, β11, β¦} {0, 1, 2, 3, 4, 5, 6, 7} {9, 10, 11, 12, β¦} Find the power set of {0, 1}. {β , {0}, {1}, {0, 1}} {β , {0, 1}} {{0}, {1}, {0, 1}} {{0}, {1}} {β , {1}} Let A = {1, 2, 3, 4, 5}, B = {2, 4, 6, 8} and C = {2, 4}. Which of the following statements is true? π΄π΄ β© π΅π΅ β πΆπΆ π΄π΄ β π΅π΅ βͺ πΆπΆ π΄π΄ β πΆπΆ β π΅π΅ π΅π΅ β πΆπΆ β π΄π΄ π΅π΅ β π΄π΄ β© πΆπΆ Let A = {a, b, c, d, e, f}, B = {b, d, f, g, h, s} and C = {m, n, o, p, r, d, f}. Find (π΄π΄ β© πΆπΆ) βͺ π΅π΅ {b, d, f, g, h, s} {b, m, n, o, p, r, d , f} {a, b, c, d, e, f} {m, n, o, p, r, d, f} {b, d, e, f, g, h, r} Let A = {0, 1, 2}, B = {y, z} and C = {b, c}. Find πΆπΆ Γ π΅π΅ Γ πΆπΆ {(b, y, b), (b, y, c), (b, z, b), (b, z, c), (c, y, b), (c, y, c), (c, z, b), (c, z, c)} {(0, y, b), (1, y, b), (2, y, b), (0, z, b), (1, z, c), (2, z, c), (0, y, c), (1, y, c), (2, y, c)} {(b, y),(b, z), (c, y), (c, z)} {(b, 0), (b, 1), (b, 2), (c, 0), (c, 1), (c, 2), (0, y), (1, y), (2, y)} {(b, y, c), (c, y, b), (b, z, c), (c, z, b)} A set A is a proper subset of a set B if every element of A is also an element of B and π΄π΄ β π΅π΅ every element of A is also an element of B there is an element of B that is not an element of A there is an element of A that is also an element of B π΅π΅ β π΄π΄ β β and π΄π΄ β© π΅π΅ β β Let A be a set. The power set of A is the set of all subsets of A the set of all proper subsets of A {β , π΄π΄} the set of all finite subsets of A the set of all proper subsets of A and the empty set Let A and B be sets. The Cartesian product of A and B is the set of all ordered pairs (a, b) where ππ β π΄π΄ ππππππ ππ β π΅π΅ {(ππ, ππ)|(ππ β π΄π΄ β§ ππ β π΅π΅) β¨ (ππ β π΄π΄ β§ ππ β π΅π΅)} the set of all ordered pairs (b, a) where ππ β π΄π΄ ππππππ ππ β π΅π΅ the set of all two-element sets {a, b} where ππ β π΄π΄ ππππππ ππ β π΅π΅ Let A and B be sets. The union of A and B is the set that contains those elements that are either in A or in B, or in both {(ππ, ππ)|(ππ β π΄π΄ β§ ππ β π΅π΅) β¨ (ππ β π΄π΄ β§ ππ β π΅π΅)} the set that contains those elements that are only either in A or in B the set that contains those elements that are in both A and B the set that contains those elements that are in A but not in B Let A and B be sets. The intersection of A and B is the set containing those elements that are in both A and B the set that contains those elements that are either in A or in B, or in both. {π₯π₯|(π₯π₯ β π΄π΄) β¨ (π₯π₯ β π΅π΅)} the set that contains those elements that are in A but not in B the set that contains those elements that are only either in A or in B Let U = {1, 2, 3, 4, 5, 6, 7, 8} be the universal set, and A = {1, 3, 4, 5, 8}, B = {2, 4, 5, 7, 8}. Find the complement of A {2, 6, 7} {1, 3, 6} {4, 5, 8} {6} {1, 2, 3, 4, 5, 7, 8} Let f be a function from A to B. Then the codomain of f is the set B the set A {ππ β π΅π΅ | π‘π‘βππππππ ππππ ππππ ππππππππππππππ ππ β π΄π΄ π π π π π π β π‘π‘βππππ ππ(ππ) = ππ} { ππ β π΄π΄ | π‘π‘βππππππ ππππ ππππ ππππππππππππππ ππ β π΅π΅ π π π π π π β π‘π‘βππππ ππ(ππ) = ππ} {ππ β π΅π΅ | π‘π‘βππππππ ππππ ππππ ππ β π΄π΄ π€π€π€π€π€π€β ππ(ππ) = ππ} Let f be the function that assigns the first three bits of a bit string of length 3 or greater to that string. Then the codomain of f is {000, 001, 010, 100, 011, 101, 110, 111} {00, 01, 10, 11} the set of all bit strings of length 3 or greater {0, 1} β Let A = {a, b, c, d, e, g, h} and B = {0, 1, 3, 4, 5} with f(a) = 3, f(b) = 2, f(c) = 4, f(d) = 0, f(e) = 5, f(g) = 1 and f(h) = 3. Find the image of S = {c, d, e, g}. {0, 1, 4, 5} {4, 0, 3, 1} {0, 1, 2, 3, 4, 5} {4, 0, 5, 1, 3} {1, 2, 3, 4} A function f: π΄π΄ β π΅π΅ is said to be injective β¦ iff f(x) = f(y) implies that x = y for all x and y in the domain of f iff for every element ππ β π΅π΅ there is an element ππ β π΄π΄ with f(a) = b if f(x) < f(y) whenever x < y and x and y are in the domain of f if ππ(π₯π₯) β ππ(π¦π¦) implies that π₯π₯ β π¦π¦ for all x and y in the domain of f iff for every element ππ β π΄π΄ there is an element ππ β π΅π΅ with f(a) = b A function f: π΄π΄ β π΅π΅ is said to be surjective β¦ iff for every element ππ β π΅π΅ there is an element ππ β π΄π΄ with f(a) = b iff for every element ππ β π΄π΄ there is an element ππ β π΅π΅ with f(a) = b if f(x) < f(y) whenever x < y and x and y are in the domain of f if f(x) > f(y) whenever x < y and x and y are in the domain of f iff f(x) = f(y) implies that x = y for all x and y in the domain of f The function f is a one-to-one correspondence, or a bijection, if it is both one-to-one and onto it is either one-to-one or onto it is one-to-one but not onto it is onto but not one-to-one the codomain and the range of f coincide Let f and g be the functions from the set of integers to the set of integers defined by f(x) = 3x β 4 and g(x) = 4x β 3. Find the composition of g and f 12x β 19 12x β 13 7x β 7 7x β 12 x + 1 Let f be the function that assigns to each positive integer its first digit. Find the range of f {1, 2, 3, 4, 5, 6, 7, 8, 9} {π₯π₯ β ππ|π₯π₯ > 0} {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} {x | x is an integer and x β₯ 0} the set of integers πΉπΉπΉπΉπΉπΉπΉπΉ β³ 1,98 β². 1 1,98 2 0 1,99 ππππππππ β± ππ, ππππ β° 2 1 1,01 0 1,02 Find β³β ππ, ππππ β² -3 -2,34 0 -2 -1 Find β±β ππ, ππππ β°. -2 -3 -2,34 0 -1 Find β³ ππ/ππππ + β± ππ/ππππ β°β². 1 9/10 0 1/10 2 Find β± ππ/ππππ +β³ ππ/ππππ β²β°. 1 2 9/10 1/10 0 Find β±β³ ππ/ππ β² + β± ππ/ππ β° +ππ/ππ β°. 2 1 0 1/3 2/3 Which of the following functions from {a, b, c, d} to itself is one-to-one? f(a) = d, f(b) = c, f(c) = b, f(d) = a f(a) = c, f(b) = d, f(c) = b, f(d) = b f(a) = a, f(b) = b, f(c) = d, f(d) = d f(a) = a, f(b) = a, f(c) = a, f(d) = a f(a) = d, f(b) = a, f(c) = a, f(d) = d πΏπΏπΏπΏπΏπΏ ππ = {β 3, 0, 3, 7}. πΉπΉπΉπΉπΉπΉπΉπΉ ππ(ππ) ππππ ππ(π₯π₯) = β± ( π₯π₯ 2 + 2)/3 β°. {1, 4, 17} {0, 3, 17} {β2, 0, 3, 16} {β3, 0, 3, 7} Find β± ππ/ππ β β³ ππ/ππ β²β° 0 -2/3 2 1 3