QUESTIONS - Discrete Structure Bab Elgam3a
QUESTIONS - Discrete Structure Bab Elgam3a
a) 2 + 3 = 5.
b) 5 + 7 = 10.
c) x + 2 = 11.
d) 4 + x = 5.
f) 2n ≥ 100.
c) 2 + 1 = 3.
a) ¬p
b) p ∨ q
c) p → q
d) p ∧ q
e) p ↔ q
f) ¬p → ¬q
g) ¬p ∧ ¬q
h) ¬p ∨ (p ∧ q)
“Swimming at the New Jersey shore is allowed” and “Sharks have been spotted near the
shore,” respectively.
a) ¬q
b) p ∧ q
c) ¬p ∨ q
d) p → ¬q
e) ¬q → p
f) ¬p → ¬q
g) p ↔ ¬q
h) ¬p ∧ (p ∨ ¬q)
Write these propositions using p and q and logical connectives (including negations).
b) You drive over 65 miles per hour, but you do not get a speeding ticket.
c) You will get a speeding ticket if you drive over 65 miles per hour.
d) If you do not drive over 65 miles per hour, then you will not get a speeding ticket.
e) Driving over 65 miles per hour is sufficient for getting a speeding ticket.
f) You get a speeding ticket, but you do not drive over 65 miles per hour.
g) Whenever you get a speeding ticket, you are driving over 65 miles per hour.
9. State the converse, contrapositive, and inverse of each of these conditional statements.
10. How many rows appear in a truth table for each of these compound propositions?
a) p → ¬p
b) (p ∨ ¬r) ∧ (q ∨ ¬s)
c) q ∨ p ∨ ¬s ∨ ¬r ∨ ¬t ∨ u
d) (p ∧ r ∧ t) ↔ (q ∧ t)
12. Find the bitwise OR, bitwise AND, and bitwise XOR of each of these pairs of bit strings.
13.Prove that ¬(p ∨ (¬p ∧ q)) and ¬p ∧ ¬q are logically equivalent using propositional
equivalences laws.
14. Prove that (p → r) ∨ (q → r) and (p ∧ q) → r are logically equivalent using propositional
equivalences laws.
15. Let P(x) denote the statement “x ≤ 4.” What are these truth values?
a) P(0)
b) P(4)
c) P(6)
16. Translate these statements into English, where C(x) is “x is a comedian” and F(x) is “x is
a) ∀x(C(x) → F(x))
b) ∀x(C(x) ∧ F(x))
c) ∃x(C(x) → F(x))
d) ∃x(C(x) ∧ F(x))
17. Let P(x) be the statement “x spends more than five hours every weekday in class,” where
the domain for x consists of all students. Express each of these quantifications in English.
a) ∃x P(x)
b) ∀x P(x)
c) ∃x -P(x)
d) ∀x -P(x)
If the domain consists of the integers, what are these truth values?
a) P(0)
b) P(1)
c) P(2)
d) P(−1)
e) ∃xP(x)
f ) ∀xP(x)
19. Translate each of these statements into logical expressions using predicates, quantifiers,
a) No one is perfect.
a) ∀x(x2 ≥ x)
c) ∀x(x = 1)
b) {{1}}, {1,{1}}
c) ∅,{∅}
a) ∅ ∈ {∅}
b) ∅ ∈ {∅, {∅}}
c) {∅} ∈ {∅}
d) {∅} ∈ {{∅}}
f) {{∅}} ⊂ {∅,{∅}}
24. What is the cardinality of each of these sets?
a) {a}
b) {{a}}
c) {a, {a}}
a) A × B.
b) B × A.
a. A ∪ B.
b. A ∩ B.
c. A − B.
d. B − A.
a. A ∪ B
b. A ∪ C
c. B ∪ C
d. B ∪ D
e. (A ∪ B) ∪ C
f. A ∪ (B ∪ C)
g. B ∪ (C ∪ D)
a. A ∩ B
b. A ∪ C
c. A − B
d. A ∩ ( B∪C)
29. Find A²
a. A = {0, 1, 3}.
b. A = {1, 2, a, b}
a. A
b. B
c. A U B
d. A ∩ B
31. Let X = {1,3,5} and Y = {s, t, u, v}. Define f: X → Y by the following arrow diagram.
d) Is 3 a preimage of s? Is 1 a preimage of u?
33. Determine whether each of these functions from {a, b, c, d} to itself is one-to-one.
34. Let F the function from {a,b,c} to {1,2,3} such that F(a)=2, F(b)=3, F(c)=1
8. Answers:
a. a) ¬p
b. b) p ∧ ¬q
c. c) p → q
d. d) ¬p → ¬q
e. e) p → q
f. f) q ∧ ¬p
g. g) q → p
9. Answers:
Inverse: If it does not snow tonight, then I will not stay home.
Contrapositive: If I do not sleep until noon, then I did not stay up late.
10. Answers
11. Answer
12. Answer
a. a) bitwise OR = 111 1111; bitwise AND= 000 0000; bitwise XOR = 1111111
b. b) bitwise OR = 1111 1010; bitwise AND= 1010 0000; bitwise XOR = 0101 1010
c. c) bitwise OR= 10 01111001; bitwise AND= 00 0100 0000; bitwise XOR= 10 00111001
d. d) bitwise OR= 1111111111; bitwise AND= 00 0000 0000; bitwise XOR= 1111111111
13. Answer
14. Answer
15. Answer
a. a) T
b. b) T
c. c) F
16. Answer
a. a) "Every comedian is funny."
b. b) "Every person is a funny comedian
c. c) There exists a person such that ifs/he is a comedian, then s/he is funny.".
d. d) ''There exists a funny comedian"
17. Answer
a. a) There is a student who spends more than five hours every weekday in class.
b. b) Every student spends more than five hours every weekday in class.
c. c) There is a student who does not spend more than five hours every weekday in class.
d. d) No student spends more than five hours every weekday in class
18. Answer
a. a) T
b. b) T
c. C) F
d. d) F
e. e) T
f. f) F
19. Answer
22. Answer
23. Answer
a. a) true
b. b) true
c. c) false
d. d) true
e. e) true—the one element in the set on the left is an element of the set on the right, and
the sets
f. are not equal
g. f) true—similar to part (e)
24. Answer
a. a)1
b. b)1
c. c)2
d. d)3
25. Answer
26. Answer
a. We include all numbers that are in one or both of the sets, obtaining {0, 1, 2, 3, 4, 5, 6}.
b. There is only one number in both of these sets, so the answer is {3}.
c. The set of numbers in A but not in B is {1, 2, 4, 5}.
d. The set of numbers in B but not in A is {0, 6}.
27. Answer
a. {2, 3, 4, 5, 6, 7}
b. {2, 3, 4, 5, 6, 7, 8, 9}
c. {4, 5, 6, 7, 8, 9}
d. {4, 5, 6, 7, 8, 9, 10, 11}
e. {2, 3, 4, 5, 6, 7, 8, 9}
f. {2, 3, 4, 5, 6, 7, 8, 9}
g. {4, 5, 6, 7, 8, 9, 10, 11}
28. Answer
a. a. {3,4,5}
b. b. {1,2,3,4,5,6,7}
c. c. {1,2}
d. d. {1}
29. Answer
30. Answer
a. a. A = { a, b, d, e, g, h }
b. b. B = { b, c, e, f, i, j, h }
c. c. A U B = { a, b, c, d, e, f, g, h, i, j }
d. d. A ∩ B = { b, e, h }
31. Answer
a. a) Domain is X = {1,3,5}, Co-domain is Y={s,t,u,v}
b. b) f(1) = v, f(3) = s, and f(5) = v
c. c) The range of f is {s,v}
d. d) Yes. No.
e. e) Preimage of S = {3}, u = ∅, v = {1,5}
f. f) f = {(1,v), (3,s), (5,v)}
32. Answer
a. F is not one-to-one because F(c) = F(d) = {e}. F is onto because all Co-domain elements
are used.
b. G is not one-to-one because F(a) = F(b) = {f}. G is not onto because {g} has no preimage.
33. Answer
a. This is one-to-one.
b. This is not one-to-one, since b is the image of both a and b.
c. This is not one-to-one, since d is the image of both a and d.
34. Answer