0% found this document useful (0 votes)
2 views

Discrete maths: Assignment 1

The document contains a series of exercises and problems related to discrete mathematics, focusing on set theory, relations, and logical equivalences. It includes various questions and answers regarding integers, sets, relations, and truth tables. The exercises are structured to enhance understanding of mathematical concepts and logical reasoning.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Discrete maths: Assignment 1

The document contains a series of exercises and problems related to discrete mathematics, focusing on set theory, relations, and logical equivalences. It includes various questions and answers regarding integers, sets, relations, and truth tables. The exercises are structured to enhance understanding of mathematical concepts and logical reasoning.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 15

Bry’Nice Berley

Discrete Mathematics
Professor Lazlo
1/29/24
CSIS 2050: Assignment 1
Exercise Set 1.1- #2
1. Is there an integer that has a remainder of 2 when it is divided by 5 and a remainder of 3
when it is divided by 6?
a. Is there an integer n such that n has n = 27 (Or: 3 cubed is 27)?
b. Does there exist an integer such that if n is divided by 5 the remainder is 2 and if
n is divided by 6?

Exercise Set 1.2- #4, 8, 9, 12


2.
a. Is 2 € {2}?

Yes

b. How many elements are in the set {2, 2, 2, 2}?


4 elements

c. How many elements are in the set {0, {0}}?


2 elements

d. Is {0} ∈ {{0}, {1}}?


Yes

e. Is 0 ∈ {{0}, {1}}?
No

3. Let A = {c, d, f, g}, B = {f, j}, and C = {d, g}. Answer each of the following questions.
Give reasons for your answers.
a. Is B ⊆ A?
No, because the letter j is not an element of A

b. Is C ⊆ A?
Yes, because subset A contains letters d and g
c. Is C ⊆ C?
Yes, because subset C contains letters d and g

d. Is C a proper subset of A?
Yes, because C is a proper subset of A. Every element in C is in A, and elements c
and f are not in C.

4.
a. Is 3 ∈ {1, 2, 3}?
3 is an element of {1, 2, 3}

b. Is 1 ⊆ {1}?
No, because 1 would have to be a set and an element in the set of {1}, thus it
cannot be a subset.

c. Is {2} ∈ {1, 2}?


No, because the set would have to contain the element {2}

d. Is {3} ∈ {1, {2}, {3}}?


Yes, because the element {3} is in the set

e. Is 1 ∈ {1}?
Yes, because 1 is an element in the set

f. Is {2} ⊆ {1, {2}, {3}}?


No, because 2 is the only element in {2} and 2 is not one of the three elements in
{1, {2}, {3}}.

g. Is {1} ⊆ {1, 2}?


Yes, because {1} is a subset

h. Is 1 ∈ {{1}, 2}?
No, because 1 would have to be an element in the set

i. Is {1} ⊆ {1, {2}}?


Yes, because {1} is a subset and is an element of the set

j. Is {1} ⊆ {1}?
Yes, because every element of the set is equal to {1}

5. Let S = {2, 4, 6} and T = {1, 3, 5}. Use the set roster notation to write each of the
following sets, and indicate the number of elements that are in each set.
a. S x T
{(2, 1), (2, 3), (2, 5), (4, 1), (4, 3), (4, 5), (6, 1), (6, 3), (6, 5)}
= 9 elements

b. T x S
{(1, 2), (1, 4), (1, 6), (3, 2), (3, 4), (3, 6), (5, 2), (5, 4), (5, 6)}
= 9 elements

c. S x S
{(2, 2), (2, 4), (2, 6), (4, 2), (4, 4), (4, 6), (6, 2), (6, 4), (6, 6)}
= 9 elements

d. T x T
{(1, 1), (1, 3), (1, 5), (3, 1), (3, 3), (3, 5), (5, 1), (5, 3), (5,5)}
= 9 elements

Exercise Set 1.3- #2, 6, 10, 12, 15

6. Let C = D = {-3, -2, -1, 1, 2, 3} and define a relation S from C to D as follows: For every
(x, y) ∈ C X D,

1 1
(x, y) ∈ S means that - is an integer.
x y

a. Is 2 S 2? True
Is -1 S -1? True
Is (3, 3) S? True
Is (3, -3) ∈ S? True

b. Write S as a set of ordered pairs.


