0% found this document useful (0 votes)
14 views16 pages

QUESTIONS - Discrete Structure Bab Elgam3a

Uploaded by

Shehab magdy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views16 pages

QUESTIONS - Discrete Structure Bab Elgam3a

Uploaded by

Shehab magdy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Discrete Structures ‫مكتبة باب الجامعة‬

1. Which of these sentences are propositions?

a) 2 + 3 = 5.

b) 5 + 7 = 10.

c) x + 2 = 11.

d) Answer this question.

2. Which of these are propositions?

a) Do not pass go.

b) What time is it?

c) There are no black flies in Maine.

d) 4 + x = 5.

e) The moon is made of green cheese.

f) 2n ≥ 100.

3. What is the negation of each of these propositions?

a) Linda is younger than Sanjay.

b) Mei makes more money than Isabella.

c) Moshe is taller than Monica.

d) Abby is richer than Ricardo.

4. What is the negation of each of these propositions?

a) Janice has more Facebook friends than Juan.

b) Quincy is smarter than Venkat.

c) Zelda drives more miles to school than Paola.


d) Briana sleeps longer than Gloria.6+

5. What is the negation of each of these propositions?

a) Mei has an MP3 player.

b) There is no pollution in New Jersey.

c) 2 + 1 = 3.

d) The summer in Maine is hot and sunny.

6. Let p and q be the propositions

p: I bought a lottery ticket this week.

q: I won the million-dollar jackpot.

Express each of these propositions as an English sentence.

a) ¬p

b) p ∨ q

c) p → q

d) p ∧ q

e) p ↔ q

f) ¬p → ¬q

g) ¬p ∧ ¬q

h) ¬p ∨ (p ∧ q)

7. Let p and q be the propositions

“Swimming at the New Jersey shore is allowed” and “Sharks have been spotted near the

shore,” respectively.

Express each of these compound propositions as an English sentence.

a) ¬q

b) p ∧ q
c) ¬p ∨ q

d) p → ¬q

e) ¬q → p

f) ¬p → ¬q

g) p ↔ ¬q

h) ¬p ∧ (p ∨ ¬q)

8. Let p and q be the propositions

p: You drive over 65 miles per hour.

q: You get a speeding ticket.

Write these propositions using p and q and logical connectives (including negations).

a) You do not drive over 65 miles per hour.

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.

a) If it snows tonight, then I will stay at home.

b) I go to the beach whenever it is a sunny summer day.

c) When I stay up late, it is necessary that I sleep until noon.

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)

11. Construct a truth table for ((p → q) → r) → s.

12. Find the bitwise OR, bitwise AND, and bitwise XOR of each of these pairs of bit strings.

a) 101 1110, 010 0001

b) 1111 0000, 1010 1010

c) 00 0111 0001, 10 0100 1000

d) 11 1111 1111, 00 0000 0000

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

funny” and the domain consists of all people.

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)

18. 14.Let P(x) be the statement “x = x2.”

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,

and logical connectives.

a) No one is perfect.

b) Not everyone is perfect.

c) All your friends are perfect.

d) At least one of your friends is perfect.

e) Everyone is your friend and is perfect.

f ) Not everybody is your friend or someone is not perfect.


20.Find a counterexample, if possible, to these universally quantified statements, where the

domain for all variables consists of all integers.

a) ∀x(x2 ≥ x)

b) ∀x(x > 0 ∨ x < 0)

c) ∀x(x = 1)

21. List the members of these sets.

a) {x | x is a real number such that x2 = 1}

b) {x | x is a positive integer less than 12}

c) {x | x is the square of an integer and x < 100}

d) {x | x is an integer such that x2 = 2}

22. Determine whether each of these pairs of sets are equal.

a) {1, 3, 3, 3, 5, 5, 5, 5, 5}, {5, 3, 1}

b) {{1}}, {1,{1}}

c) ∅,{∅}

23. Determine whether these statements are true or false.

a) ∅ ∈ {∅}

b) ∅ ∈ {∅, {∅}}

c) {∅} ∈ {∅}

d) {∅} ∈ {{∅}}

e) {∅} ⊂ {∅, {∅}}

f) {{∅}} ⊂ {∅,{∅}}
24. What is the cardinality of each of these sets?

a) {a}

b) {{a}}

c) {a, {a}}

d) {a, {a}, {a, {a}}}

25. Let A = {a, b, c, d} and B = {y,z}. Find

a) A × B.

b) B × A.

26. Let A = {1, 2, 3, 4, 5} and B = {0, 3, 6}. Find

a. A ∪ B.

b. A ∩ B.

c. A − B.

d. B − A.

27. If A = {2, 3, 4, 5} B = {4, 5, 6, 7} C = {6, 7, 8, 9} D = {8, 9, 10, 11}, find

a. A ∪ B

b. A ∪ C

c. B ∪ C

d. B ∪ D

