Docsity

Quiz 2 Review Problems - Discrete Structures | CS 173, Quizzes of Discrete Structures and Graph Theory

Toggle sidebar
bg1
CS 173: Discrete Structures, Spring 2010
Quiz 2 Review problems
Here are some short answer problems that will be helpful in preparing for the first quiz.
Please do them and then check your answers against the posted solutions. You do not need
to hand these in for us to grade.
1. Primes
(a) Express the numbers 350, 105, and 64 as products of primes.
(b) Compute GCD(350,105), GCD(105,64), and LCM(350,64). Feel free to give large
results as products of primes; multiplying them out is not necessary.
(c) According to the definitions given in the book (or in lecture 8), which integers are
neither prime nor composite?
2. Divisibility, congruence mod k
Which of the following statements are correct? Show work or give brief explanations
for your answers.
Solution:
(a) −6|30
(b) 30 | −6
(c) 6 | −30
(d) −18 |0
(e) 0 | −18
3. Miscellaneous questions
(a) When is ⌊x⌋equal to ⌈x⌉?
(b) Is zero even? odd? neither?
(c) Is zero prime?
4. Sums and Products Please show your work in deriving the solutions to the following
questions. Note that in these questions, iis an index variable and does not represent
an imaginary number. You can use the fact that
n
X
i=0
(i2) = n(n+ 1)(2n+ 1)
6(which
you weren’t required to have memorized for the quiz).
1
pf3
pf4
pf5

Partial preview of the text

Download Quiz 2 Review Problems - Discrete Structures | CS 173 and more Quizzes Discrete Structures and Graph Theory in PDF only on Docsity!

CS 173: Discrete Structures, Spring 2010

Quiz 2 Review problems

Here are some short answer problems that will be helpful in preparing for the first quiz. Please do them and then check your answers against the posted solutions. You do not need to hand these in for us to grade.

  1. Primes

(a) Express the numbers 350, 105, and 64 as products of primes. (b) Compute GCD(350, 105), GCD(105, 64), and LCM(350, 64). Feel free to give large results as products of primes; multiplying them out is not necessary. (c) According to the definitions given in the book (or in lecture 8), which integers are neither prime nor composite?

  1. Divisibility, congruence mod k Which of the following statements are correct? Show work or give brief explanations for your answers. Solution:

(a) − 6 | 30 (b) 30 | − 6 (c) 6 | − 30 (d) − 18 | 0 (e) 0 | − 18

  1. Miscellaneous questions

(a) When is ⌊x⌋ equal to ⌈x⌉? (b) Is zero even? odd? neither? (c) Is zero prime?

  1. Sums and Products Please show your work in deriving the solutions to the following questions. Note that in these questions, i is an index variable and does not represent

an imaginary number. You can use the fact that

∑^ n

i=

(i^2 ) =

n(n + 1)(2n + 1) 6

(which

you weren’t required to have memorized for the quiz).

(a) Express S(n) =

∑^ n

i=

(6i^2 − 2 i + 4) as simplified formula reflecting some function of

the variable n.

(b) Express S(n) =

n∑− 1

i=

(2i + 1) as a simplified formula reflecting some function of the

variable n.

  1. Floor, Ceiling, and Logarithm

Simplify the following expressions as much as possible, without using a calculator (either hardware or software). Do not approximate. Express all rational numbers as fractions.

(a) log(4⌊ 9. 8 ⌋ (^) )(8(⌈^4.^2 ⌉)(⌊^4.^2 ⌋)^ × 32 ⌈^23.^4 ⌉)

(b)

∑^30

i=

i 20

i 10

(Hint: This is too hard to actually be on the quiz in this form, but a simpler version of this could be.)

  1. Logical Construction and Equivalence

Is the following logical equivalence correct? Why or why not?

(p → q) ∧ p ≡ (q ∧ p)

  1. Negation, Contrapositives

State the converse, contrapositive and negation of the following

  • If John has his camera, then Ralph hides and Anne makes faces.
  • For any real x, if x > 2 and x < 7, then x is positive.
  1. Logic and Language

Suppose we have the following definitions:

(a) d ≡ a constant that is equal to February 5th, 2010. (b) S(a) ≡ it snows on the day a (c) R(a) ≡ it rains on the day a (d) F (a) ≡ roads have become frozen on day a (e) H(x, a) ≡ the individual x stays home on day a (f) CS ≡ the set of all CS students at the U of I

