CPSC 121: Models of Computation
Assignment #3, due Wednesday, October 23th , 2013 at 17:00
[12] 1. Consider the following predicates over the set U of all UBC students:
P(x): x is pursuing a BSc in physics.
K(x): x speaks Klingon.
C(x): x plays curling
CPSC 121: Models of Computation
Assignment #1, due Thursday, September 19th , 2013 at 17:00
[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
CPSC 121: Models of Computation
Assignment #4
Due: Wednesday, March 26, 2014 at 17:00
Total Marks: 30
Submission Instructions- read carefully
All assignments should be done in groups of 2. It is very important to work with another
student and exchange ide
CPSC 121: Models of Computation
Assignment #5
Due: Monday, April 7, 2014 at 17:00
Total Marks: 18
Submission Instructions- read carefully
All assignments should be done in groups of 2. It is very important to work with another
student and exchange ideas.
CPSC 121: Models of Computation
SAMPLE Final Exam, 2009 April 17
Name:
Student ID:
Signature:
Section (202, 203, or BCS):
The cover page on the real exam will be identical to this one except that (1) it will not include this line, (2)
the number of quest
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 #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
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
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 #3, due Friday, June 5th , 2015 at 18: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 predic
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
Lab #6: Sequential Circuits
Objectives
In this lab, you will learn more about sequential circuits and get some practice implementing them in Logisim. You will
also learn about a new type of memory called RAM, or random acce
CPSC 121: Models of Computation
Assignment #5, due Wednesday, November 27th , 2013 at 17:00
[6] 1. Design a nite state machine that takes in a string of bits, and terminates in an
accepting state if the string of bits ends with 10110. Clearly indicate the
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 #2, due Thursday October 3rd , 2013 at 17:00
[8] 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
Unico
CPSC 121
Lecture 4
January 12, 2009
Menu January 12, 2009 Topics: Representing Values Reading: Today: Epp 1.5 January 14: Epp 1.3 Reminders: Labs and tutorials have begun! On-line Quiz 3 deadline 9:00pm January 13 READ the WebCT Vista course announcements
CPSC 121: Models of Computation
Assignment #4, due Wednesday, November 6th , 2013 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
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
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
4/9/2015
https:/connect.ubc.ca/bbcswebdav/pid2729874dtcontentrid10605956_1/courses/CL.UBC.CPSC.121.202.2014W2.47458/quizsols%282
Quiz1
1.FT
FF
TT
TT
2.F
F
F
F
F
F
T
F
3.a^b
4.(~x^y)vz
5.Noneofthese,becauseitisadifferentlogicalstatement
6.(avb)^~(~avc)
7.N
CPSC 121 Midterm
Thursday, February 26th, 2015
[9] 1. Consider the circuit shown below:
[3] a. Write an unsimplied boolean algebraic expression for this circuit.
[4] b. Simplify this expression using a sequence of logical equivalences.
[2] c. Draw the sim
The University of British Columbia
CPSC 121 Section 202 Test 2
Wednesday, March 18th, 2015
Sample solution
Name:
_
Student ID: _
Signature:
Question
Marks
1
/8
2
/5
3
/7
Bonus
/2
Total
/20
_
You have 30 minutes to write the questions on this examination.
CPSC 121: Models of Computation
Lab #7: Circuit Design: Coding Theory
1
Prelab: Coding Theory
Coding theory is the study of how to transmit data reliably. Think about the game of telephone in which one
person whispers a message to another, who then passes
The University of British Columbia
CPSC 121 Section 202 Test 1
Wednesday, January 28th, 2015
Question
Marks
_
Student ID: _
Signature:
/8
2
Name:
1
/7
3
/5
Total
/20
_
You have 30 minutes to write the questions on this examination.
You are only allowed
CPSC 121: Models of Computation
Lab #7: Circuit Design: Coding Theory
1
Prelab: Coding Theory
Coding theory is the study of how to transmit data reliably. Think about the game of telephone in which one
person whispers a message to another, who then passes
CPSC 121: Models of Computation
Module 4: Propositional Logic Proofs
Module 4: Propositional Logic Proofs
By the start of this class you should be able to
Use truth tables to establish or refute the validity of
a rule of inference.
Given a rule of inferen
CPSC 121: Models of Computation
Unit 2: Conditionals and Logical Equivalences
Unit 2: Conditionals and Logical Equivalences
By the start of this class you should be able to
Translate back and forth between simple natural
language statements and propositio
CPSC 121: Models of Computation
Assignment #1
SOLUTIONS
Note: For most problems, the solution shown here is not the only correct solution.
Question 1 [ 12]
a. ~p
~ (p V p) . Therefore it is implemented by
b. p V q
~ (~(p V q) V ~(p V q) ) and is implement
CPSC 121 Sample Final Examination
April 2013
Name:
Student ID:
Signature:
You have 150 minutes to write the 11 questions on this examination. A total of 98 marks are available.
Justify all of your answers.
You are only allowed to bring in one hand-writ
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.
Tutorial Week 11
Note that there are more questions than time required for completion this week.
1. In a magical land of dragons and dinosaurs where 121 TAs live, there are only 3-cent
and 7-cent stamps. The post-office charges 1-cent per mile they have t
Tutorial Week 4
1. Prove b using a formal propositional logic proof given the five numbered premises
below:
1. (p q) p
2. r p
3. (r a)
4. (a b)
5. (q s) t
Solution
6.
( p q) p
7.
(p q) p
8.
p
9.
r
10. r a
11. a
12. b
by
by
by
by
by
by
by
1 and Implication
Tutorial Week 9
1. For the following statements, rewrite the statement in predicate logic, and then provide a proof strategy.
You do not have to prove the statements (but you could if you wanted to).
a. For any integer n, if n mod 5 is 3, then n2 mod 5 is
Tutorial Week 7
1. Express each of the statements using quantifiers, being sure to define the appropriate predicates and
domains. Then form the negation of the statement, so that no negation is to the left of a quantifier.
Next, express the negation in si
Tutorial Week 6
1. Express each of these statements using logical operators, predicates and quantifiers. Let T (x) mean
that x is a tautology and C(x) mean that x is a contradiction.
a) Some propositions are tautologies.
, xT (x)
b) The negation of a cont