SOLUTIONS TO TAKE HOME EXAM 1 MNF130, SPRING 2010

Similar documents
def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

Chapter 3. if 2 a i then location: = i. Page 40

3. Mathematical Induction

CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

Cartesian Products and Relations

Handout #1: Mathematical Reasoning

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

Cardinality. The set of all finite strings over the alphabet of lowercase letters is countable. The set of real numbers R is an uncountable set.

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

CS 103X: Discrete Structures Homework Assignment 3 Solutions

6.2 Permutations continued

8 Primes and Modular Arithmetic

INTRODUCTORY SET THEORY

Math 3000 Section 003 Intro to Abstract Math Homework 2

The last three chapters introduced three major proof techniques: direct,

Basic Proof Techniques

1) Testing of general knowledge 25%. Each right question counts 1. Each wrong counts 0.5. Empty

Examination paper for MA0301 Elementær diskret matematikk

This chapter is all about cardinality of sets. At first this looks like a

Lecture 16 : Relations and Functions DRAFT

MATH10212 Linear Algebra. Systems of Linear Equations. Definition. An n-dimensional vector is a row or a column of n numbers (or letters): a 1.

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Lecture Notes in Discrete Mathematics. Marcel B. Finan Arkansas Tech University c All Rights Reserved

Solutions Q1, Q3, Q4.(a), Q5, Q6 to INTLOGS16 Test 1

Computing exponents modulo a number: Repeated squaring

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

8 Divisibility and prime numbers

Homework until Test #2

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

( ) which must be a vector

Solutions to Homework 6 Mathematics 503 Foundations of Mathematics Spring 2014

Likewise, we have contradictions: formulas that can only be false, e.g. (p p).

Name: Section Registered In:

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

Rules of Inference Friday, January 18, 2013 Chittu Tripathy Lecture 05

1 Homework 1. [p 0 q i+j p i 1 q j+1 ] + [p i q j ] + [p i+1 q j p i+j q 0 ]

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

Beyond Propositional Logic Lukasiewicz s System

Math 55: Discrete Mathematics

Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter 4 described a mathematical system

Mathematics Course 111: Algebra I Part IV: Vector Spaces

Discrete Mathematics Problems

Chapter 11 Number Theory

Mathematical Induction

8 Square matrices continued: Determinants

k, then n = p2α 1 1 pα k

Lecture 13 - Basic Number Theory.

DISCRETE MATH: LECTURE 3

Sample Induction Proofs

MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

Mathematical Induction

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

Answer Key for California State Standards: Algebra I

6.080/6.089 GITCS Feb 12, Lecture 3

Quotient Rings and Field Extensions

Practice with Proofs

Section 4.2: The Division Algorithm and Greatest Common Divisors

Today s Topics. Primes & Greatest Common Divisors

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

Cubes and Cube Roots

Theorem3.1.1 Thedivisionalgorithm;theorem2.2.1insection2.2 If m, n Z and n is a positive

You know from calculus that functions play a fundamental role in mathematics.

GROUPS ACTING ON A SET

of Nebraska - Lincoln

n k=1 k=0 1/k! = e. Example 6.4. The series 1/k 2 converges in R. Indeed, if s n = n then k=1 1/k, then s 2n s n = 1 n

Factoring Polynomials

H/wk 13, Solutions to selected problems

4. CLASSES OF RINGS 4.1. Classes of Rings class operator A-closed Example 1: product Example 2:

3. Logical Reasoning in Mathematics

Mathematical Induction. Lecture 10-11

Arkansas Tech University MATH 4033: Elementary Modern Algebra Dr. Marcel B. Finan

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

15 Prime and Composite Numbers

Properties of Real Numbers

CHAPTER 7 GENERAL PROOF SYSTEMS

4: EIGENVALUES, EIGENVECTORS, DIAGONALIZATION

Continued Fractions and the Euclidean Algorithm

