Assignment 1
Assignment 1
a) ¬p b) p q
d) p q
g) ¬p ¬q h) ¬p (p q)
p : It is below freezing.
q : It is snowing.
Write these propositions using p and q and logical connectives (including negations).
2
c) It is not below freezing and it is not snowing.
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.
a) 2 + 2 = 4 if and only if 1 + 1 = 2.
b) 1 + 1 = 2 if and only if 2 + 3 = 4.
a) If 1 + 1 = 2, then 2 + 2 = 5.
b) If 1 + 1 = 3, then 2 + 2 = 4.
c) If 1 + 1 = 3, then 2 + 2 = 5.
3
9. Write each of these statements in the
c) A sufficient condition for the warranty to be good is that you bought the computer less
than a year ago.
e) You can access the website only if you pay a subscription fee.
10. How many rows appear in a truth table for each of these compound propositions?
b) (p ¬r) (q ¬s) c) q p ¬s ¬r ¬t u
d) (p r t) e f) (p ¬t) (p ¬s)
g h) (p r s) (q t) (r ¬t)
a) p ¬p b) p ¬p c) (p d) (p q)
12. What is the value of x after each of these statements is encountered in a computer
program, if x = 1 before the statement is reached?
a) if x + 2 = 3 then x := x + 1
b) if (x + 1 = 3) OR (2x + 2 = 3) then x := x + 1
d) if (x + 1 = 2) XOR (x + 2 = 3) then x := x + 1
13. Find the bitwise OR, bitwise AND, and bitwise XOR of each of these pairs of bit strings.
4
1.2-Propositional Equivalences
1. Show that each of these conditional statements is a tautology by using truth tables.
a) (p q)
2. Show that each of these conditional statements is a tautology by using truth tables.
a) [¬p (p
4. State the value of x after the statement if P(x) then x:= 1is executed, where P(x) is the
, if the value of x when this statement is reached is
a) x = 0. b) x = 1. c) x = 2.
a) b) x(C(x) F(x))
c) d) x(C(x) F(x))
e) xP(x) f ) xP(x)
a) Q(0) c) Q(1)
9. Determine the truth value of each of these statements if the domain for all variables
consists of all integers.
10. Suppose that the domain of the propositional function P(x) consists of the integers 0, 1
and 4. Write out each of these propositions using disjunctions, conjunctions, and negations.
a) All parrots like fruit. My pet bird is not a parrot. Therefore, my pet bird does not like fruit.
b) Everyone who eats granola every day is healthy. Linda is not healthy. Therefore, Linda
does not eat granola every day.
d) A convertible car is fun to drive. Isaac's car is not a convertible. Therefore, Isaac's car is
not fun to drive.
6
e) If Mai knows French, Mai is smart. But Mai doesn't know French. So, she is not smart.
f) Lin can't go fishing if she doesn't have a bike. Last week, Lin went fishing with her
friends. Therefore, she has got a bike.
p q ?
0 0 0
0 1 0
1 0 1
1 1 0
Given that p = 1, q = 0, r = 1, t = 0
a) p q r t
b) p xor q r t
evaluated to 1
c) p q p q
d) p p q
7
Chapter 2: Basic Structures: Sets, Functions, Sequences,
and Sums
2.1 Sets
1. 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}
2. For each of the following sets, determine whether 2 is an element of that set.
a) {x R | x is an integer greater than 1} b) {x R | x is the square of an integer}
c) {2,{2}} d) {{2},{{2}}} e) {{2},{2,{2}}} f ) {{{2}}}
3. Determine whether each of these statements is true or false.
a) 0 b) {0} c) {0} d) {0}
e) {0} {0} f) {0} {0} g) { } { }
4. Determine whether each of these statements is true or false.
a) x {x} b) {x} {x} c) {x} {x}
d) {x} {{x}} e) {x} f) {x}
5. What is the cardinality of each of these sets?
a) {a} b) {{a}} c) {a, {a}} d) {a, {a}, {a, {a}}}
6. What is the cardinality of each of these sets?
a) b) { } c) { , { }} d) { , { }, { , { }}}
7. Find the power set of each of these sets, where a and b are distinct elements.
a) {a} b) {a, b} c) { , { }}
8. How many elements does each of these sets have where a and b are distinct elements?
a) P({a, b, {a, b}}) b) P({ , a, {a}, {{a}}}) c) P(P( ))
8
9. Find A2 and A3 if
a) A = {1, 3} b) A = {1, a }
10. Let A 1,2,3 and B 1, a . What is the cardinality of each of these sets?
a) A B b) A2 c) P B d) P B A e) A B
9
2.3 Functions
1. Study the following rules:
-1)
f(x) = 1/(2x-1)
Which rule describes a function?
2. Determine whether f is a function from Z to R if
1
a) f (n) = ±n b) f n n2 1 c) f n
n2 4
3. Find these values
1 2
e) 5.2 e) 2 e)
2 3
4. Determine whether each of these functions from {a, b, c, d} to itself is one-to-one (onto)
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
5. Determine whether each of these functions from Z to Z is one-to-one (onto)
n
b) f (n) = n2 + 1 c) f (n) = n3 d) f n
2
6.
b) f (m, n) = m2 2
c) f (m, n) = m + n + 1
e) f (m, n) = m2 f) f (m, n) = m + n
7. Determine whether each of these functions is a bijection from R to R.
2
+ 7 c) f (x) = (x + 1)/(x + 2) d) f (x) = x5 + 1
8
10
x
a) f (x) = 1 b) f (x) = 2x + 1 c) f x
5
9. Determine whether the following function is invertible
(i) F: R
(ii) G: Z
(iii) H: R R, H(x) = 2x-3
a) a0 b) a1 c) a4 d) a5
3. Find the first five terms of the sequence defined by each of these recurrence relations and
initial conditions.
a) an = 6a , a0 = 2 b) an an2 1 , a1 2 c) an = a + 3a , a0 = 1, a1 = 2
4. Find the solution to each of these recurrence relations and initial conditions.
a) an , a0 = 5 b) an = a + 3, a0 = 1 c) an = a 0 =4
1
a) j b) j2 c) 2
j S j j S j S
11