CMPUT 272 (Stewart)
Lecture 18
Reading: Epp 8.5
Partial Order Relations: reflexive, antisymmetric, and transitive
Recall: A relation R on a set A is
antisymmetric x, y A, if (x, y) R and (y, x) R then x = y.
Examples:
1. on R
2. on A, where A is a set of
University of Alberta
CMPUT 272 Fall 2016
Practice Final Exam
(with extra questions the final exam will not be this long)
Question 1 For each of the following arguments, either establish the validity of the argument by
supplying a proof with reasons and l
CMPUT 272 (Stewart)
Lecture 17
Reading: Epp 1.3, 8.1-8.3
Recall:
A relation from a set A to a set B is a subset of A B.
If the ordered pair (a, b) is in the relation R, we say that
a is related to b
and we write:
(x, y) R or xRy.
Relations on two or more
CMPUT 272 (Stewart)
Lecture 10
Reading: Epp Chapter 5.1-5.3
Mathematical Induction
an additional rule of inference
for proving facts about all integers greater than or equal to a certain value
When do we use mathematical induction? Consider the followin
CMPUT 272
Lecture 13
Reading: Epp Chapter 5.5
Correctness of Algorithms [Floyd, Dijkstra, Hoare, late 1960s]
A specification of an algorithm is given by two statements describing the
input and output and the relationship between them:
a pre-condition and
CMPUT 272 (Stewart)
Lecture 14
Reading: Epp 6
Set Theory
Definition. A set is an unordered collection of distinct elements.
S = cfw_1, 2, 5, 10, 5, 4 set-roster notation
1 S, 5 S, 3
/ S element / member / in / not in
N = cfw_x Z | x 0 set-builder notatio
CMPUT 272 (Stewart)
Lecture 16
Reading: Epp Chapter 7
Examples of functions from last time:
1. f : X 7 Y where X = cfw_a, b, c, d, Y = cfw_0, 1, 2, 3, 4, and:
f (a) = 1
f (b) = 2
f (c) = 3
f (d) = 2
x f (x)
a
1
b
2
c
3
d
2
or
or
X
a
b
c
d
or
Y
0
1
2
3
4
f
CMPUT 272 (Stewart)
University of Alberta
Lecture 19
Reading: Epp 9.1-9.3
Counting
Recall: A set is finite if it has no elements or there is a one-to-one correspondence from cfw_1, 2, . . . , n to it for some n Z+ .
If A is a finite set, then the number o
CMPUT 272 (Stewart)
Lecture 15
Reading: Epp 1.2, 1.3, 6, 7.1, 7.2
Sets (continued)
Recall: Proofs in set theory:
Venn diagram may help to:
determine whether a claim is true or false
find a counterexample to a false universal claim
element method used
CMPUT 272 Fall 2016
Assignment 5
Posted Thurs Nov 17
Due Thurs Dec 1 at 10:45AM in your seminar sections drop box across from CSC 145
This is the mandatory assignment cover sheet;
without it, your work will not be marked.
Submitting student:
Seminar secti
University of Alberta CMPUT 272 Practice Term Test 2 Nov 2016 Partial Solutions
Question 1: Let P (n) be the predicate: f (n) 2n .
Theorem. For all n 3, P (n) is true.
Proof by strong mathematical induction:
Basis step: f (3) = f (2) + 2f (1) + 3 = 3 + 2
University of Alberta
CMPUT 272
Practice Term Test 1
Oct 2016
Solutions
Question 1 The symbol denotes exclusive or, meaning that for any two statements p and q,
p q is true if and only if exactly one of p and q is true.
a) Draw the truth table for ;
Solut
CMPUT 272 Fall 2016
Solutions to Exercises for Seminar #7: Oct 31 / Nov 1
These are the questions to practice for the seminars. The TAs will go over the solutions to these
and other questions in the seminars.
1. Given sets A and B, the symmetric differenc
CMPUT 272 Fall 2016
Solutions to Exercises for Seminar #8: Nov 14/15
1. Let R and S be relations on a set A. Prove or disprove each of the following statements.
(a) If R and S are transitive, is R S transitive?
Solution: Yes
Let x, y, z A such that (x, y)
CMPUT 272 Fall 2016
Solutions to Exercises for Seminar #9 Nov 21/22
1. (Epp 9.2.18) The diagram below shows the keypad for an automatic teller machine. As you
can see, the same sequence of keys represents a variety of different PINs. For instance, 2133,
A
CMPUT 272 (Stewart)
Lecture 10
Reading: Epp Chapter 5.1-5.3
Mathematical Induction
an additional rule of inference
for proving facts about all integers greater than or equal to a certain value
When do we use mathematical induction? Consider the followin
CMPUT 272 Fall 2016
Assignment 2
Posted Thurs Sept 15
Due Thurs Sept 29 at 10:45AM in your seminar sections drop box across from CSC 145
This is the mandatory assignment cover sheet;
without it, your work will not be marked.
Submitting student:
Seminar se
CMPUT 272 Fall 2016
Assignment 4
Posted Thurs Oct 20
Due Thurs Nov 3 at 10:45AM in your seminar sections drop box across from CSC 145
This is the mandatory assignment cover sheet;
without it, your work will not be marked.
Submitting student:
Seminar secti
CMPUT 272 Fall 2016
Assignment 3
Posted Thurs Oct 6
Due Thurs Oct 20 at 10:45AM in your seminar sections drop box across from CSC 145
This is the mandatory assignment cover sheet;
without it, your work will not be marked.
Submitting student:
Seminar secti
CMPUT 272 Fall 2016
Solutions to Exercises for Seminar #6: Oct 24/25
These are the questions to practice for the seminars. The TAs will go over the solutions to these
and other questions in the seminars.
1. A sequence f0 , f1 , f2 , . . . is defined by le
CMPUT 272 Fall 2016
Solutions to Exercises for Seminar #4: Oct 3/4
These are the questions to practice for the seminars. The TAs will go over the solutions to these
and other questions in the seminars.
1. (Epp. 4.1.30) Prove that for all integers m, if m
CMPUT 272 Fall 2016
Solutions to Exercises for Seminar #5: Oct 17/18
These are the questions to practice for the seminars. The TAs will go over the solutions to these
and other questions in the seminars.
1. Prove by induction that for all natural numbers
CMPUT 272 Fall 2016
Assignment 4
Posted Thurs Oct 20
Due Thurs Nov 3 at 10:45AM in your seminar sections drop box across from CSC 145
This is the mandatory assignment cover sheet;
without it, your work will not be marked.
Submitting student:
Seminar secti
CMPUT 272 Fall 2016
Solutions to Exercises for Seminar #2: Sept 19/20
These are the questions to practice for the seminars. The TAs will go over the solutions to these
and other questions in the seminars.
1. (Epp 2.5.30, 2.5.45) Perform the following conv
CMPUT 272 Fall 2016
Solutions to Exercises for Seminar #3: Sept 26/27
These are the questions to practice for the seminars. The TAs will go over the solutions to these
and other questions in the seminars.
1. (Epp 3.1.18) Let D be the set of all students a
CMPUT 272 Fall 2016
Solutions to Exercises for Seminar #1: Sept 12/13
These are the questions to practice for the seminars. The TAs will go over the solutions to these
and other questions in the seminars.
1. (Epp 2.2.14)
(a) Show that the following statem
Logical Equivalences and Rules of Inference for Quantifiers
CMPUT 272
Logical Equivalences involving 8 and 9 [Epp 3.2, Grimaldi 2.4]
Given predicates P (x) and Q(x), and domain D, the following logical equivalences hold.
1. Negation of a universal stateme