PUTNAM TRAINING POLYNOMIALS. Exercises 1. Find a polynomial with integral coefficients whose zeros include

Math 319 Problem Set #3 Solution 21 February 2002

Working with whole numbers

26 Integers: Multiplication, Division, and Order

Chapter 7 - Roots, Radicals, and Complex Numbers

Matrix Algebra. Some Basic Matrix Laws. Before reading the text or the following notes glance at the following list of basic matrix algebra laws.

Chapter 1. Use the following to answer questions 1-5: In the questions below determine whether the proposition is TRUE or FALSE

MATH 289 PROBLEM SET 4: NUMBER THEORY

MACM 101 Discrete Mathematics I

SECTION 10-2 Mathematical Induction

Number Theory Hungarian Style. Cameron Byerley s interpretation of Csaba Szabó s lectures

Linear Algebra I. Ronald van Luijk, 2012

Solution to Exercise 2.2. Both m and n are divisible by d, som = dk and n = dk. Thus m ± n = dk ± dk = d(k ± k ),som + n and m n are divisible by d.

Just the Factors, Ma am

Real Roots of Univariate Polynomials with Real Coefficients

MATH 4330/5330, Fourier Analysis Section 11, The Discrete Fourier Transform

Math 55: Discrete Mathematics

Number Theory: A Mathemythical Approach. Student Resources. Printed Version

Degrees that are not degrees of categoricity

Transcription:

SOLUTIONS TO TAKE HOME EXAM 1 MNF130, SPRING 2010 PROBLEM 1 What are the converse and contrapositive statements of the statement If it is sunny, then I will go swimming? (The answer needs not to be justified.) SOLUTION: Converse is If I (will) go swimming, then it is sunny. Contrapositive is If I do not/will not go swimming, then it is not sunny. PROBLEM 2 Show that (p q) and q p are logically equivalent by (a) using a truth table; (b) using logical equivalences. SOLUTION: (a) Truth table: p q q p q (p q) p q p T T F T F F F T F T T F F F F T F F T T T F F T T F T F Since the fifth and seventh columns agree, we conclude that (p q) and q p are logically equivalent by definition. (b) We have (p q) (1) p q (2) p q (3) q p, where we have used De Morgan s law (1), the doble negation law (2) and the commutative law (3). (c) Prove or disprove that (p q) r and p (q r) are equivalent. SOLUTION: They are not equivalent, because there exist truth values for the three propositions p, q, r making (p q) r false but p (q r) true. To see this, take p to be false, q true and r false. Then (p q) r is false, since its premise (p q) is true and its conclusion r is false. On the other hand p (q r) is true since its premise p is false. (d) Prove that ( q (p q)) p is a tautology. SOLUTION ALTERNATIVE 1: This can be done with a truth table: p q p q p q q (p q) ( q (p q)) p T T F F T F T T F F T F F T F T T F T F T F F T T T T T 1

2 SOLUTIONS TO TAKE HOME EXAM 1 MNF130, SPRING 2010 Since the truth value of ( q (p q)) p is always T, no matter what the values of p and q are, it follows that ( q (p q)) p is a tautology by definition. SOLUTION ALTERNATIVE 2: using logical equivalences we get q (p q)) p ( q (p q)) p q (p q)) p De Morgan and double negation q ( p q)) p q (p q)) p De Morgan and double negation ((q p) (q q)) p Distributive law ((q p) T) p Negation law q p p Associative law and Negation law q T Identity law T Domination law so that ( q (p q)) p is logically equivalent to a proposition that is always true, which means it is a tautology. PROBLEM 3 Let P (m, n) be m is greater than n, where the domain (universe of discourse) is the set of negative integers. Decide the truth value of the following propositions: (a) x yp (x, y), (b) x yp (y, x), (c) x yp (x, y), (d) x yp (y, x), SOLUTION: (a) is FALSE since it claims that there exists a negative integer x such that x > y for all negative integers y. In particular, we would have to have x > 1, which is impossible. (b) is FALSE since it claims that there exists a negative integer x such that y > x for all negative integers y. Indeed, if such an x existed, we would have to have x > x, which is impossible. (c) is TRUE since it claims that for any negative integer x, we can find a negative integer y such that x > y. For instance, we can take y = x 1. (d) is FALSE since it claims that for any negative integer x, we can find a negative integer y such that y > x. But such a y cannot exist if x = 1. PROBLEM 4 (a) Formalize the following argument and determine whether it is valid: She is a bachelor student in mathematics or in computer science. If she doesn t know discrete math, she is not a bachelor student in computer science. If she knows discrete math, she is smart. She is not a bachelor student in mathematics. Therefore, she is smart.

