Presentation is loading. Please wait.

Presentation is loading. Please wait.

CMSC250 S ECTIONS 0303 & 0304 M IDTERM R EVIEW Sri Kankanahalli Discussion 10: 9 March 2016 Office Hrs: Mon. and Wed. 4-6PM AVW 1112.

Similar presentations


Presentation on theme: "CMSC250 S ECTIONS 0303 & 0304 M IDTERM R EVIEW Sri Kankanahalli Discussion 10: 9 March 2016 Office Hrs: Mon. and Wed. 4-6PM AVW 1112."— Presentation transcript:

1 CMSC250 S ECTIONS 0303 & 0304 M IDTERM R EVIEW Sri Kankanahalli Discussion 10: 9 March 2016 Office Hrs: Mon. and Wed. 4-6PM AVW 1112

2 Topics for Today Midterm 1 is March 21 st ! ! ! Review: Propositional logic(1.1, 1.2, 1.4) Binary arithmetic(Feb 3. slides 18-21) Two’s complement Proof techniques(1.7, a bit of 1.8) Set theory(2.1, 2.2) Functions(2.3) Floor and ceiling functions Number theory(4.1)

3 Propositional Logic Know: Logical connectives (including implication and bi- implication) Quantifiers (∀, ∃) Translating from English to propositional logic, in both directions A(X): X is a cow. B(X): X is blue. “All cows are blue.” ∀ x [A(x) → B(x)] ∃ x ¬A(x) ∧ B(x) “There exists a thing that is not a cow and is blue.”

4 Propositional Logic Don’t need to know (for this test): System specifications Circuits

5 Propositional Logic Slides: Feb. 1, everything Feb. 8, material on quantifiers Feb. 10, everything Practice problems: Translating from English to propositional logic Chapter 1.1, #10-12 Working with quantifiers Chapter 1.4, #10, 32, 33

6 Binary Arithmetic Know: How to convert numbers from base 10 to binary Two’s complement arithmetic Don’t need to know How to convert to other bases (octal, hexadecimal, etc.) Though this is still a good skill to have in life!

7 Binary Arithmetic Slides: Feb. 3, material on binary arithmetic Practice problems: Convert 59 to an 8-bit two’s complement binary number. Convert -63 to an 8-bit two’s complement binary number. Express (21 – 95) as an 8-bit two’s complement binary number.

8 Proof Techniques Know: All our basic methods of proof Direct proof Proof by contraposition Proof by contradiction General proof techniques Constructing a counterexample Proof by cases

9 Proof Techniques Slides: Feb. 17, everything Practice problems: Basic proof methods Chapter 1.7, #1-5, 6, 13 Proof by counterexample and/or cases Chapter 1.8, #3, 6

10 Set Theory Know: Set operations (union, intersection, difference) Definition of subset and proper subset Proving properties of sets Proof by “element chasing” Proof by derivation Don’t need to know (for this test): Set identities (you’ll get a sheet, like the one you had on the HW)

11 Set Theory Slides: Feb. 22, everything Practice problems: “Element chasing” proofs Chapter 2.2, #16, 19 Derivational proofs Chapter 2.2, #17, 18 Prove (A – B) ∩ (B – A) = ∅, both ways.

12 Functions Know: Finding the domain and codomain of a function Injectivity, surjectivity, bijectivity – and how to prove them How to take the inverse of a function, and verify it Floor and ceiling functions Don’t need to know (for this test): Partial functions Binary relations

13 Functions Slides: Feb. 24, everything Feb. 29, material on floor/ceiling functions Practice problems: Finding domain and codomain Chapter 2.3, #7 Determining injectivity/surjectivity/bijectivity Chapter 2.3, #12-15, 22, 23 Taking inverses of functions Find the inverse of f(x) = 3x + 4 + 5/x Floor and ceiling functions Chapter 2.3, #8, 9

14 Number Theory Know: Proving things about even/odd numbers Divisibility Modular arithmetic Proving statements like: “If n is odd, n 2 ≡ 1 (mod 8).” “If n is odd and m ≡ 3 (mod 4), then (n 2 + m) is divisible by 4.” (More complicated than midterm.) Proving small roots are irrational Using modular arithmetic Using the Unique Factorization Theorem (slides later!)

15 Number Theory Don’t need to know (for this test): The division algorithm Modular exponentiation Proofs about primes

16 Number Theory Slides: Feb. 29, number theory and divisibility Mar. 7, everything Practice problems: Proving things about even/odd numbers Chapter 1.7, #1-5, 6, 13 Divisibility Chapter 4.1, #5-8 Modular arithmetic Chapter 4.1, #38-40 Proving irrationality Prove √3 is irrational, once with modular arithmetic, and once with the Unique Factorization Theorem.

17 Unique Factorization Theorem Also called the “Fundamental Theorem of Arithmetic” Theorem: “Every integer can be expressed as a product of unique prime numbers.” 24= 3 * 2 * 2 * 2= 3 * 2 3 160= 5 * 4 * 4 * 2= 5 * 4 2 * 2 x = p 1 a 1 * p 2 a 2 * … * p n a n

18 Unique Factorization Theorem Proof: √2 is irrational. A proof by contradiction (like usual): Assume √2 is rational. Then √2 = a / b, for a and b with no common factors. So 2 = a 2 / b 2. So a 2 = 2b 2. We’ve done this many times before. Only the next part differs.

19 Unique Factorization Theorem Proof: √2 is irrational. So a 2 = 2b 2. By the UFT, we can write a and b as a unique product of prime factors. a = p 1 x 1 * p 2 x 2 * … * p n x n b = q 1 y 1 * q 2 y 2 * … * q n y n So, we can write a 2 and b 2 as: a 2 = p 1 2x 1 * p 2 2x 2 * … * p n 2x n b 2 = q 1 2y 1 * q 2 2y 2 * … * q n 2y n

20 Unique Factorization Theorem Proof: √2 is irrational. a 2 = 2b 2. So, we can write a 2 and b 2 as: a 2 = p 1 2x 1 * p 2 2x 2 * … * p n 2x n b 2 = q 1 2y 1 * q 2 2y 2 * … * q n 2y n We see a 2 and b 2 have all even powers, for each prime in their factorizations. So, a 2 and b 2 would both have an even number of 2s in their factorizations. So, 2b 2 would have an odd number of 2s. Since 2b 2 has an odd number of 2s in its factorization, and a 2 has an even number of 2s, by the UFT they can’t be equal! Contradiction.

21 Unique Factorization Theorem Proof: √2 is irrational. a 2 = 2b 2. Since 2b 2 has an odd number of 2s in its factorization, and a 2 has an even number of 2s, by the UFT they can’t be equal! Contradiction. Because assuming that √2 is rational leads to a contradiction, √2 must be irrational. QED


Download ppt "CMSC250 S ECTIONS 0303 & 0304 M IDTERM R EVIEW Sri Kankanahalli Discussion 10: 9 March 2016 Office Hrs: Mon. and Wed. 4-6PM AVW 1112."

Similar presentations


Ads by Google