# CPSC Models of Computation Assignment due Friday February at

Document Sample

```					                                    CPSC 121: Models of Computation
Assignment #2, due Friday, February 13th, 2009 at 17:00

Submission Instructions
Type or write your assignment on clean sheets of paper with question numbers prominently labeled. Answers
that are difﬁcult to read or locate may lose marks. We recommend working problems on a draft copy then writing
a separate ﬁnal copy to submit.
Your submission must be stapled below the CPSC 121 assignment cover page—located at http://www.
ible reproduction of the same information. (If you are writing by hand, you may omit the text of the academic
conduct policy, but you must include and sign the statement “I understand the academic conduct policy and
certify that my assignment follows it.” and acknowledge assistance.) Additionally, include your name at the top
of each page. We are not responsible for lost pages from unstapled submissions.
Submit your assignment to the appropriately marked box outside of ICCS 011 by the due date and time listed
above. Late submissions are not accepted.
Note: the number of marks allocated to a question appears in square brackets before the question number.

Questions
[3] 1. Prove or disprove the following statement. (Note: R is the set of real numbers, R+ the set of positive
real numbers.)

∀x ∈ R+ , ∃y ∈ R, y < x and x2 < y 2 .

[6] 2. Read the deﬁnitions of the ﬂoor and ceiling functions in Epp, page 512 (ﬂoor) and page 517, exercise 5
(ceiling). Then prove that for every non-negative integer x, x/2 + x/2 = x. (Hint: break the proof
down into two cases, one where x is even and one where x is odd.)
[7] 3. Prove the following theorem using a direct proof.
A positive integer n is divisible by 2t if and only if the number consisting of the last t digits
of n is divisible by 2t .1
Hints: To prove a biconditional, you need to prove two implications. Also, consider that you can write
any number n as x10k + y, where y is the last k digits, and x is the rest of the number.
[10] 4. Consider the following theorem:
No matter what positive real number c we pick, there will be some positive integer n for
which n2 > c2n.

[3] a. Translate this theorem into ﬁrst-order logic.
[7] b. Prove the theorem using a direct proof.

[5] 5. Prove that for every two positive integers a and b, if a + b is odd, then either a is odd, or b is odd. (Hint:
consider proving the contrapositive.)
[5] 6. Prove that not every student who takes the CPSC 121 midterm exam will score above the average on the
exam. (Hint: try a proof by contradiction.)

For example where n = 38168 and t = 2, 38168 is divisible by 22 = 4, as are the last 2 digits 68. On the other hand, where
1

n = 10440260 and t = 4, the last 4 digits 0260 are not divisible by 24 = 16, and neither is 10440260.

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 20 posted: 3/14/2009 language: English pages: 1