SOLUTIONS TO TAKE HOME EXAM 1 MNF130, SPRING 2010 3 SOLUTION: Let us name the different propositions with the following letters: m c d s She is a bachelor student in mathematics She is a bachelor student in computer science She knows discrete math She is smart Then the formal argument is: m c d c d s m s This is VALID and we prove it by using the following rules of inference: 1. d c Premise 2. c d Contraposition on 1. and Doble negation 3. d s Premise 4. c s Hypothetical syllogism on 2. and 3. 5. m c Premise 6. m Premise 7. c Disjunctive syllogism on 5. and 6. 8. s Modus ponens on 4. and 7. (b) Determine whether the following argument is valid: p r q r (p q) r SOLUTION: The argument is not valid because the truth values p false, q false and r true, make the three premises true and the conclusion false. PROBLEM 5 A stamp collector wants to include in her collection exactly one stamp from each country of Africa. If I(s) means that she has stamp s in her collection, F (s, c) means that stamp s was issued by country c, the domain for s is all stamps, and the domain for c is all countries of Africa, express the statement that her collection satisfies her requirement. Do not use the! symbol. SOLUTION: The simplest formula is ( ) c s x (I(x) F (x, c)) x = s. PROBLEM 6 Prove or disprove the following statements about sets:

4 SOLUTIONS TO TAKE HOME EXAM 1 MNF130, SPRING 2010 (a) A (B C) = (A B) (A C) for all sets A, B, C. (b) A (B C) = (A B) (A C) for all sets A, B, C. SOLUTION: (a) is FALSE. For a counterexample, take A = {1, 2}, B = {1} and C = {2}. Then we have A (B C) = {1, 2} = {1, 2} and (A B) (A C) = {2} {1} =. (b) is TRUE, since A (B C) (1) = A B C (2) = A (B C) (3) = (A B) (A C) (4) = (A B) (A C), where we have used the definition of difference between sets (1 and 4), De Morgan s law (2) and the distributive law (3). PROBLEM 7 Find the power set of the set {{a, b}, c}. SOLUTION: {, {{a, b}}, {c}, {{a, b}, c}} PROBLEM 8 Consider the functions f, g : Z Z defined by f(n) = 2n + 1 and g(n) = 2 n 2. (a) What is the range of each of the functions f, g, f g and g f, respectively? Which of the functions f, g, f g and g f are surjective? (b) Which of the functions f, g, f g and g f are injective? SOLUTION: (a) The range of f is the set of all odd integers and the range of g the set of all even integers. We have f g : Z Z defined by f g(n) = f(g(n)) = 4 n 2 + 1, so the range is the set {n Z (k Z)(n = 4k + 1)}. We have g f : Z Z defined by g f(n) = g(f(n)) = 2 2n+1 2 = 2 n + 1 2 = 2n, so the range is the set of all even integers. It follows that none of the functions are surjective, since all these sets are proper subsets of Z. (b) g and f g are not injective, since for instance g(0) = g(1) and f g(0) = f g(1). f is injective since Likewise, g f is injective. f(n 1 ) = f(n 2 ) 2n 1 + 1 = 2n 2 + 1 2n 1 = 2n 2 n 1 = n 2. PROBLEM 9 (a) Show that the set of odd positive integers greater than 3 is countable. SOLUTION: The function f(n) = 2n+3 is a bijection between the set of positive integers to the set of positive integers greater than 3. Hence the latter set is countable. (b) Let A and B be countable sets. Prove that A B is countable.