CS 173: Discrete Structures, Spring 2010

Quiz 2 Review solutions

  1. Primes

(a) Express the numbers 350, 105, and 64 as products of primes.

Solution: 350 = 2 · 52 · 7, 105 = 3 · 5 · 7, and 64 = 2^6

(b) Compute GCD(350, 105), GCD(105, 64), and LCM(350, 64). Feel free to give large results as products of primes; multiplying them out is not necessary.

Solution: GCD(350, 105) = 5 · 7 GCD(105, 64) = 1 LCM(350, 64) = 2^6 · 52 · 7

(c) According to the definitions given in the book (or in lecture 8), which integers are neither prime nor composite?

Solution: All integers which are strictly less than 2.

  1. Divisibility, congruence mod k

Which of the following statements are correct? Show work or give brief explanations for your answers. Solution:

(a) − 6 | 30 is correct because 30 = (−6) · (−5). (b) 30 | −6 is incorrect because ∄k ∈ Z such that −6 = 30 · k. (c) 6 | −30 is correct because −30 = 6 · (−5). (d) − 18 | 0 is correct because 0 = − 18 · 0. Zero is a multiple of any integer. (e) 0 | −18 is incorrect because 0n is always 0, not -18.

  1. Miscellaneous questions

(a) When is ⌊x⌋ equal to ⌈x⌉? Solution: When x is an integer. (b) Is zero even? odd? neither? Solution: Zero is even. “Even” is the same as “multiple of 2.” (c) Is zero prime? Solution: Zero is not prime. The term prime (likewise composite) applies only to integers ≥ 2.

  1. Sums and Products Please show your work in deriving the solutions to the following questions. Note that in these questions, i is an index variable and does not represent

an imaginary number. You can use the fact that

∑^ n

i=

(i^2 ) =

n(n + 1)(2n + 1) 6

(which

you weren’t required to have memorized for the quiz).

(a) Express S(n) =

∑^ n

i=

(6i^2 − 2 i + 4) as simplified formula reflecting some function of

the variable n.

[Solution] =

∑^ n

i=

(6i^2 ) −

∑^ n

i=

(2i) +

∑^ n

i=

∑^ n

i=

(i^2 ) − 2 ∗

∑^ n

i=

(i) + 4 ∗ (n + 1)

= 6 ∗ (n(n+1)(2 6 n+1)) − 2 ∗ (n(n 2 +1) ) + 4n + 4 = n(n + 1)(2n + 1) − n(n + 1) + 4n + 4 = n(2n^2 + 3n + 1) − n^2 + 3n + 4 = 2n^3 + 2n^2 + 4n + 4

(b) Express S(n) =

n∑− 1

i=

(2i + 1) as a simplified formula reflecting some function of the

variable n.

[Solution] =

∑^ n−^1

i=

(2i) +

∑^ n−^1

i=

n∑− 1

i=

(i) + ((n − 1) + 1)

= 2 ∗ (n(n 2 − 1)) + n = n(n − 1) + n = n^2

  1. Floor, Ceiling, and Logarithm

Simplify the following expressions as much as possible, without using a calculator (either hardware or software). Do not approximate. Express all rational numbers as fractions.

(a) log(4⌊ 9. 8 ⌋ (^) )(8(⌈^4.^2 ⌉)(⌊^4.^2 ⌋)^ × 32 ⌈^23.^4 ⌉) [Solution] log(4 (^9) )(8(5)(4)^ × 3224 ) log(2 (^18) )(2^60 × 2120 ) = log(2 (^18) )(2^180 ) = 10

(a) d ≡ a constant that is equal to February 5th, 2010. (b) S(a) ≡ it snows on the day a (c) R(a) ≡ it rains on the day a (d) F (a) ≡ roads have become frozen on day a (e) H(x, a) ≡ the individual x stays home on day a (f) CS ≡ the set of all CS students at the U of I

Translate the following Logical Formulas into English:

(a) ∀x ∈ CS[S(d) ∧ R(d) → H(x, d)]

[Solution] Every CS student (from the U of I) stays home today if it is snowing and raining today. (b) ¬∃x ∈ CS[(¬S(d) ∨ ¬F (d)) → H(x, d)]

[Solution] If it does not snow today or roads haven’t become frozen today, then no student in CS (from the U of I) would stay home today.