Discrete maths: Assignment 1
Discrete maths: Assignment 1
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?
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.
e. Is 1 ∈ {1}?
Yes, because 1 is an element in the set
h. Is 1 ∈ {{1}, 2}?
No, because 1 would have to be an element in 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
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
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.
e2 v2
v1
e3
e4
v4
v5 v3
12.
Find all edges that are incident on v 1 .
e1 , e2 , e7
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 .
0 0 0 0 1 1
0 1 0 1 1 1
1 0 0 1 1 1
1 1 1 1 0 1
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.
∼ ( 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. ***
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.
p q p→q ∼ p→ q
0 0 1 0
0 1 1 1
1 0 0 1
1 1 1 0
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
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.
c. Predicate: 1 ≤ x 2 ≤ 4, domain: R
{x ∈ R -2 ≤ x ≤ -1}
{x ∈ R 1 ≤ x ≤ 2}
d. Predicate: 1 ≤ x 2 ≤ 4, domain: Z
{-2, -1, 1, 2}
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
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.
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.
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.
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.
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.