SOLUTIONS TO TAKE HOME EXAM 1 MNF130, SPRING 2010 5 SOLUTION: The fact that A is countable means that we can arrange the elements of A is a sequence labelled by the set of positive integers, possibly ending: Likewise, we can write A = {a 1, a 2, a 3,...}. B = {b 1, b 2, b 3,...}. All elements of A B are then of the form (a i, b j ) for some i, j N +. We then order all elements in the following way (a 1, b 1 ) (a 1, b 2 ) (a 1, b 3 ) (a 1, b 4 ) (a 1, b 5 )... (a 2, b 1 ) (a 2, b 2 ) (a 2, b 3 ) (a 2, b 4 ) (a 2, b 5 )... (a 3, b 1 ) (a 3, b 2 ) (a 3, b 3 ) (a 3, b 4 ) (a 3, b 5 )... (a 4, b 1 ) (a 4, b 2 ) (a 4, b 3 ) (a 4, b 4 ) (a 4, b 5 )... (a 5, b 1 ) (a 5, b 2 ) (a 5, b 3 ) (a 5, b 4 ) (a 5, b 5 )..................... and we then order the elements using the same diagonal-chaising-pattern as in the proof of the countability of Q +. and PROBLEM 10 (a) Find 100 j=1 (2j + 5) and 100 j=5 3j. SOLUTION: We have (2j + 5) = 2 j + 5 = 2 j=1 j=1 3 j = 3 j j=5 j=0 j=0 j=1 (b) Decide whether 175 22 (mod 17). 100 101 2 + 100 5 = 10600 4 3 j = 3101 3 1 35 3 1 = 3101 3 5. 2 SOLUTION: We have 175 22 = 153 and 17 153, since 153 = 17 9. 22 (mod 17). hence 175 (c) Find the prime factorization of 45617. SOLUTION: We check that neither 2, 3, 5 nor 7 divide 45617. Dividing by 11 we obtain 4147. Repeating the procedure, we again find that the smallest prime dividing this number is 11, and dividing yields 377. We find that this number is not divisible by any of 2, 3, 5, 7, 11, but dividing by 13 yields 29, a prime number. Hence the factorization is 45617 = 11 2 13 29. (d) Find gcd(70, 84) and lcm(70, 84). SOLUTION: We find the prime factorizations 70 = 2 5 7 and 84 = 2 2 3 7, whence gcd(70, 84) = 2 7 = 14.