e. (A ∪ B) ∪ C

f. A ∪ (B ∪ C)

g. B ∪ (C ∪ D)

28. If A = {1,2, 3, 4, 5} B = {3,4, 5, 6, 7} C = {2,3,5}. Find

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}

30. From the given Venn diagram find:

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.

a) Write the domain of f and the co-domain of f.

b) Find f (1), f (3), and f (5).

c) What is the range of f ?

d) Is 3 a preimage of s? Is 1 a preimage of u?

e) What is the preimage of s? of u? of v?

f) Represent f as a set of ordered pairs.


32. Let X = {a, b, c, d} and Y = {e, f, g}. Define functions F and G by the arrow diagrams below.

a) Is F one-to-one? Why or why not? Is it onto? Why or why not?

b) Is G one-to-one? Why or why not? Is it onto? Why or why not?

33. Determine whether each of these functions from {a, b, c, d} to itself is one-to-one.

a) f (a) = b, f (b) = a, f (c) = c, f (d) = d

b) f (a) = b, f (b) = b, f (c) = d, f (d) = c

c) f (a) = d, f (b) = b, f (c) = c, f (d) = d

34. Let F the function from {a,b,c} to {1,2,3} such that F(a)=2, F(b)=3, F(c)=1

Is F invertable?, and if it is , what is its inverse?


Answers
1. Answers:
a. a) True
b. b) False
c. c) False (Not proposition)
d. d) False (Not proposition)
2. Answers:
a. a) False
b. b) False
c. c) False
d. d) False
e. e) False
f. f) False
3. Answers:
a. a) Linda is not younger than Sanjay.
b. b) Mei does not make more money than Isabella. Or Isabella makes less money than
Mei.
c. c) Moshe is not taller than Monica Or Monica is shorter than Moshe
d. d) Abby is not richer than Ricardo Or Ricardo is poor than Abby
5. Answers:
a. a) Mei does not have an MP3 player.
b. b) There is pollution in New Jersey.
c. c) 2 + 1 ≠ 3.
d. d) The summer in Maine is not hot or it is not sunny.
6. Answers:
a. a) I did not buy a lottery ticket this week.
b. b) Either I bought a lottery ticket this week or [in the inclusive sense] I won the
million dollar jackpot
c. on Friday.
d. c) If I bought a lottery ticket this week, then I won the million dollar jackpot on
Friday.
e. d) I bought a lottery ticket this week and I won the million dollar jackpot on Friday.
f. e) I bought a lottery ticket this week if and only if I won the million dollar jackpot on
Friday.
g. f) If I did not buy a lottery ticket this week, then I did not win the million dollar
jackpot on Friday.
h. g) I did not buy a lottery ticket this week, and I did not win the million dollar jackpot
on Friday.
i. h) Either I did not buy a lottery ticket this week, or else I did buy one and won the
million dollar jackpot on Friday.
7. Answers:
a. a) Sharks have not been spotted near the shore.
b. b) Swimming at the New Jersey shore is allowed, and sharks have been spotted near
the shore.
c. c) Swimming at the New Jersey shore is not allowed, or sharks have been spotted
near the shore.
d. d) If swimming at the New Jersey shore is allowed, then sharks have not been
spotted near the shore.
e. e) If sharks have not been spotted near the shore, then swimming at the New Jersey
shore is allowed.
f. f) If swimming at the New Jersey shore is not allowed, then sharks have not been
spotted near the shore.
g. g) Swimming at the New Jersey shore is allowed if and only if sharks have not been
spotted near the shore.
h. h) Swimming at the New Jersey shore is not allowed, and either swimming at the
New Jersey shore is allowed or sharks have not been spotted near the shore.

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:

a) Converse: If I stay home, then it will snow tonight.

Contrapositive: If I do not stay at home, then it will not snow tonight.

Inverse: If it does not snow tonight, then I will not stay home.

b) Converse: Whenever I go to the beach, it is a sunny summer day.

Contrapositive: Whenever I do not go to the beach, it is not a sunny summer day.

Inverse: Whenever it is not a sunny day, I do not go to the beach.

c) Converse: If I sleep until noon, then I stayed up late.

Contrapositive: If I do not sleep until noon, then I did not stay up late.

Inverse: If I don’t stay up late, then I don’t sleep until noon.

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

P(x) be "x is perfect"; let F(x) be "x is your friend"

a. (a) ¬∃x(P (x))


b. (b) ¬∀x(P (x))
c. (c) ∀x (F(x) -> P(x))
d. (d) ∃x (F(x)/\P(x))
e. e) ∀x (F(x)/\P(x))
f. f) (¬∀x F(x)) V (¬∃x P(x))
20. Answer
a. a) this is true, so there is no counterexample.
b. b) false this is a counterexample 0
c. c). If is obviously false, and any other integer, such as -111749, provides a
counterexample.
21. 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

You might also like