Docsity

CS 1050 Spring 2008 - Sample Problems for Test #1 in Logic and Discrete Mathematics - Prof, Exams of Computer Science

Toggle sidebar
bg1
CS 1050 A SPRING 2008
Sample Problems for Test # 1
1. What is the truth value of (p∨q)→(p∧q) when both pand qare false?
2. What are the converse and contrapositive of the statement”If it is sunny, then I go swimming ”?
3. Show that ¬(p⊕q) and p↔qare equivalent using a truth table. (The compound proposition p⊕qis
false if pand qhave the same truth value and is true otherwise.)
4. Suppose that Q(x) is the statement “x+1=2x.” What are the truth values of ∀xQ(x) and ∃xQ(x)?
5. Prove or disprove each of the following statements.
a) The sum of an even integer and an odd integer is always odd.
b) For any two integers aand b, if a·bis even then ais even or bis even.
c) There exist two irrational numbers xand ysuch that xy is rational and x+yis rational.
6. Prove each of the following statements by induction
(a) ∀n≥1,Pn
i=1 i2i= (n−1)2n+1 + 2
(b) ∀n≥1,4n+1 + 52n−1is divisible by 21.
(c) ∀n≥4,2n+ 3 ≤2n
(d) ∀n≥0, n5−nis divisible by 5.
7. Which amount of money can be formed using just two-dollar bills and five-dollar bills? Prove your
answer using strong induction.
8. Recursively define the set of bit strings that have more zeros than ones.
9. True or false? Explain.
(a) 1
2n2−n+ 5 = O(n2)
(b) nlog2n+ 3√n=O(nlog2n)
(c) (n2+ 2n)(n3+ 3n) = O(5n)
(d) 2n+ log n+ 5 = O(n2)
10. Give a recursive algorithm for computing the sum of the first nodd positive integers.
1

Partial preview of the text

Download CS 1050 Spring 2008 - Sample Problems for Test #1 in Logic and Discrete Mathematics - Prof and more Exams Computer Science in PDF only on Docsity!

CS 1050 A SPRING 2008

Sample Problems for Test # 1

  1. What is the truth value of (p ∨ q) → (p ∧ q) when both p and q are false?
  2. What are the converse and contrapositive of the statement”If it is sunny, then I go swimming ”?
  3. Show that ¬(p ⊕ q) and p ↔ q are equivalent using a truth table. (The compound proposition p ⊕ q is false if p and q have the same truth value and is true otherwise.)
  4. Suppose that Q(x) is the statement “x+1=2x.” What are the truth values of ∀xQ(x) and ∃xQ(x)?
  5. Prove or disprove each of the following statements. a) The sum of an even integer and an odd integer is always odd. b) For any two integers a and b, if a · b is even then a is even or b is even. c) There exist two irrational numbers x and y such that xy is rational and x + y is rational.
  6. Prove each of the following statements by induction (a) ∀n ≥ 1 , ∑ni=1 i 2 i^ = (n − 1)2n+1^ + 2 (b) ∀n ≥ 1 , 4 n+1^ + 5^2 n−^1 is divisible by 21. (c) ∀n ≥ 4 , 2 n + 3 ≤ 2 n (d) ∀n ≥ 0 , n^5 − n is divisible by 5.
  7. Which amount of money can be formed using just two-dollar bills and five-dollar bills? Prove your answer using strong induction.
  8. Recursively define the set of bit strings that have more zeros than ones.
  9. True or false? Explain. (a) 12 n^2 − n + 5 = O(n^2 ) (b) n log 2 n + 3√n = O(n log 2 n) (c) (n^2 + 2n)(n^3 + 3n) = O(5n) (d) 2n + log n + 5 = O(n^2 )
  10. Give a recursive algorithm for computing the sum of the first n odd positive integers.