6 SOLUTIONS TO TAKE HOME EXAM 1 MNF130, SPRING 2010 Similarly, lcm(70, 84) = 2 2 3 5 7 = 420. PROBLEM 11 Find the mistake in the following proof of the following theorem and give a correct proof. Theorem If a b and b c, then a c. Proof. Since a b, we have b = ka for k Z. Likewise, since b c, we have c = kb. Therefore, c = bk = (ak)k = ak 2. It follows that a c. QED SOLUTION: The proof is incorrect since there is no guarantee that the multiple k will be the same in both cases. Correct proof: Since a b, we have b = ka for some k Z. Likewise, since b c, we have c = lb for some l Z. Therefore, c = lb = l(ka) = (lk)a. It follows that a c. QED PROBLEM 12 (a) A message has been encrypted using the function f(x) = (x + 5) mod 26. If the message in coded form is JCF HY, decode the message. SOLUTION: The decoded message is EXACT. To see this, we first replace the letters in the coded form by numbers corresponding to their position in the English alphabet, yielding 10 3 6 8 25. Then we apply the inverse of f, namely f 1 (x) = (x 5) mod 26, to these numbers, obtaining 5 24 1 3 20, which correspond to the letters E X A C T. (b) Explain why g(x) = (2x + 3) mod 26 would not be a good coding function. SOLUTION: The function g is not bijective, since for instance g(0) = g(13). Hence there exists no inverse function, so we would not be able to decode the message. PROBLEM 13 Prove that if n is an integer that is not a multiple of 3, then n 2 1 (mod 3). SOLUTION-ALTERNATIVE 1: We do a proof by cases: If n is an integer that is not a multiple of 3, then n = 3k + 1 or n = 3k + 2 for some integer k. (In fact, k is the quotient and 1 respectively 2 the remainder, obtained when dividing n by 3.) If n = 3k + 1, then n 2 = 9k 2 + 6k + 1 = 3(3k 2 + 2k) + 1, whence n 2 1 (mod 3). If n = 3k + 2, then n 2 = 9k 2 + 12k + 4 = 3(3k 2 + 4k + 1) + 1, whence n 2 1 (mod 3). SOLUTION-ALTERNATIVE 2: The product of three consecutive integers must be divisible by 3. In particular, 3 (n 1)n(n + 1) for any integer n. If n is not divisible by 3, then 3 must divide (n 1)(n + 1), by the unique factorization of (n 1)n(n + 1). But (n 1)(n + 1) = n 2 1, so that 3 (n 2 1), which means that n 2 1 0 (mod 3), or, equivalently, n 2 1 (mod 3).

SOLUTIONS TO TAKE HOME EXAM 1 MNF130, SPRING 2010 7 Let A = 1 0 1 1 1 0 and B = PROBLEM 14 0 1 0 1 0 0 be two zero-one matrices. Find the join, meet and Boolean product of these two matrices. SOLUTION: The join of A and B is A B = 1 0 1 0 1 0 1 1 0 1 0 0 = 1 0 0 1 1 0 0 0 1 1 1 1 1 1 1 0 0 0 = 1 1 1 1 1 0. The meet of A and B is A B = 1 0 1 0 1 0 = 1 0 0 1 1 0 0 0 1 1 1 1 = 0 0 0 1 1 0 1 0 0 1 1 1 0 0 0 1 0 0. The Boolean product of A and B is A B = 1 0 1 0 1 0 1 1 0 1 0 0 = = = (1 0) (0 0) (1 1) (1 1) (0 1) (1 0) (1 0) (0 1) (1 0) (0 0) (1 0) (1 1) (0 1) (1 1) (1 0) (0 0) (1 1) (1 0) (1 0) (1 0) (0 1) (1 1) (1 1) (0 0) (1 0) (1 1) (0 0) 0 0 1 1 0 0 0 0 0 0 0 1 0 1 0 0 1 0 0 0 0 1 1 0 0 1 0 1 1 0 1 1 1 PROBLEM 15 An ISBN number is a 10-digit number s 1 s 10 such that 10 i=1 is i 0 (mod 11). Prove that if we exchange two different digits of an ISBN number, then the new number we get will not be a valid ISBN number. SOLUTION: When we exchange the places of two distinct digits, say s i and s j with s i s j, the difference in the control sum of the new and the old number is (is j + js i ) (is i + js j ) (mod 11). If the new number is still an ISBN number, then this must be zero, so that we must have (i j)(s j s i ) 0 (mod 11), that is, (i j)(s j s i ) = 11k, for some integer k. But i j { 10, 9,..., 9, 10}, since i, jj {0,..., 10} and s j s i { 9, 8,..., 8, 9}, since s i, s j {0,..., 9}. Therefore, neither i j nor s i s j contains 11 as a prime factor, so we must have k = 0, proving that s i = s j, a contradiction.