C X D = {(-3, -3), (-3, -2), (-3, -1), (-3, 1), (-3, 2), (-3, 3), (-2, -3), (-2, -2), (-2, -1), (-
2, 1), (-2, 2), (-2, 3), (-1, -3), (-1, -2), (-1, -1), (-1, 1), (-1, 2), (-1, 3), (1, -3), (1, -2), (1,
-1), (1, 1), (1, 2), (1, 3), (2, -3), (2, -2), (2, -1), (2, 1), (2, 2), (2, 3), (3, -3), (3, -2), (3, -
1), (3, 1), (3, 2), (3, 3)}

c. Write the domain and co-domain of S.


The domain of S is {-3, -2, -1, 1, 2, 3} and the co-domain is {-3, -2, -1, 1, 2, 3}.

d. Draw an arrow diagram for S.


1 1
2 2
3 3
-1 -1
-2 -2
-3 -3

7. Define a relation R from R to R as follows:


For every (x, y) ∈ R X R,
(x, y) ∈ R means that y = x 2 .
a. Is (2, 4) ∈ R? True
Is (4, 2) ∈ R? False
Is (-3) R 9? True
Is 9 R (-3)? False

b. Draw the graph of R in the Cartesian plane.


8. Find four relations from {a, b} to {x, y} that are not functions from {a, b} to {x, y}.
{(a, x)}, {(a, y)}, {(b, x)}, {(b, y)}

9. Let A = {x, y} and let S be the set of all strings over A. Define a relation C from S to S as
follows:
For all strings s and t in S,
(s, t) ∈ C means that t = ys.

Then C is a function because every string in S consists entirely of x’s and y’s and adding
an additional y on the left creates a single new string that consists of x’s and y’s and is,
therefore, also in S. Find C(x) and C(yyxyx)

C(x) = yyxy
C(yyxyx) = yyyxy

10. Let X = {2, 4, 5} and Y = {1, 2, 4, 6}. Which of the following arrow diagrams determine
functions from X to Y?
Diagram D.

Exercise Set 1.4- #4, 9


11. Graph H has vertex set {y1, y2, y3, y4, y5} and edge set {e1, e2, e3, e4} with edge-
endpoint function as follows:
e1

e2 v2
v1
e3
e4
v4
v5 v3

12.
 Find all edges that are incident on v 1 .
e1 , e2 , e7

 Find all vertices that are adjacent to v 3.


v 1 and v 2

 Find all edges that are adjacent to e 1.


e2 , e3 , e4 , e5 , e6 , e7

 Find all loops.


e 1, e 3 , v 2 , v 5

 Find all parallel edges.


e 4 and e 5

 Find all isolated vertices.


v4

 Find the degree of v 3.


v 3 has a degree of 3

Exercise Set 2.1- #2, 4, 13, 17, 26, 28


13.
a. If all computer programs contain errors, then this program contains an error.
This program does not contain an error.
Therefore, it is not the case that all computer programs contain errors.

b. If p ⟶ q,
∼ q then ∴ ∼ p
2 is not odd.
Therefore, it is not the case that all prime numbers are odd.

14.
a. If the program syntax is faulty, then the computer will generate an error message.
If the computer generates an error message, then the program will not run.
Therefore, if the program syntax is faulty, then the program will not run.

b. If this simple graph p → q, then it is complete. If this graph p → q , then any two of
its vertices can be joined by a path. Therefore, if this simple graph has 4 vertices and
6 edges, then ∴ p .

15. Write truth tables for the statement for


∼ ( p ∧q ) ∨( p ∨q )
p q p ∧q p ∨q ∼( p ∧ q) ∼ ( p ∧q ) ∨( p ∨q )

0 0 0 0 1 1

0 1 0 1 1 1

1 0 0 1 1 1

1 1 1 1 0 1

16. Determine whether the statement forms are logically equivalent.


∼ ( p ∧q )∧∼ p ∧∼ q

p q ∼p ∼q p ∧q ∼( p ∧ q) ∼ p ∧∼ q

0 0 1 1 0 1 1

0 1 1 0 0 1 0

1 0 0 1 0 1 0

1 1 0 0 1 0 0

No, the statement forms are not logically equivalent because the columns are not the
same.

17. Sam is an orange belt and Kate is a red belt.


Sam is an orange belt or Kate is a red belt.

18. The train is late or my watch is fast.


The train is late and my watch is fast.

Exercise Set 2.2- #13(b), 18, 25


19. Use truth tables to verify the following logical equivalences. Include a few words of
explanation with your answers.

∼ ( p → q ) ≡ p ∧∼ q .
p q ∼q p→q p ∧∼ q ∼( p → q)

0 0 1 1 0 0

0 1 0 1 0 0

