CPSC 121: Models of Computation
Assignment #5, due Tuesday April 7th , 2015 at 17:00
[6] 1. Design a DFA that accepts exactly the strings over the alphabet cfw_A, B, . . . , Z in
which every pair of consecutive Es occurs before every pair of consecutive O
CPSC 121: Models of Computation
Assignment #5, due Friday, July 13th , 2007 at 14:25
[12] 1. Consider the theorem: for all integers a, b and c, if a divides b and a does not divide c, then
a does not divide b + c.
[6] a. Prove this theorem using the contr
CPSC 121: Models of Computation
Assignment #6, Not to be handed in.
1. Evaluate the sum
n
S(n) =
k
(k + 1)!
k=1
for n = 1, 2, 3, 4, 5. Make a conjecture about a formula for S(n) that works for every n 1, and then
prove your conjecture by mathematical indu
CPSC 121: Models of Computation
Assignment #4, due Monday, March 16th , 2015 at 17:00
Each of the following questions asks you to prove (or disprove) a theorem. When the
theorem is stated in English, it would be an excellent idea to rst rewrite it in pred
a) Prove or disprove the following statement without using a truth table:
p(x) , q(z,y) are predicates with Z as the domain of discourse for each variable.
xy [ (p(x) z q(z,y) ) (z q(z,y) p(x)] xy [p(x) z q(z,y)]
Recall: To prove logical equivalences, sel
CPSC 121: Models of Computation
Assignment #3, due Monday, March 2th , 2015 at 17:00
[15] 1. Consider the following predicates over the set U of all UBC students at the Vancouver
or the Okanagan campus:
G(x): x is a gourmet chef.
I(x): x speaks Italian.
CPSC 121: Models of Computation
Assignment #2, due Thursday February 5th , 2015 at 17:00
[6] 1. Computers represent characters by associating with each character a specic sequence of 0s and 1s. In this question, you will be dealing with the ASCII and
Unic
CPSC 121: Models of Computation
Assignment #1 Solution
[10] 1. When we use a computational system, such as a circuit built out of gates, or (later in the
course) regular expressions, we like it to have as many features as possible since it
makes it more c
Introduction to Predicate Logic
Contents
Introduction
Predicates and Quantifiers
Variables: bound and unbound
Examples of Using the Existential and Universal Quantifiers
Predicate Logic Definitions and Rules
Universal and Existential Instantiation (
CPSC 121,
2005/6 Winter Term 2, Section 203
Quiz 2
Name: SAMPLE SOLUTION_
Student ID: _
Signature: _
You have 30 minutes to write the 3 questions on this examination.
A total of 40 marks are available. You may want to complete what
you consider to be the
For theorems like:
You might try:
WLOG
x D, P (x).
Exhaustion
Cases
In which case, write:
WLOG, let x be an element of D.
We proceed by exhaustion over D.
Note that Q(x) or
R(x) must be true.
And then prove:
P (x).
P (d) for each element d in D.
x D, Q(x)
Question 1
A.
x
0
1
y
1
0
B.
x
0
0
1
1
y
0
1
0
1
z
0
1
1
1
b
0
1
0
1
x
0
0
0
1
C.
a
0
0
1
1
D.
Any logic function with a truth table over k atomic propositions can be implemented with a
circuit that uses only 2-input NOR gates because the NOR gates can bu
Lecture Notes : Signed Binary/Decimal Conversion Using the
Two's Complement Representation
Students in 121 often find that Epp's coverage of this topic is insufficient for the course.
So, we offer this supplement that explains the two meanings of "two's c
CPSC 121,
2005/6 Winter Term 2, Section 203
Quiz 1
Name: SOLUTION_
Student ID: _
Signature: _
You have 25 minutes to write the 4 questions on this examination.
A total of 40 marks are available. Each question is worth 10 marks.
You may want to complete wh
Worked Proofs and Proof Critiques for Induction
CPSC 121
Worked Proof: Introductions for a Group of Size n
Insight: Take one person out of a group of n, and you have a group of n-1.
Definitions: An introduction is one person saying hello to one other pers
Example:SocialInsuranceNumber
CanadasSocialInsuranceNumber(SIN)wasintroducedin1964toserveasanaccountnumber
forthenewlycreatedCanadaPensionPlanandforotheremploymentinsuranceprograms.In
1967,RevenueCanada(nowtheCanadaRevenueAgency)startedusingtheSINfortax
r
Daves CPSC 121 Lecture 8 Notes
1. Simple Oddity
Prove that if x is odd then (x + 4) is odd.
Mathematically:
O(x) x is odd
x Z, O(x) O(x + 4)
or, recall that (x is odd) (k Z, x = 2k + 1)
so it can also be written as:
x Z, (k Z, x = 2k + 1) (m Z, x + 4 = 2m
Daves CPSC 121 Lecture 9 Notes
1. An Indirect Proof by Contradiction I
For any integer n, prove that n2 2 is not divisible by 4.
Note that there are several equivalent ways of writing this mathematically:
a) n Z, 4 (n2 2)
b) n Z, (4 | (n2 2)
c) n Z, m Z,
Proof Techniques: An Introductory Tutorial
Table of Contents
1
2
3
4
5
6
Introduction . 3
Definitions . 3
A (Simple) Proof Technique Taxonomy . 7
How to Choose a Proof Technique Category . 8
Example Proofs .12
Exercises .29
1 Introduction
This is a tutori
Introduction to Predicate Logic
Contents
Introduction
Predicates and Quantifiers
Variables: bound and unbound
Examples of Using the Existential and Universal Quantifiers
Predicate Logic Definitions and Rules
Universal and Existential Instantiation (
Tutorial Week 8
1. Given the following statement, what approach could you take to prove this?
Note: You do not have enough information to actually prove the statement, so just give a general
outline of how you would start the proof.
y D, z D, (P (y) Q(y,
Tutorial Week 3
1. Represent 160910 in binary
2. Represent 110001112 in decimal
3. Find the signed and unsigned decimal representation of 11110010
4. Find the 2s complement of 9610 .
5. Prove using a sequence of logical equivalences that: (p s) (p (s p) p
Tutorial Week 10
1. Give state diagrams of DFAs that recognize the following languages. In all parts the
alphabet is 0,1:
a) cfw_w | w begins with a 1 and ends with a 0
b) cfw_w | w contains at least three 1s
c) cfw_w | w doesnt contain the substring 11
Tutorial Week 6
1. Express each of these statements using logical operators, predicates and quantiers. Let T (x) mean
that x is a tautology and C(x) mean that x is a contradiction.
a) Some propositions are tautologies.
b) The negation of a contradiction i
Tutorial Week 4
1. Prove b using a formal propositional logic proof given the ve numbered premises
below:
1. (p q) p
2. r p
3. (r a)
4. (a b)
5. (q s) t
2. Steve has bizarre powers of observation, and noticed the following facts during a sta
meeting, whil
Tutorial Week 1
1. Are the following circuits logically equivalent?
(a)
P
AND
Q
NOT
AND
OR
AND
NOT
(b)
P
Q
OR
2. You are travelling in a country where every inhabitant is either a truthteller who always tells the truth or a liar who always lies. You meet
Tutorial Week 2
1. Translate the following Truth Table to a propositional logic statement:
Can you simplify it?
p
F
F
F
F
T
T
T
T
Truth Table
q r output
F F T
F T T
T F T
T T F
F F F
F T T
T F F
T T F
(hints : the brute force approach needs three variable