8 SOLUTIONS TO TAKE HOME EXAM 1 MNF130, SPRING 2010 PROBLEM 16 In this problem we use the fact that the Norwegian coin system is built on the following values: 1000, 500, 200, 100, 50, 20, 10, 5, 1 and 0, 50 NOK (Norwegian kroner). We will disregard the last value (0, 50) and work only with integer values of amounts. (a) Suppose that the cashier in a mall has to make change to a customer for the value of 2677 NOK. Assume that he has enough bills and coins of all values. What will he give the customer if he uses the greedy algorithm. SOLUTION: We have 2677 = 2 1000 + 1 500 + 1 100 + 1 50 + 1 20 + 1 5 + 2 1. Therefore, the customer will receive two 1000 bills and one 500, one 100 and one 50 bill, one 20 and one 5 coin, and two 1 coins. (b) Prove that the greedy algorithm applied to NOK always produces change using the fewest bills and coins possible. SOLUTION: We argue as in Lemma 1 and Theorem 1 in 3.1 in the book. Let n be a positive integer, which corresponds to a change. Assume that the change using the fewest bills and coins possible is given by n = 1000a 1 + 500a 2 + 200a 3 + 100a 4 + 50a 5 + 20a 6 + 10a 7 + 5a 8 + a 9, where all a i N. (That is, the change consists of a 1 1000 NOK bills, a 2 500 NOK bills and so on.) Then one can easily show, as in Lemma 1, that as well as Now assume that a 2 1, a 3 2, a 4 1, a 5 1, a 6 2, a 7 1, a 8 1, a 9 4, a 3 + a 4 2, a 6 + a 7 2. n = 1000b 1 + 500b 2 + 200b 3 + 100b 4 + 50b 5 + 20b 6 + 10b 7 + 5b 8 + b 9, where all b i N, is the change using the greedy algorithm. We prove that all b i = a i, which will prove that greedy algorithm applied always produces change using the fewest bills and coins possible. Obviously b 1 a 1, since the greedy algorithm by definistion uses the largest ampount of 1000 bills possible. If b 1 > a 1, we must have 500a 2 + 200a 3 + 100a 4 + 50a 5 + 20a 6 + 10a 7 + 5a 8 + a 9 1000, but this is not possibile by the inequlaities we found. Thus b 1 = a 1. Continuing this way, we obtain that all b i = a i. (I skip the details.)

SOLUTIONS TO TAKE HOME EXAM 1 MNF130, SPRING 2010 9 GENERELLE KOMMENTARER Veldig viktig: Man må huske å begrunne svarene med mindre det eksplisitt står at det holder å skrive ned svaret. F.eks. er det null poengs utteling for bare å skrive ned svarene på matriseoperasjonene i Oppgave 14. Også veldig viktig: Husk å forklare (kort) hva man har vist/gjort. F.eks.: ikke bare skriv ned en sannhetstabell uten kommentarer. Gjelder diverse oppgaver: Husk at for å motbevise noe, dvs. vise at noe ikke er sant, holder det å finne et moteksempel. Dette er et viktig poeng som mange ikke har fått med seg. F.eks. var det mange som omformet mengdene i 6(a) og forsøkte å forklare masse uten å egentlig komme i mål. Husk å bruke parenteser i logiske uttrykk og bruk dem riktig! Litt mange slurvet med dette. Angående logikkoppgaver: ikke argumenter med ord. Bruk logiske symboler og ekvivalenser! Oppgave 6:(b) det var litt rart at nesten ingen har brukt mengdelære og operasjoner på mengder. Omtrent halvparten har brukt Venndiagrammer, som er noe upresist. Den andre halvparten skrev om mengdene til logikk, som i Eksempel 11 i 2.2 i boken. Dette er selvfølgelig helt riktig, men det aller enkleste er jo å bruke mengdeoperasjoner som i løsningsforslaget og Eksempel 14 i 2.2. Oppgave 13: Her var det en del rar føring med mod. Noen skriver f.eks. meningsløse ting som mod 3... Andreas Leopold Knutsen