1 0 1 0 1 1

1 1 0 1 0 0

Yes, the statement forms are logically equivalent because the columns are the same.

20. Write each of the following three statements in symbolic form and determine which pairs
are logically equivalent. Include truth tables and a few words of explanation. ***

If it walks like a duck and it talks like a duck, then it is a duck.

Either it does not walk like a duck or it does not talk like a duck, or it is a duck.
If it does not walk like a duck and it does not talk like a duck, then it is not a duck.

p ∧q → r and ∼ p ∨∼ q ∨ r and ∼ p ∧∼ q → ∼ r

p q r ∼p ∼q ∼r p ∧q ∼ p ∧∼ q ∼ p ∨∼ q p ∧q → r∼ p ∨∼ ∼
q ∨pr∧∼ q → ∼ r

0 0 0 1 1 1 0 1 0 0 0 0

0 0 1 1 1 0 0 1 0 0 0 1

0 1 0 1 0 1 0 1 1 0 0 0

0 1 1 1 0 0 0 1 1 0 0 1

1 0 0 0 1 1 0 1 1 0 0 0

1 0 1 0 1 0 0 1 1 0 0 1

1 1 0 0 0 1 1 0 1 1 1 0
1 1 1 0 0 0 1 0 1 1 1 0

Statements 1 and 2 are logically equivalent, but Statement 3 is not because the columns
are not the same.

21. Use truth tables to establish the truth of each statement

A conditional statement is not logically equivalent to its inverse.

p q p→q ∼ p→ q

0 0 1 0

0 1 1 1

1 0 0 1

1 1 1 0

Exercise Set 2.3- #10, 12(b), 13, 28, 29, 30, 31


22. Use truth tables to determine whether the argument forms.
p ∨q → r
∴ ∼r →∼ p ∧∼ q

p q r ∼p ∼q ∼r p ∨q ∼ p ∧∼ q ∼ p ∨∼ q ∼ r→
p ∨q →∼r p ∧∼ q

0 0 0 1 1 1 0 0 0 1 0

0 0 1 1 1 0 0 0 0 1 1

0 1 0 1 0 1 1 0 1 0 0

0 1 1 1 0 0 1 0 1 1 1

1 0 0 0 1 1 1 0 1 0 0
1 0 1 0 1 0 1 0 1 1 1

1 1 0 0 0 1 1 1 1 0 1

1 1 1 0 0 0 1 1 1 1 1

23. p → q
∼p
∴ ∼q
(inverse error)
p q ∼p q p→q

0 0 1 1 1

0 1 1 0 1

1 0 0 1 0

1 1 0 0 1

24. Modus tollens:


p→q
∼q
∴∼ p

p q p→q q ∼p

0 0 1 1 1

0 1 1 0 1

1 0 0 1 0

1 1 1 0 0

Columns 2 and 3 are the premises and column 4 is the conclusion. The argument form is
proven to be valid because the first row has the same value of 1.
25. If there are as many rational numbers as there are irrational numbers, then the set of all
irrational numbers is infinite.
The set of all irrational numbers is infinite.
∴ There are as many rational numbers as there are irrational numbers.

p→q
q
∴p
The argument is valid and it uses the converse error.

26. If at least one of these two numbers is divisible by 6, then the product of these two
numbers is divisible by 6.
Neither of these two numbers is divisible by 6.
∴ The product of these two numbers is not divisible by 6.
p→q
q
∴ q
The argument is valid and it uses the inverse error.

27. If this computer program is correct, then it produces the correct output when run with the
test data my teacher gave me.
This computer program produces the correct output when run with the test data my
teacher gave me.
∴ This computer program is correct.
p→q
q
∴p
The argument is valid and it uses converse error.

28. Sandra knows Java and Sandra knows C + +.


∴ Sandra knows C + +.
p ∧q
∴q
This argument is valid and it uses converse error.

Exercise Set 3.1- #5, 10, 12, 30


29. Find the truth set of each predicate.
a. Predicate 6/d is an integer, domain: Z
{-6, -3, -2, -1, 1, 2, 3, 6}

b. Predicate 6/d is an integer, domain Z+ ¿¿


{1, 2, 3, 6}

c. Predicate: 1 ≤ x 2 ≤ 4, domain: R
{x ∈ R -2 ≤ x ≤ -1}
{x ∈ R 1 ≤ x ≤ 2}

Interval notation: [-2, -1] ∪ [1, 2]

d. Predicate: 1 ≤ x 2 ≤ 4, domain: Z
{-2, -1, 1, 2}

