Docsity

Practice Problems for Exam 1 | Applied Discrete Structures | COT 3100, Exams of Computer Science

Toggle sidebar
bg1
COT3100 Practice Problems for Exam 1.
These problems are only meant to help you prepare the first exam. It is not guar-
anteed that the exam questions will be similar to these problems.
There will be five problems on the exam:
1. Propositional logic and equivalences (1.1 and 1.2)
2. Predicates and Quantifiers (1.3)
3. Rules of Inference and Proofs (1.5)
4. Set Operations (2.1 and 2.2)
5. Functions and sequences (2.3 and 2.4)
The (brief) solutions will be available only after 9pm on Thursday night. However,
instead of memorizing the solutions, you should attempt to solve all problems by
yourself first.
1. What is the truth value of (p∨q)→(p∧q), when both pand qare false?
Solution: You should work out this problem and convince yourself that
your answer is correct.
2. State the converse and contrapositive of, “If I answer this question, then I
will get 4 points”.
Solution: You just need to know the definitions of converse and contrapos-
itive. Check out the textbook or lecture slides.
3. Which rule of inference allows you to conclude, “Mark has stripes” from
the statements, “Every zebra has stripes” and “Mark is a zebra”?
Solution: Same as above.
4. Construct the truth table for the proposition p→(¬q∨r).
Solution: Clock yourself to make sure that you don’t take more than three
minutes on this problem.
5. Prove that there is a positive integer that equals the sum of positive integers
not exceeding it.
Solution: 3is one such number.
1
pf3
pf4
pf5

Partial preview of the text

Download Practice Problems for Exam 1 | Applied Discrete Structures | COT 3100 and more Exams Computer Science in PDF only on Docsity!

COT3100 Practice Problems for Exam 1.

These problems are only meant to help you prepare the first exam. It is not guar- anteed that the exam questions will be similar to these problems. There will be five problems on the exam:

  1. Propositional logic and equivalences (1.1 and 1.2)
  2. Predicates and Quantifiers (1.3)
  3. Rules of Inference and Proofs (1.5)
  4. Set Operations (2.1 and 2.2)
  5. Functions and sequences (2.3 and 2.4)

The (brief) solutions will be available only after 9pm on Thursday night. However, instead of memorizing the solutions, you should attempt to solve all problems by yourself first.

  1. What is the truth value of (p ∨ q) → (p ∧ q), when both p and q are false? Solution: You should work out this problem and convince yourself that your answer is correct.
  2. State the converse and contrapositive of, “If I answer this question, then I will get 4 points”. Solution: You just need to know the definitions of converse and contrapos- itive. Check out the textbook or lecture slides.
  3. Which rule of inference allows you to conclude, “Mark has stripes” from the statements, “Every zebra has stripes” and “Mark is a zebra”? Solution: Same as above.
  4. Construct the truth table for the proposition p → (¬q ∨ r). Solution: Clock yourself to make sure that you don’t take more than three minutes on this problem.
  5. Prove that there is a positive integer that equals the sum of positive integers not exceeding it. Solution: 3 is one such number.
  1. Prove that the product of a rational number and an irrational number is irra- tional. Solution: We know that the product and quotient of two rational numbers are also ration. Therefore, we can prove this by contradiction. Let p, q be the two numbers with p rational and q irrational. Assume that r = pq is ra- tional. Then, this implies that q = r/p is also rational, which is the desired contradiction.
  2. Prove that the proposition [(p ∨ q) ∧ (¬p ∨ r)] → (q ∨ r) is a tautology. Solution: Compute the truth table and show that it is always true.
  3. We briefly discussed the uniqueness quantifier, ∃!. The notation ∃!x P (x) meant “There is a unique x, such that P (x) is true.” Express this uniqueness quantification ∃!x P (x) in terms of universal quantifiers, existential quanti- fiers and logical operators. (Hint: You might need to use nested quantifiers). Solution: Here is a partial solution:

∃!x P (x) ≡ ∃x∀y{A −→ B}.

You have to figure out what to put for A and B.

  1. Prove that at least one of the real numbers a 1 , a 2 ,... , an is greater than or equal to their average. Solution: Proof by contradiction. If all ai are smaller than their average, then you can show that this average is smaller than itself, which is the con- tradiction.
  2. For the following argument, explain which rules of inference are used in each step to lead from the premises to the conclusion: “There is someone in this class who has been to France. Everyone who visits France visits the Louvre. Therefore, someone in this class has visited the Louvre”. Solution: Again, the answer can be found in the textbook (Section 1.5).
  3. Give one example of a trivial proof and one example of a vacuous proof. Solution: A vacuous proof is a proof that shows the hypothesis is false. Here is an example: Suppose x is a real number. Show that if x^2 < 0 , then x^2 + x^6 = 2. The (vacuous) proof is to show that x^2 < 0 is false if x is real number. Then, because the hypothesis is false, the implication is always true.

shown that N> 0 × N> 0 is countable, you can define an onto function from N> 0 × N> 0 to A 1 ∪ A 2 ∪ ... ∪ An ∪ ... showing that the latter set is indeed countable.

  1. Determine whether each of these sets is countable. For those that are count- able, exhibit an one-to-one correspondence between the set of natural num- bers and that set.

(a) integers not divisible by 3. (b) integers divisible by 5 but not by 7. (c) the real numbers with decimal representations consisting of all 1s. (d) the real numbers with representation of all 1s or 9s. (e) the real numbers not containing 0 in their decimal representation. (f) the real numbers containing only a finite number of 1s in their decimal representation.

Solution: (a) and (b) are both countable because they are subsets of the inte- gers. (c) is also countable. (d) will depend on how you read the problem. If the number can contain 1s or 9s but not both, then, it will be countable (it is just a union of two countable sets). However, if the number can contain both 1 and 9 in its decimal representation, then, the set is uncountable. Cantor’s diagonal argument can be used here to show that this set is uncountable. (e) and (f) are both uncountable.

  1. Let f be a function from the set A to the set b. Let S and T be subsets of A. Show that

(a) f (S ∪ T ) = f (S) ∪ f (T ). (b) f (S ∩ T ) ⊆ f (S) ∩ f (T ).

Solution: Here we show how to solve (a). Let x ∈ f (S ∪ T ). This means that there exists an y ∈ S ∪ T such that f (y) = x. If y ∈ S, then x ∈ f (S). Else, y ∈ T , then x ∈ f (T ). This shows that x ∈ f (S) ∪ f (T ). Conversely, if x ∈ f (S) ∪ f (T ). If x ∈ f (T ), there exists y ∈ T such that f (y) = x. This shows that x ∈ f (S ∪ T ).

  1. Compute the sum

∑n k=

1 k^2 +k. Solution: (^) n ∑

k=

k^2 + k

∑^ n

k=

k

k + 1

This telescoping sum is simply 1 − (^) n+1^1.