30. ∀ a ∈ Z, (a – 1)/a is not an integer.


−1−−1 −2
= =2
−1 −1

This statement is false.

31. ∀ real numbers x and y, √ x+ y = √ x + √ y .


Perfect squares: 4 and 25
√ 4 +25 = √ 4 + √ 25
√ 29 = 2 + 5
√ 29 = 7
This statement is false.

32. Let the domain of x be Z, the set of integers, and let Odd(x) be “x is odd,” Prime(x) be “x
is prime,” and Square(x) be “x is a perfect square.” (An integer n is said to be a perfect
square if, and only if, it equals the square of some integer. For example, 25 is a perfect
square because 25 = 52.)
a. ∃ x such that Prime(x) ∧∼Odd(x)
There exists an integer that is not odd and it is a prime integer.
12
=6
2
True

b. ∀ x , Prime(x) → ∼ Square(x)
For all integers, if it prime, then it is not a square.
False
2
5 = 25

c. ∃ x such that Odd(x) ∧ Square(x)


There exists an integer that is odd and a square.
True
2
3 =9

Exercise Set 3.2- #4, 10, 12, 19


33. Write an informal negation for each of the following statements. Be careful to avoid
negations that are ambiguous.
a. All dogs are friendly.
There exists a dog such that it is not friendly.

b. All graphs are connected.


There exists a graph such that it is not connected.

c. Some suspicions were substantiated.


All suspicions were unsubstantiated.

d. Some estimates are accurate.


All estimates are inaccurate.

34. ∀ computer program P, if P compiles without error messages, then P is correct.


There exists a computer program, if P compiles without error messages, then P is
incorrect.

35. Statement: The product of any irrational number and any rational number is irrational.
Proposed negation: The product of any irrational number and any rational number is
rational.
There exists a number that is a product of a rational and irrational number, then it is a
rational number.

36. ∀ n ∈ Z, if n is prime then n is odd or n = 2.


∃n that is an element of an integer that is prime and odd.

Exercise Set 3.3- #6, 8, 10, 35, 36


37. For every square x there is a circle y such that x and y have different colors and y is
above x.
Yes, this is true because b, which is a circle, is above e, which is a square.

38. There is a triangle x such that for every circle y, y is above x.


Yes, this is true because a, which is a circle, is above f, which is a triangle.

39. This exercise refers to Example 3.3.3. Determine whether each of the following
statements is true or false.
a. ∀ student S, ∃ a dessert D such that S chose D.
Every student chose at least one dessert. This is true because every student chose at
least one dessert.

b. ∀ student S, ∃ a salad T such that S chose T.


Every student chose at least one salad. This is false because Yuen did not choose a
salad.

c. ∃ a dessert D such that ∀ student S, S chose D.


There is a dessert that was chosen by every student. This is true because every student
chose pie.

d. ∃ a beverage B such that ∀ student D, D chose B.


There is a beverage where every student chose a dessert. This is true because every
student chose a beverage and a dessert.

e. ∃ an item I that ∀ student S, S did not choose I.


There is an item that every student chose. This is false because Yuen did not choose a
salad.

f. ∃ a station Z such that ∀ student S, ∃ an item I such that S chose I from Z.


There is a station where every student chose at least one item. This is true because
every student chose at least one item from the dessert station.

40. Everybody trusts somebody.


a. ∀ x ∃y, T (x, y)
∃ x ∀ y , T (x , y )

b. For all people, there exists at least one person to trust.

41. Somebody trusts everybody.


a. ∃ x ∀ yT (x, y)
∀ x ∃y, ~ T (x, y)
b. There exists at least one person that trusts all people.

Exercise Set 3.4- #11, 12, 13, 14, 15


42. All cheaters sit in the back row.
Monty sits in the back row.
∴Monty is a cheater.

Invalid, converse error

43. If an 8-bit two’s complement represents a positive integer, then the 8-bit two’s
complement starts with a 0.
The 8-bit two’s complement for this integer does not start with a 0.
∴This integer is not positive.

Valid by universal modus tollens

44. For every student x, if x studies discrete mathematics, then x is good at logic.
Tarik studies discrete mathematics.
∴Tarik is good at logic.

Valid by universal modus ponens

45. If compilation of a computer program produces error messages, then the program is not
correct.
Compilation of this program does not produce error messages.
∴This program is correct.

Invalid, inverse error

46. Any sum of two rational numbers is rational.


The sum r + s is rational.
∴The numbers r and s are both rational.

Invalid, converse error

You might also like