MIT 6.042J: Mathematics For Computer Science

Size: px
Start display at page:

Download "MIT 6.042J: Mathematics For Computer Science"

Transcription

1 MIT 6.042J: Mathematics For Computer Science May 2017 Contents 1 Propositions Compound Propositions Propositional Logic in Computer Programs Predicates and Quantifiers Validity Satisfiability Patterns Of Proof The Axiomatic Method Proof By Cases Proving An Implication Proving An If And Only If Proof By Contradiction Proofs About Sets Induction The Well Ordering Principle Induction Invariants Strong Induction Structural Induction Number Theory Divisibility The Greatest Common Divisor The Fundamental Theorem of Arithmetic Alan Turing Modular Arithmetic Arithmetic with a Prime Modulus Arithmetic with an Arbitrary Modulus The RSA Algorithm Graph Theory Definitions Matching Problems Coloring Getting from A to B in a Graph Connectivity Around And Around We Go Trees Planar Graphs Directed Graphs Definitions Tournament Graphs Communication Networks

2 7 Relations and Partial Orders Binary Relations Relations and Cardinality Relations On One Set Equivalence Relations Partial Orders Posets and DAGs Topological Sort Parallel Task Scheduling Dilworth s Lemma State Machines 29 9 Sums And Asymptotics The Value Of An Annuity Power Sums Approximating Sums Handing Out Over The Edge Double Trouble Products Asymptotic Notation Recurrences The Towers of Hanoi Merge Sort Linear Recurrences Divide And Conquer Recurrences A Feel For Recurrences Cardinality Rules Counting One Thing By Counting Another Counting Sequences The Generalised Product Rule The Division Rule Counting Subsets Sequences With Repetitions Counting Practice: Poker Hands Inclusion Exclusion Combinatorial Proofs The Pigeonhole Principle A Magic Trick Generating Functions Definitions And Examples Operations On Generating Functions Evaluating Sums Extracting Coefficients Solving Linear Recurrences Counting With Generating Functions Infinite Sets Injections And Bijections Countable Sets Power Sets Are Strictly Bigger Infinities In Computer Science Events And Probability Spaces Let s Make A Deal The Four Step Method Strange Dice Set Theory And Probability Infinite Probability Spaces

3 15 Conditional Probability Definition Using The Four Step Method On Conditional Probability A Posteriori Probabilities Conditional Identities Independence Definitions Independence Is An Assumption Mutual Independence Pairwise Independence The Birthday Paradox Random Variables And Distributions Definitions And Examples Distribution Functions Bernoulli Distributions Uniform Distributions Binomial Distribution Expectation Definitions And Examples Expected Return In Gambling Games Expectations Of Sums Expectations Of Products Expectations Of Quotients Deviations Variance Markov s Theorem Chebyshev s Theorem Bounds For Sums Of Random Variables Mutually Independent Events Random Walks Unbiased Random Walks Gambler s Ruin Walking In Circles

4 1 Propositions 1.1 Compound Propositions A proposition is a statement that is either true or false (a Boolean value) Notation: NOT AND OR XOR IMPLIES = IFF A truth table can help display definitions of logical terms One Variable Truth Table: Two Variable Truth Table: P P T F F T P Q P Q P Q P Q P = Q P Q T T T T F T T T F F T T F F F T F T T T F F F F F F T T A contrapositive of an implication is where adding not s and reversing the implication order is equivalent to the initial implication, e.g. P = Q Q = P The converse of an implication is just the order switched, e.g. P are not equivalent = Q and Q = P. These An implication and it s converse together are equivalent to an iff statement (P = Q) (Q = P ) P Q 1.2 Propositional Logic in Computer Programs 1.3 Predicates and Quantifiers (for all) indicates a predicate is true for every element in a set, e.g. n N. This is also called the universal quantifier (there exists) indicates the predicate is true for at least one element in a set, e.g. x D. This is also called the existential quantifier The ordering of quantifiers is not commutative (you can t freely swap the order) Euler s Conjecture: a 4 +b 4 +c 4 = d 4 has no solution when a, b, c, d are positive integers (has been proven false). Using universal quantifiers this can be written as: a, b, c, d Z + a 4 + b 4 + c 4 d 4 Four Colour Theorem: Every map can be colored with 4 colors so that adjacent regions have different colours (has been proven true) Goldbach s Conjecture: 4

5 Every even integer n greater than 2 is the sum of 2 primes. This can be written as: n Evens > 2 p, q Primes n = p + q Predicates: A predicate is a proposition whose truth depends on the value of one or more variables. A predicate is often denoted by a letter, e.g. P, and the variable passed in, e.g. P (n). However, unlike numerical functions P can only return true or false Quantifier Relationships: ( x P (x)) x P (x) ( x P (x)) x P (x) E.g. If not everyone likes pie someone doesn t like pie and, If there isn t someone who likes pie everyone doesn t like pie 1.4 Validity A propositional formula is valid when it always evaluates to true regardless of the propositional variable values that are assigned. Similarly a predicate is valid when it is true regardless of the values of its variables over any unspecified domain. An example of a valid assertion is: x y P (x, y) = y x P (x, y) Essentially because there exists an x that always make P (x, y) true, then for all y s that same x will still make it true 1.5 Satisfiability A proposition is satisfiable if some setting of the variables makes the proposition true. E.g. P Q is satisfiable because P can be true and Q can be false, causing the proposition to be true. However, P P is not satisfiable, because P can t be both true and false. The problem if deciding whether a problem is satisfiable is called SAT, and it is currently unknown whether it has a polynomial time solution. 5

6 2 Patterns Of Proof 2.1 The Axiomatic Method An axiom is a proposition that is simply accepted as true A proof is a sequence of logical deductions from axioms and previously proved statements A theorem is an important proposition A lemma is a preliminary proposition useful for proving later propositions A corollary is a proposition that follows in just a few logical steps from a lemma or theorem Most of mathematics is derived for a handful of axioms, collectively called the Zermelo-Frankel Set Theory with Choice (ZFC) Inference rules are used to prove new propositions using previously proved ones Modus Ponens: States that proof of P together with a proof that P implies Q is a proof of Q P, P = Q Q In this form, if the antecedent above line is proved, then the consequent below the line can also be considered to be proved An inference rule must be sound, which means any truth values that makes all of the antecedents true must also make the consequent true. 2.2 Proof By Cases This involves breaking a complicated proof into cases and proving each case separately, e.g. via a truth table. 2.3 Proving An Implication An implication is a proposition in the form If P, then Q Method 1: Assume P Is True: Note: Using P is false is also done, but because P being false always implies Q it s generally left out of the calculation E.g. If 0 x 2, then x 3 + 4x + 1 > 0 By factoring into x(2 x)(2 + x) + 1 > 0, showing that the each factor in the product is nonnegative, and using the axiom that the multiplication of non-negative numbers can t be negative, you can show this is true as claimed. Proofs typically begin with the word Proof end with q.e.d, or Method 2: Prove The Contrapositive Because an implication is logically equivalent to it s contrapositive (i.e. P = Q Q = P, then proving the contrapositive will prove the original statement. E.g. If r is irrational, then r is also irrational. Proof states that if r is rational, then r is rational, shown by: r = a b = r = a2 b 2 Since a 2 and b 2 are both integers, then r is rational. Therefore the proof is valid for the contrapositive, therefore it s valid for the original proposition. 6

7 2.4 Proving An If And Only If If And Only If or iff, written as P Q, means (P = Q) (Q = P ) Method 1: Prove Each Statement Implies The Other Use the methods in 2.3 for both sides Method 2: Construct A Chain Of s This involves proving P is equivalent to a second statement, which is equivalent to a third, and so on until you reach Q E.g. The standard deviation of a sequence of values x 1,..., x n is 0 iff all the values are equal to the mean. The formula for the standard deviation is: (x1 µ) σ = 2 + (x x µ) (x n µ) 2 n where µ is the mean of the values: µ. = x 1 + x x n n Proof: (x1 µ) 2 + (x x µ) (x n µ) 2 Square and multiply 0 gives 0 n = 0 (x 1 µ) 2 + (x x µ) (x n µ) 2 = 0 Since squares of real numbers are always non-negative, and it is a sum, each term must be Proof By Contradiction (x i µ) 2 = 0 x i = µ Proof by contradiction involves showing that if a proposition is false, then there would be a logical inconsistency that would mean false equals true. Since this isn t possible it means the proposition must be true. E.g. 2 is irrational. 1. Suppose that 2 is rational, this means 2 = n d where n and d are positive integers. 2. Convert n d into lowest terms. 3. Square both sides to get 2 = n2 d 2 2d 2 = n 2 4. This implies n is a multiple of 2, therefore n 2 must be a multiple of 4 5. This means 2d 2 is a multiple of 4, and so d 2 must be a multiple of 2 6. This means both the numerator and denominator has 2 as a common factor, which contradicts n d being in lowest terms 7. Therefore 2 must be irrational Proof by contradiction of P is the same as proving T rue = P by contrapositive (being P = F alse) 7

8 2.6 Proofs About Sets A set is a collection of objects, called elements, denoted by, e.g. A = {red, blue, yellow}. Sets can be finite or infinite, e.g. D = {1, 2, 4, 8, 16,...} Sets are unordered and each element either is, or is not, in a set, meaning an element doesn t appear more than once Common Sets: Symbol Set Elements The Empty Set none N Non-negative Integers {0, 1, 2, 3,...} Z Integers {..., -2, -1, 0, 1, 2,...} 1 Q Rational Numbers 2, 5 3, 16, etc. R Real Numbers π, e, 9, 2, etc. C Complex Numbers i, 19 2, 2 2i, etc. Superscript + restricts to positive elements, and - to negative elements, e.g. R + A subset ( ) is where every element of one set is also an element on another, e.g. S T. It works similar to < and, where means it contains less elements, and means they can be equal to each other The union of two sets, denoted X Y, contains all elements appearing in X or Y or both The intersection of two sets, denoted by X Y, contains only elements appearing in both sets The set difference of two sets, denoted by X Y consists of elements in the first set, but not in the second The complement of a set A over a domain D, denoted by A, is defined as the elements of D not in A, so A = D A, e.g. R + = R {0} Two sets are disjoint if they have no elements in common, so A B =. This also means A B The cardinality of a set is the number of elements in A, denoted by A The power set, denoted by P(A), is the set of all the subsets of a set, e.g. If A = {1, 2}, then P(A) = {, {1}, {2}, {1, 2}}. This means B P(A) B A. If A has n elements, then P(A) = 2 A, some authors use 2 A instead of P(A) because of this A sequence is an ordered list of objects, called terms or components, e.g. (a, b, a). The empty sequence is denoted by λ The cross product of sets are a set of sequences containing the combinations of both sets, where the first position comes from set 1, the second position from set 2, and so on. Using set builder notation involves using a predicate to define a set, e.g. A ::= {x R x 3 3x + 1 > 0} C ::= {a + bi C a 2 + 2b 2 1} Two sets are equal iff for all elements z, z X and z Y The Distributive Law For Sets states: A (B C) = (A B) (A C) ZFC Axioms: Extensionality - Two sets are equal if they have the same members ( z. (x x x y)) = x = y Pairing - For any two sets x and y, there is a set {x, y} with x and y as its only elements x, y. u. z. [z u (z = x z = y)] 8

9 Union - The union, u, of a collection, z, of sets is also a set: z. u x. ( y. x y y z) x u Infinity - There is an infinite set. Specifically, there is a non-empty set, x, such that for any set y x, the set {y} is also a member of x Subset - Given any set, x, and any proposition P (y), there is a set containing precisely those elements y x for which P (y) holds Power Set - All the subsets of a set form another set x. p. u.u x u p Replacement - Suppose a formula, φ, of set theory defines the graph of a function, that is, x, y, z. [φ(x, y) φ(x, z)] = y = z Then the image of any set, s, under that function is also a set, t. Namely, s t y. [ x. φ(x, y) y t] Foundation - There cannot be an infinite sequence... x n... x 1 x 0 of sets of which each is a member of the previous one. Essentially every non-empty set has a member-minimal element member-minimal(m, x) ::= [m x y x. y / m] x. x = m. member-minimal(m, x) Choice - Given a set, s, whose members are non-empty sets, no two of which have any element in common, then there is a set, c, consisting of exactly one element from each set in s y z w((z q w x) = v u((u w w t) (u t t y)) (u = v)) 9

10 3 Induction 3.1 The Well Ordering Principle The Well Ordering Principle states that every non-empty set of non-negative integers has a smallest element Proof: (By Contradiction) Suppose m, n Z + such the m n cannot be written in lowest terms. Let C be the set of positive integers that are numbers of such fractions. This means m C, so C is non-empty By Well Ordering there must be a smallest integer, m 0 C. For the original statement to hold it means there must be an integer n 0 > 0 such that the fraction m0 n 0 cannot be written in lowest terms. If m0 n 0 aren t in lowest terms then they must have a common factor, p > 1 Because m0 n 0 is the smallest element of C, or m0 = m0/p n, then either the numerator m 0/p 0/p < m 0, which contradicts the fact that m 0 is already in lowest terms. n 0 This means C, defined as the numerators of rationals that can t be written in lowest terms, has to be the empty set, hence there are no fractions that can t be written in lowest terms Template for Well Ordering Proofs: 1. Define the set, C, of counterexamples to P being true. C ::= {n N P (n) is false} 2. Use a proof by contradiction to assume that C is non-empty 3. By the Well Ordering Principle, there will be a smallest element, n, in C 4. Reach a contradiction - often by showing how to use n to find another member of C that is smaller than n 5. Conclude that C must be empty, that is, no counter-examples exist Theorem 3.1.1: For all non-negative integers, n: n = n(n + 1) 2 Assume the theorem is false and define some counter-examples: C ::= {n N n n(n + 1) } 2 Select the smallest counter-example (which exists due to the Well Ordering Principle), c. This means the theorem is false for n = c but true for n < c. The theorem can be shown to be true for n = 0, so c > 0 This means c 1 is a non-negative integer, and since it is less than c, the theorem holds true for c 1, being: (c 1)c (c 1) = 2 By adding c to both sides this becomes: (c 1) + c = (c 1)c 2 + c = c2 c + 2c 2 = c(c + 1) 2 This means the theorem does actually hold for c, which is a contradiction, and so C must be Theorem 3.1.2: Every natural number can be factored as the product of primes Assume the theorem is false and let C be the set of all integers greater than 1 that cannot be factored as a product of primes. 10

11 Assuming C is not empty, there is at least one element n C by Well Ordering. n can t be prime (because a prime by itself is considered a length one product of primes) So n must be a product of two integers a and b where 1 < a, b < n. Since a and b and smaller than n they can t be in C. Therefore a and b can be written as the product of primes. This means a b is the product of these to two products, which contradicts the claim that n C Therefore C must be 3.2 Induction The principle of induction: Let P (n) be a predicate. If P (0) is true, and P (n) = P (n + 1) for all non-negative integers, n Then P (m) is true for all non-negative integers, m P (0), n N. P (n) = P (n + 1) m N. P (m) Theorem 3.2.1: n(n + 1) n N n = 2 The proof by induction involves showing the base case is true, and then showing the (n + 1) case is true. For the base case P (0) = = 0 = 0 i=0 i, which is true. Proving (n + 1) is done by adding (n + 1) to both sides of the equation and simplifying: n + (n + 1) = Template for Induction Proofs: 1. State that the proof uses induction n(n + 1) 2 + (n + 1) = (n + 2)(n + 1) 2 2. Define an appropriate predicate P (n), called the induction hypothesis 3. Prove the base case, normally P (0) = P (n + 1) 4. Prove that P (n) = P (n + 1) for every non-negative integer n, called the inductive step 5. The induction principle allows you to conclude P (n) is true for all non-negative n 3.3 Invariants An invariant is a property that is preserved through a series of operations. This is used to generate proofs by showing that if the invariant is true in the initial state, and remains true throughout all operations, but it not present in the desired state, then it is impossible to get from the initial state to the desired state. E.g. A bishop on a chess board that starts on a black square and only moves diagonally has the invariant that it always lands on a black square. Therefore this shows that it s impossible to reach a goal state where the bishop is positioned on a white square. 3.4 Strong Induction Strong induction is a variation of ordinary induction where P (n + 1) depends on P (a) for all values of a < n. Let P (n) be a predicate: If P (0) is true, and for all n N, P (0), P (1),..., P (n) together imply P (n + 1) Then P (n) is true for all n N Essentially the difference is you get to assume more when trying to prove P (n + 1), which can make it easier. P (0), n N. (P (0) P (1)... P (n)) = P (n + 1) m N. P (m) 11

12 E.g. Proving every integer greater than 1 is a product of primes. Set P (n) to be that n is a product of primes. The base case of P (2) is true because 2 is a length one product of primes. By induction suppose that n 2 and that i is a product of primes for every integer i where 2 i < n + 1. Need to show P (n + 1) is also a product of primes. Cases are either n + 1 is prime (which means it s true), or n + 1 is not prime, so it must be the product of 2 non-prime integers k, m such that 2 k, m < n + 1. By strong induction you know that k is the product of primes, and m is the product of primes, therefore km is the product of primes, therefore P (n + 1) is the product of primes 3.5 Structural Induction Recursive data types are defined by base cases, which don t depend on anything else, and constructor cases, that depend on previous examples Structural induction is a method for proving that some property, P, holds for all elements of a recursively defined data type. This consists of proving P for the base cases of the definition, then proving P for the constructor cases. A recursive definition is ambiguous is it allows the same element in a data type to be constructed in more than one way. 12

13 4 Number Theory 4.1 Divisibility a b k. ak = b Where a b means a divides b. A consequence of this is that every number divides 0 The following statements about divisibility hold: a b = c. a bc a b b c = a c a b b c = s, t. c 0. a sb + tc a b ca cb Division Theorem: Let n and d be integers such that d > 0. Then there exists a unique pair of integers q and r such that: n = q d + r 0 r < d rem(a, b) gives the remainder when a is divided by b Twin Prime Conjecture: States there are infinitely many primes p such that p + 2 is also a prime. Currently is it known there are infinitely many primes p such that p + 2 is the product of at most two primes. Primality Testing: That there is an efficient way to determine whether a number is prime. In 2002 a polynomial time test was found. Factoring: Given the product of two large prime n = pq, there is no efficient way to recover the prime p and q. Current best runs in time proportional to: e 1.9(ln n)1/3 (ln ln n) 2/3 4.2 The Greatest Common Divisor The greatest common divisor is the largest number that is a divisor of both a and b, denoted by gcd(a, b) Theorem 4.2.1: gcd(a, b) is equal to the smallest positive linear combination of a and b Proof: By the Well Ordering Principle, there is a smallest positive linear combination of a and b, called m. The aim of this proof is to show gcd(a, b) m and m gcd(a, b), which means m = gcd(a, b) To show gcd(a, b) m first note that any c such that c a and c b will divide both sa and tb, as well as sa+tb for any s and t. Because the gcd(a, b) is by definition a divisor of a and b, it means gcd(a, b) sa+tb for every s and t. Because m is a linear combination, there exists an s and t such that sa + tb = m, which means gcd(a, b) m, and therefore gcd(a, b) m To show m gcd(a, b), we need to show m a and m b, so m is a common divisor, therefore m must be less than or equal to the greatest common divisor. By the Division Algorithm there exists a quotient q and remainder r such that a = q m + r where 0 r m. Because m = sa + tb, substituting in for m gives: a = q (sa + tb) + r r = (1 qs)a + ( qt)b 13

14 So r is a linear combination of a and b. Since m is the smallest positive linear combination and 0 r < m, the only possibility is that r is not positive (r = 0), which implies m a. The same process can be used to m b Properties of the Greatest Common Divisor: c : c a c b. c gcd(a, b) k > 0. gcd(ka, kb) = k gcd(a, b) gcd(a, b) = 1 gcd(a, c) = 1 = gcd(a, bc) = 1 a bc gcd(a, b) = 1 = a c gcd(a, b) = gcd(b, rem(a, b)) Euclid s Algorithm: This is the process of repeatedly applying the following equation, until the remainder is 0, to determine the greatest common divisor of larger numbers: gcd(a, b) = gcd(b, rem(a, b)) The Pulveriser: The Pulveriser involves keeping tracking of the changes made during Euclid s algorithm in order to get the full linear combination required at the end. 4.3 The Fundamental Theorem of Arithmetic Every positive integer n can be written in a unique way as a product of primes Proof: Proof is done by contradiction. Using the Well Ordering Principle assume there exists a set of positive integers that can be written as the product of primes in more than one way. Call the smallest of these integers n. Let n = p 1 p 2... p j and n = q 1 q 2... q j (two ways of factoring n into primes) p 1 n and so p 1 q 1 q 2... q k. This implies p 1 divides one of the primes q i. Since q i is a prime, then p 1 = q i Diving both sides by p 1 gives n/p 1 is a positive integer smaller than n that can also be written as the product of primes in two separate ways. This is a contradiction of the Well Ordering Principle, and so set of those type of numbers has to be empty. The Prime Number Theorem: lim x π(x) x/ ln(x) = 1 Where π(x) denotes the number of primes less than or equal to x 4.4 Alan Turing One of Turing s papers was on codes and cyphers using number theory to encrypt and decrypt information. Turing s Code - Version 1: A message is translated into integers, e.g. victory This is padded out with a few more digits to make it a prime, in this case, 13 could be added to give (which is prime) Before a message is sent, a secret key (k) is agreed upon, which is a large prime During encryption, the message (m) is multiplied by k to give the encrypted message (m ) The received decrypts this message by computing m /k = m This version has an issue when a second message is transmitted using the same key. Because you know m 1, m 2, and k are all primes, it means the greatest common divisor of m 1 and m 2 is k. This is quite straight forward to calculate (as shown in 4.2) 14

15 4.5 Modular Arithmetic Congruence: a b (mod n) n (a b) or alternatively a b (mod n) rem(a, n) = rem(b, n) Essentially congruence means the difference is divisible, or that the remainders are equivalent Congruence Rules: 1. a rem(a, n) (mod n) 2. a a (mod n) 3. a b (mod n) = b a (mod n) 4. a b (mod n) b c (mod n) = a c (mod n) 5. a b (mod n) = a + c b + c (mod n) 6. a b (mod n) = ac bc (mod n) 7. a b (mod n) c d (mod n) = a + c b + d (mod n) 8. a b (mod n) c d (mod n) = ac bd (mod n) Turing s Code - Version 2: Beforehand the sender agree on a public key p, and a secret key k which are both prime. During encryption the message m can be any integer in the set {0, 1, 2,..., p 1}. Then m = rem(mk, p) When decrypting you need to use arithmetic with a prime modulus 4.6 Arithmetic with a Prime Modulus The multiplicative inverse of a number x is x 1 such that x x 1 = 1, e.g. 3 and does not multiplicative inverse Multiplicative inverses also exist when working modulo a prime number. E.g (mod 5) So while 7 2 (mod 5), multiplying 7 by 3 makes it congruent to 1 when working with modulo 5 Lemma 4.6.1: If p is prime and k is not a multiple of p, then k has a multiplicative inverse modulo p This can be used to recover the original message in Turing s Code - Version 2: m k 1 = rem(mk, p) k 1 (mk)k 1 (mod p) m (mod p) Since m was in the range [0, p-1], then m is just the remainder when diving by p Lemma 4.6.2: Suppose p is a prime and k is not a multiple of p, then ak bk (mod p) = a b (mod p) Corollary 4.6.3: Suppose p is a prime and k is not a multiple of p, then: rem((1 k), p), rem((2 k), p),..., rem(((p 1) k), p) is a permutation of 1, 2,..., (p 1) 15

16 Fermat s Little Theorem: Suppose p is prime and k is not a multiple of p, then k p 1 1 (mod p). This also applies to all lower terms from 1 to p Arithmetic with an Arbitrary Modulus The RSA algorithm was developed in 1977 and uses arbitrary modulus arithmetic with a public key and secret key, although the secret key doesn t have to be transferred ahead of time. The Riemann Hypothesis: The formula for the sum of an infinite geometric series says: 1 + x + x 2 + x = 1 1 x Substituting x = 1 2 s, x = 1 3 s, and so on for each prime number gives a sequence of equations: Multiplying together gives: /2 s 1 1/3 s... p primes ( ) /p s = n s Riemann studied the primes using the simpler equation on the right, by regarding s as a complex number and denoting the right hand function as ζ(s). He found the distribution of primes is related to values of s for which ζ(s) = 0. This lead the his hypothesis: Every non-trivial zero of the zeta function ζ(s) lies on the line s = 1/2 + ci in the complex plane, proof of which wins the Millennium Prize Relative Primality: Integers are relatively prime iff gcd(a, b) = 1 Lemma 4.7.1: Let n be a positive integer. If k is relatively prime to n, then there exists a k 1 such that k k 1 1 (mod n). This is the same as from full primes. This allows for corollary 4.7.2: Suppose n is a positive integer and k is relatively prime to n. If ak bk (mod n), then a b (mod n) Euler s Totient Function: Euler s φ (totient) function, denoted as φ(n) is the number of relatively prime integers below a numbers, e.g. φ(7) = 6, because 1, 2, 3, 4, 5, 6 are all relatively prime to 7. φ(12) is 4, because 1, 5, 7, and 11 are the only numbers in [1, 12] that are relatively prime to 12 Theorem 4.7.4: For any number n, if p 1, p 2,..., p j are the (distinct) prime factors of n, then: ) ) ) φ(n) = n (1 (1 1p1 1p2... (1 1pj E.g. φ(300) = φ( ) = 300(1 1/2)(1 1/3)(1 1/5) = 300(1/2)(2/3)(4/5) = 80 n=1 Euler s Theorem: Suppose n is a positive integer and k is relatively prime to n, then: k φ(n) 1 (mod n) 16

17 4.8 The RSA Algorithm Beforehand: The receiver creates a public and secret key by: Generating two distinct primes p and q. Let n = pq. Select an integer e such that gcd(e, (p 1)(q 1)) = 1. The public key is the pair (e, n), which is distributed Compute d such that de 1 (mod (p 1)(q 1), which can be done using the Pulveriser. The secret key is the pair (d, n) Encoding: Given a message m, the sender first checks that gcd(m, n) = 1, then encrypts the message to produce m using the public key: m = rem(m e, n) Decoding: The receiver decrypts the message m back to m using the secret key: m = rem((m ) d, n) 17

18 5 Graph Theory 5.1 Definitions A simple graph G consists of a non-empty set V (vertices or nodes) of G, and a set E (edges) of G. G = (V, E) In simple graphs there are no self-loops, multi-edges, or directed edges, so the vertices consist of unordered pairs of edges Two vertices in a simple graph are adjacent if they are joined by an edge An edge is incident to the vertices it joins The degree of a vertex is the number of vertices adjacent to it, or equivalently, the number of edges incident to it, denoted by deg(v) A complete graph on n vertices, denoted K n, has an edge between every two vertices (for a total of n(n 1)(n 2) edges) An empty graph has no edges A line graph has n 1 edges where each vertex is connected to the edge (except for the first and last vertex) A cycle graph has all vertices connected in a ring Two graphs G 1 = (V 1, E 1 ) and G 2 = (V 2, E 2 ) are isomorphic iff there exists a bijection f : V 1 V 2 such that for every pair of vertices u, v, V 1 : u, v E 1 f(u), f(v) E2 The function f is called an isomorphism Essentially two graphs are isomorphic if they are the same after a relabeling of vertices A graph G 1 = (V 1, E 1 ) is a sub-graph of G 2 = (V 2, E 2 ) if V 1 V 2 and E 1 E 2 An edge-weighted graph or weighted graph is a graph where each edge also holds a value, called a capacity or weight An adjacency matrix can be used to represent the connections and weights of a graph, where each row and column represent a node, and a non-zero value represent the weight of a connection between them. 5.2 Matching Problems A bipartite graph is a graph together with a partition of its vertices into two sets, L and R, such that every edge is incident to a vertex is L and to a vertex in R A matching in a graph G is a set of edges such that no two edges in the set share a vertex. A matching is said to cover a set, L, iff each vertex in L has an edge of the matching incident to it A matching is said to be perfect if every node in the graph is incident to a set in the matching. In any graph, the set N(S), of neighbours of some set, S, of vertices is the set of all vertices adjacent to some vertex in S S is a bottle neck if S > N(S) Hall s Theorem: Let G be a bipartite graph with vertex partition L, R. There is a matching in G that covers L iff no subset of L is a bottleneck A bipartite graph G with vertex partition L and R where L R is degree-constrained if deg(l) deg(r) for every l L and r R Theorem: Let G be a bipartite graph with vertex partition L, R where L R. If G is degree-constrained, then there is a matching that covers L A graph is regular if every node has the same degree 18

19 Theorem: Every regular bipartite graph has a perfect matching A stable matching is a matching with no rogue couples A rogue couple is a pair of nodes in a bipartite graph that prefer each other over who they are currently connected to in a matching The Mating Ritual: This is a process for generating a stable matching for a preferential bipartite graph Steps: 1. Each morning a women stands on her balcony and a man goes to sing to the women he likes the most on his list 2. In the afternoon the women tell the man they prefer of there singers she may marry them, to the others she won t 3. Any man told no crosses that women off his list This terminates when every woman has at most one suitor The realm of possible spouses are the set of spouses with which a stable matching occurs In the mating ritual, every man gets married to his optimal spouse, and every women to her pessimal spouse 5.3 Coloring The coloring problem involves labelling vertices with colors with the constraint that adjacent vertices must get different colors. The goal is to use as few colors as possible. A color assignment with this property is called a valid coloring. A graph is k-colorable if it has a colors that uses at most k colors The chromatic number (χ(g)) is the minimum value of k for which a graph G has a valid k- coloring Theorem: A graph with a maximum degree k is at most (k + 1)-colorable 5.4 Getting from A to B in a Graph Walk: A sequence of edges such that each edge connects directly to the next edge. An edge can be traversed multiple times Path: A path is a walk where all visited vertices are different The length of a walk or path is the total number of visited vertices (the number of visited edges is always one less) For any walk of length k in a graph, there is a path of length at most k with the same endpoints. Moreover, the shortest walk between a pair of vertices is, in fact, a path. 5.5 Connectivity Two vertices are connected if there exists a path between them. By convention every vertex is connected to itself with a path with a length of 0 A graph is connected if every pair of vertices are connected A connected component is a sub-graph that is connected A k-edge connected graph requires at least k edges to be removed in order to stop being connected. This is useful for things like points of failure. Vertices can have a higher number of edge connections, but the k value for the entire graph is the minimum k value for the vertices. Menger s Theorem shows that is two vertices are k-edge connected then there are k-edge disjoint paths connecting them 19

20 Every graph with v vertices and e edges has at least v-e connected components. Every connected graph with v vertices has at least v-1 edges A build up error is a logical error that can occur in a graph when proving something using induction, by adding to the inductive assumption in the inductive step. Instead, it is always best to start with an e+1 or v+1 case, remove an edge or vertex, apply the inductive assumption, then re-add the vertex or edge back to show the inductive step. This is due to the fact that just adding an edge to a graph isn t representative of all the graphs with n+1 edges. 5.6 Around And Around We Go A closed walk is where the start and end nodes are the same A cycle is a closed walk where each vertex, apart from the first/last, are different, and the lenght is greater than or equal to 3. If a graph has any of the following properties, then it has all of them: 1. The graph is bipartite 2. The graph is 2-colorable 3. The graph doesn t contain any cycles with odd length 4. The graph doesn t contain any closed walks with odd length An Euler walk is a walk that traverses every edge exactly once An Euler tour is an Euler walk that start and finishes at the same vertex Euler founded the study of graph theory when considering a tour around the seven bridges of Konigsberg A connected graph has an Euler tour iff every vertex has an even degree A connected graph has an Euler walk iff precisely 0 or 2 nodes have an odd degree A Hamiltonian cycle is a cycle that visits every vertex exactly once A Hamiltonian path is a path that visits every vertex exactly once The travelling salesman problem is the challenge of finding the minimum weighted Hamiltonian cycle on a graph 5.7 Trees A tree is a connected, acyclic graph A forest is a graph where every connected component is a tree A leaf is a node with degree 1 in a tree Trees are often drawn with a root node leading down to lead nodes, e.g. a binary tree Every tree has the following properties: 1. Any connected sub-graph is a tree 2. There is a unique simple path between every pair of vertices 3. Adding an edge between non-adjacent nodes in a tree creates a graph with a cycle 4. Removing any edge disconnects the graph 5. If the tree has at least two vertices, then it has at least two leaves 6. The number of vertices in a tree is one larger than the number of edges The spanning tree of a connected graph is a sub-graph that is a tree connecting all vertices of the original graph The min-weight spanning tree (MST) of an edge weighted graph G is the spanning tree with the smallest possible sum of edge weights. There are two greedy algorithms for generating the min-weight spanning tree of a graph: 20

21 1. Grow a tree one edge at a time by adding the min weight edge possible whilst making sure it stays a tree 2. Grow a sub-graph one edge at a time by adding the min weight edge possible while maintaining an acyclic sub-graph Both will results in MST s, however they mightn t be the same ones 5.8 Planar Graphs A planar graph is a graph that is able to be drawn such that no edges overlap each other Planar graphs are useful for things like circuit layout and scheduling A continuous face is a region of space between edges on a planar graph The outside face is the face surrounding the graph Some faces can be defined by the cycle of vertices that surround them. When done in this way, as opposed to being defined by a region on the plane, they are called discrete faces A bridge is where a face definition requires an edge to be traversed twice Figure 1: The definition of the outside face requires c, e to be counted twice A dongle is where a face definition requires every edge to be traversed twice for the dongle Figure 2: The edges between t, v, w, x, y must all be traversed twice A planar embedding of a connected graph is the non-empty set of closed walks of the graph They are defined recursively: Base Case: If G has a single vertex, then the planar embedding has one discrete face v, which is the 0 length closed walk Constructor Case: If γ is a closed walk in G, and a and b are non-adjacent vertices, then adding an edge a, b will replace gamma with two discrete faces. This is called splitting a face 21

22 Constructor Case: If G and H are separated connected graphs, adding an edge between them will mean the planar embeddings is the union of both, except the outside faces are combined. Called adding a bridge Euler s Formula states that if a connected graph has a planar embedding, then v e + f = 2 (vertices, edges, faces) In a planar embedding of a connected graph, each edge is traversed once by two different faces, or traversed twice by one face In a planar embedding of a connected graph with at least three vertices, each face is of length at least 3 The above proofs can be combined to show for a planar graph e 3v 6. It s possible to sub in edges and vertices from a graph and see if the equality holds A minor of a graph is a graph obtained by repeatedly deleting vertices, deleting edges, or merging adjacent edges Kuratowski s Theorem: A graph is not planar iff it contains K 5 or K 3,3 as a minor K 5 is a fully connected graph with 5 nodes and 10 edges K 3,3 is a bipartite graph with 3 nodes on each side where the sides are fully connected Every planar graph has a vertex of degree at most five (meaning the graph as opposed to an individual vertex) A polyhedron is a convex, three dimensional region bounded by a finite number of polygonal faces. If faces are identical and an equal number meet at each corner then it is called a regular polyhedron, e.g. a cube Finding regular polyhedron can be treated as a planarity problem, where the polyhedron is mapped to points inside a sphere. With the previously proven theorems there ends up being only 5 possible regular polyhedra 22

23 6 Directed Graphs 6.1 Definitions A directed edge is an edge where the endpoints are distinguished, one is the head and the other is the tail. It is denoted by an ordered pair of vertices (u, v) or u v A graph with directed edges is called a directed graph or digraph. A directed graph is simple if it has no loops, i.e. u u, and no multiple edges, i.e. u v and v u The adjacency matrix for a directed graph is not necessarily symmetric Each vertex has an in degree (the number of nodes pointing to it), and an out degree (the number of nodes it points to). A node with an out degree of 0 is called a sink, and a node with an in degree of 0 is called a source Similar properties like walks, paths, and cycles still apply, with the only caveat being the one way edge exists. Note a directed graph can have cycles with length 2, unlike an undirected graph hr A directed graph is strongly connected if for every pair of vertices u, v V, there is a directed path between them A directed graph is weakly connected, if the corresponding undirected graph is connected A directed acyclic graph (DAG) is a direct graph containing no directed cycles 6.2 Tournament Graphs A tournament graph is a directed graph where every node has only one connection to every other node. Every tournament graph contains a directed Hamiltonian path. 6.3 Communication Networks The routing problem is where you have a set of packets on input nodes, and you need to route them to output nodes where the destination is a permutation of the input nodes. There is assumed to be one packet per input node. A permutation of a sequence is a reordering of the sequence, often denoted by π A complete binary tree is a structure with inputs and outputs as leafs along the bottom, and parents going up recursively connecting two child nodes each until there is only one parent node Figure 3: A binary tree with squares as inputs/outputs and circles as parent nodes Latency is the delay between input and output The diameter of a network is the maximum length of any shortest path between an input and output. E.g. for the above tree the maximum distance (defined by the number of edges traversed is 6 23

24 The switch size is the number of incoming and outgoing edges for each switch The switch count is the total number of switches used The congestion is the largest number of paths that pass through a single switch, given the best strategy used on the worst case permutation A 2d array (also called a grid or cross bar) has a structure where every input can move along and down an equal number of switches until it reaches its output. A 2d array reduces the congestion to 2, as each switch in row i, column j can encounter at most 2 packets, the one originating at input i, and the one destined for output j Figure 4: A 4x4 2d array A butterfly network takes advantage of both the binary tree and 2d array structure The switching in a butterfly network uses the binary value of the input and output nodes, moving through from left to right and switching if there is a difference, e.g. From I 3 (11) to I 0 (00), you would switch at the first point (11 vs 00), and at the second (11 vs 00) Figure 5: An 8 input/output butterfly network A Benes network involves placing two butterfly networks back to back, which while almost doubling the number of switches, reduces congestion to 1. Each Benes network of size 2N contains within it 2 Benes networks of size N. This recursive structure allows for the proof that the congestion is one by showing that adding a layer allows for getting exactly where you need 24

25 Figure 6: An 8 input/output Benes network Summary of characteristics: Figure 7: Summary of the characteristics of the networks 25

26 7 Relations and Partial Orders 7.1 Binary Relations A binary relation R : A B is a subset of A (the domain) x B (the co-domain) A relation is denoted by arb or a R b meaning (a, b) R Relations are similar to function except that you can map from 1 to many. So every function is a relation A binary relation can be displayed as a bipartite graph, with connections from the domain on the left to the co-domain on the right, where R is the set of edges. Also works for an adjacency matrix. The image of a set under a relation is a subset where a condition is met, e.g. a WHERE clause R(Y ) = {b B yrb for some y Y } where Y is a subset of the domain An inverse relation returns the domain from the co-domain, br 1 a arb. This is the same for the inverse image R 1 (x) The composition of two relations requires an intermediate value which essentially chokes down the resulting set. R : B C, S : A B then R S : A C = a(r S)c b B. (brc) (asb) The product of two relations involves multiplying the domains together and ranges together. R 1 : A 1 B 1 and R 2 : A 2 B 2 then S = R 1 R 2 means S = A 1 A 2 B 1 B 2 and (a 1, a 2 )S(b 1, b 2 ) a 1 R 1 b 1 a 2 R 2 b Relations and Cardinality A binary relation is: - surjective if every element of B is assigned to at least one element of A - total if every element of A is assigned to some element B - injective if every element of B is mapped at most once - bijective if R is total, surjective, injective and a function A function is where every element A maps to at most one element of B The cardinality of a set is the number of elements it contains, denoted by A If there is a surjection from A to B then A B If there is an injection from A to B then A B If there is a bijection between A and B then A = B If R : A B is a function, and G = (V, E) denotes R, then E A 7.3 Relations On One Set Examples includes: - Let A = N and xry x y - Let A be a set of cities and xry there exists a light between city x and city y These types of relations can be modelled using a directed graph that can contain loops Properties of R : A A relations: - Reflexive: x A. xrx. All elements are related to themselves, e.g. x x - Irreflexive: x A. xrx. No elements are related to themselves, e.g. x < x - Symmetric: x, y A. xry = yrx. If x is related to y then y is related to x 26

27 - Anti-symmetric: x, y A. (xry yrx) = x = y. If x and y are different then they can t be related to each other - Asymmetric: x, y A. xry yrx. x can t be related to itself and can only have a one-way relation to y - Transitivity: x, y, z A. (xry yrz) = xrz. If x is related to y and y to z, then x is related to z 7.4 Equivalence Relations A relation is an equivalence relation if it is reflexive, symmetric and transitive, e.g. or = An equivalence class is the set of all elements of A related to x by an equivalence relation r, denoted [x]. E.g. if A = Z and xry means x y( mod 5), then [7]={..., -3, 2, 7, 12, 17,...}. The equivalence class of all members in that set is the same A partition is a collection of disjoint, non-empty subsets A 1, A 2,..., A n whose union is A. These subsets are referred to as blocks The equivalence classes of an equivalence relation on a set A form a partition of A 7.5 Partial Orders A partial order is where a relation on a set is both transitive and anti-symmetric A weak partial order is a partial order that is also reflexive, e.g.. This is denoted by or A strong partial order is a partial order that is also irreflexive, e.g. <, denoted or Two elements are comparable if a b or b a, otherwise they are incomparable A total order is a partial order in which every pair of distinct elements is comparable 7.6 Posets and DAGs Given a partial order on a set A, the pair (A, ) is a partially ordered set or poset. In graph form G = (A, ) A poset has no directed cycles other than self-loops Given a digraph G = (V, E), then transitive closure of G is the digraph G + = (V, E + ) where E + = {u v there is a directed positive length from u to v in G} A Hasse diagram for a poset (A, ) is a digraph with vertex set A and edges minus all self loops and edges implied by transitivity 7.7 Topological Sort A topological sort of a poset (A, ) is a total order (A, π ) such that x y = x π y. Essentially its a total ordering such that none of the existing ordering criteria are breached. Every finite poset has a topological sort. The proof of this relies on proving every finite poset has a minimal element 27

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws Index absolute value, 135 141 additive identity, 254 additive inverse, 254 aleph, 465 algebra of sets, 245, 278 antisymmetric relation, 387 arcsine function, 349 arithmetic sequence, 208 arrow diagram,

More information

MATH 363: Discrete Mathematics

MATH 363: Discrete Mathematics MATH 363: Discrete Mathematics Learning Objectives by topic The levels of learning for this class are classified as follows. 1. Basic Knowledge: To recall and memorize - Assess by direct questions. The

More information

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms REVIEW QUESTIONS Chapter 1: Foundations: Sets, Logic, and Algorithms 1. Why can t a Venn diagram be used to prove a statement about sets? 2. Suppose S is a set with n elements. Explain why the power set

More information

Part IA Numbers and Sets

Part IA Numbers and Sets Part IA Numbers and Sets Definitions Based on lectures by A. G. Thomason Notes taken by Dexter Chua Michaelmas 2014 These notes are not endorsed by the lecturers, and I have modified them (often significantly)

More information

Notation Index. gcd(a, b) (greatest common divisor) NT-16

Notation Index. gcd(a, b) (greatest common divisor) NT-16 Notation Index (for all) B A (all functions) B A = B A (all functions) SF-18 (n) k (falling factorial) SF-9 a R b (binary relation) C(n,k) = n! k! (n k)! (binomial coefficient) SF-9 n! (n factorial) SF-9

More information

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Ivan Avramidi New Mexico Institute of Mining and Technology Socorro, NM 87801 June 3, 2004 Author: Ivan Avramidi; File: absmath.tex; Date: June 11,

More information

Chapter 1 : The language of mathematics.

Chapter 1 : The language of mathematics. MAT 200, Logic, Language and Proof, Fall 2015 Summary Chapter 1 : The language of mathematics. Definition. A proposition is a sentence which is either true or false. Truth table for the connective or :

More information

MATH 2200 Final Review

MATH 2200 Final Review MATH 00 Final Review Thomas Goller December 7, 01 1 Exam Format The final exam will consist of 8-10 proofs It will take place on Tuesday, December 11, from 10:30 AM - 1:30 PM, in the usual room Topics

More information

7.11 A proof involving composition Variation in terminology... 88

7.11 A proof involving composition Variation in terminology... 88 Contents Preface xi 1 Math review 1 1.1 Some sets............................. 1 1.2 Pairs of reals........................... 3 1.3 Exponentials and logs...................... 4 1.4 Some handy functions......................

More information

MATH1240 Definitions and Theorems

MATH1240 Definitions and Theorems MATH1240 Definitions and Theorems 1 Fundamental Principles of Counting For an integer n 0, n factorial (denoted n!) is defined by 0! = 1, n! = (n)(n 1)(n 2) (3)(2)(1), for n 1. Given a collection of n

More information

MATH 61-02: PRACTICE PROBLEMS FOR FINAL EXAM

MATH 61-02: PRACTICE PROBLEMS FOR FINAL EXAM MATH 61-02: PRACTICE PROBLEMS FOR FINAL EXAM (FP1) The exclusive or operation, denoted by and sometimes known as XOR, is defined so that P Q is true iff P is true or Q is true, but not both. Prove (through

More information

Review Sheet for the Final Exam of MATH Fall 2009

Review Sheet for the Final Exam of MATH Fall 2009 Review Sheet for the Final Exam of MATH 1600 - Fall 2009 All of Chapter 1. 1. Sets and Proofs Elements and subsets of a set. The notion of implication and the way you can use it to build a proof. Logical

More information

CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions

CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions CS 70 Discrete Mathematics and Probability Theory Fall 2016 Seshia and Walrand Midterm 1 Solutions PRINT Your Name: Answer: Oski Bear SIGN Your Name: PRINT Your Student ID: CIRCLE your exam room: Dwinelle

More information

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr. Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr. Chapter : Logic Topics:. Statements, Negation, and Compound Statements.2 Truth Tables and Logical Equivalences.3

More information

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes These notes form a brief summary of what has been covered during the lectures. All the definitions must be memorized and understood. Statements

More information

Massachusetts Institute of Technology 6.042J/18.062J, Fall 02: Mathematics for Computer Science Professor Albert Meyer and Dr.

Massachusetts Institute of Technology 6.042J/18.062J, Fall 02: Mathematics for Computer Science Professor Albert Meyer and Dr. Massachusetts Institute of Technology 6.042J/18.062J, Fall 02: Mathematics for Computer Science Professor Albert Meyer and Dr. Radhika Nagpal Quiz 1 Appendix Appendix Contents 1 Induction 2 2 Relations

More information

Logic. Facts (with proofs) CHAPTER 1. Definitions

Logic. Facts (with proofs) CHAPTER 1. Definitions CHAPTER 1 Logic Definitions D1. Statements (propositions), compound statements. D2. Truth values for compound statements p q, p q, p q, p q. Truth tables. D3. Converse and contrapositive. D4. Tautologies

More information

Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)}

Preliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)} Preliminaries Graphs G = (V, E), V : set of vertices E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) 1 2 3 5 4 V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)} 1 Directed Graph (Digraph)

More information

Preliminaries and Complexity Theory

Preliminaries and Complexity Theory Preliminaries and Complexity Theory Oleksandr Romanko CAS 746 - Advanced Topics in Combinatorial Optimization McMaster University, January 16, 2006 Introduction Book structure: 2 Part I Linear Algebra

More information

Reading 11 : Relations and Functions

Reading 11 : Relations and Functions CS/Math 240: Introduction to Discrete Mathematics Fall 2015 Reading 11 : Relations and Functions Instructor: Beck Hasti and Gautam Prakriya In reading 3, we described a correspondence between predicates

More information

CSE 1400 Applied Discrete Mathematics Proofs

CSE 1400 Applied Discrete Mathematics Proofs CSE 1400 Applied Discrete Mathematics Proofs Department of Computer Sciences College of Engineering Florida Tech Fall 2011 Axioms 1 Logical Axioms 2 Models 2 Number Theory 3 Graph Theory 4 Set Theory 4

More information

Part IA Numbers and Sets

Part IA Numbers and Sets Part IA Numbers and Sets Theorems Based on lectures by A. G. Thomason Notes taken by Dexter Chua Michaelmas 2014 These notes are not endorsed by the lecturers, and I have modified them (often significantly)

More information

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively 6 Prime Numbers Part VI of PJE 6.1 Fundamental Results Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively D (p) = { p 1 1 p}. Otherwise

More information

1 Basic Combinatorics

1 Basic Combinatorics 1 Basic Combinatorics 1.1 Sets and sequences Sets. A set is an unordered collection of distinct objects. The objects are called elements of the set. We use braces to denote a set, for example, the set

More information

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya BBM 205 Discrete Mathematics Hacettepe University http://web.cs.hacettepe.edu.tr/ bbm205 Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya Resources: Kenneth Rosen,

More information

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Packet #1: Logic & Proofs. Applied Discrete Mathematics Packet #1: Logic & Proofs Applied Discrete Mathematics Table of Contents Course Objectives Page 2 Propositional Calculus Information Pages 3-13 Course Objectives At the conclusion of this course, you should

More information

Mathematical Reasoning & Proofs

Mathematical Reasoning & Proofs Mathematical Reasoning & Proofs MAT 1362 Fall 2018 Alistair Savage Department of Mathematics and Statistics University of Ottawa This work is licensed under a Creative Commons Attribution-ShareAlike 4.0

More information

Beautiful Mathematics

Beautiful Mathematics Beautiful Mathematics 1. Principle of Mathematical Induction The set of natural numbers is the set of positive integers {1, 2, 3,... } and is denoted by N. The Principle of Mathematical Induction is a

More information

Propositional Logic. What is discrete math? Tautology, equivalence, and inference. Applications

Propositional Logic. What is discrete math? Tautology, equivalence, and inference. Applications What is discrete math? Propositional Logic The real numbers are continuous in the senses that: between any two real numbers there is a real number The integers do not share this property. In this sense

More information

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland

Discrete Mathematics. W. Ethan Duckworth. Fall 2017, Loyola University Maryland Discrete Mathematics W. Ethan Duckworth Fall 2017, Loyola University Maryland Contents 1 Introduction 4 1.1 Statements......................................... 4 1.2 Constructing Direct Proofs................................

More information

Tribhuvan University Institute of Science and Technology Micro Syllabus

Tribhuvan University Institute of Science and Technology Micro Syllabus Tribhuvan University Institute of Science and Technology Micro Syllabus Course Title: Discrete Structure Course no: CSC-152 Full Marks: 80+20 Credit hours: 3 Pass Marks: 32+8 Nature of course: Theory (3

More information

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes. INTEGERS PETER MAYR (MATH 2001, CU BOULDER) In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes. 1. Divisibility Definition. Let a, b

More information

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers ALGEBRA CHRISTIAN REMLING 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers by Z = {..., 2, 1, 0, 1,...}. Given a, b Z, we write a b if b = ac for some

More information

MATH 2200 Final LC Review

MATH 2200 Final LC Review MATH 2200 Final LC Review Thomas Goller April 25, 2013 1 Final LC Format The final learning celebration will consist of 12-15 claims to be proven or disproven. It will take place on Wednesday, May 1, from

More information

What can you prove by induction?

What can you prove by induction? MEI CONFERENCE 013 What can you prove by induction? Martyn Parker M.J.Parker@keele.ac.uk Contents Contents iii 1 Splitting Coins.................................................. 1 Convex Polygons................................................

More information

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is 1. Describe the elements of the set (Z Q) R N. Is this set countable or uncountable? Solution: The set is equal to {(x, y) x Z, y N} = Z N. Since the Cartesian product of two denumerable sets is denumerable,

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a k for some integer k. Notation

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand 1 Divisibility, prime numbers By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a

More information

IVA S STUDY GUIDE FOR THE DISCRETE FINAL EXAM - SELECTED SOLUTIONS. 1. Combinatorics

IVA S STUDY GUIDE FOR THE DISCRETE FINAL EXAM - SELECTED SOLUTIONS. 1. Combinatorics IVA S STUDY GUIDE FOR THE DISCRETE FINAL EXAM - SELECTED SOLUTIONS Combinatorics Go over combinatorics examples in the text Review all the combinatorics problems from homewor Do at least a couple of extra

More information

ECEN 5022 Cryptography

ECEN 5022 Cryptography Elementary Algebra and Number Theory University of Colorado Spring 2008 Divisibility, Primes Definition. N denotes the set {1, 2, 3,...} of natural numbers and Z denotes the set of integers {..., 2, 1,

More information

Proof Techniques (Review of Math 271)

Proof Techniques (Review of Math 271) Chapter 2 Proof Techniques (Review of Math 271) 2.1 Overview This chapter reviews proof techniques that were probably introduced in Math 271 and that may also have been used in a different way in Phil

More information

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel Lecture Notes on DISCRETE MATHEMATICS Eusebius Doedel c Eusebius J. Doedel, 009 Contents Logic. Introduction............................................................................... Basic logical

More information

Chapter 1. Sets and Numbers

Chapter 1. Sets and Numbers Chapter 1. Sets and Numbers 1. Sets A set is considered to be a collection of objects (elements). If A is a set and x is an element of the set A, we say x is a member of A or x belongs to A, and we write

More information

Midterm 1. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You:

Midterm 1. Your Exam Room: Name of Person Sitting on Your Left: Name of Person Sitting on Your Right: Name of Person Sitting in Front of You: CS70 Discrete Mathematics and Probability Theory, Fall 2018 Midterm 1 8:00-10:00pm, 24 September Your First Name: SIGN Your Name: Your Last Name: Your Exam Room: Name of Person Sitting on Your Left: Name

More information

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

CHAPTER 6. Prime Numbers. Definition and Fundamental Results CHAPTER 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results 6.1. Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and the only positive divisors of p are 1 and p. If n

More information

Discrete Math Notes. Contents. William Farmer. April 8, Overview 3

Discrete Math Notes. Contents. William Farmer. April 8, Overview 3 April 8, 2014 Contents 1 Overview 3 2 Principles of Counting 3 2.1 Pigeon-Hole Principle........................ 3 2.2 Permutations and Combinations.................. 3 2.3 Binomial Coefficients.........................

More information

MA Discrete Mathematics

MA Discrete Mathematics MA2265 - Discrete Mathematics UNIT I 1. Check the validity of the following argument. If the band could not play rock music or the refreshments were not delivered on time, then the New year s party would

More information

Contribution of Problems

Contribution of Problems Exam topics 1. Basic structures: sets, lists, functions (a) Sets { }: write all elements, or define by condition (b) Set operations: A B, A B, A\B, A c (c) Lists ( ): Cartesian product A B (d) Functions

More information

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations Page 1 Definitions Tuesday, May 8, 2018 12:23 AM Notations " " means "equals, by definition" the set of all real numbers the set of integers Denote a function from a set to a set by Denote the image of

More information

DISCRETE STRUCTURES AMIN WITNO

DISCRETE STRUCTURES AMIN WITNO DISCRETE STRUCTURES AMIN WITNO p h i. w i t n o. c o m Discrete Structures Revision Notes and Problems Amin Witno Preface These notes were prepared for students as a revision workbook

More information

Contents Propositional Logic: Proofs from Axioms and Inference Rules

Contents Propositional Logic: Proofs from Axioms and Inference Rules Contents 1 Propositional Logic: Proofs from Axioms and Inference Rules... 1 1.1 Introduction... 1 1.1.1 An Example Demonstrating the Use of Logic in Real Life... 2 1.2 The Pure Propositional Calculus...

More information

Mathematical Foundations of Public-Key Cryptography

Mathematical Foundations of Public-Key Cryptography Mathematical Foundations of Public-Key Cryptography Adam C. Champion and Dong Xuan CSE 4471: Information Security Material based on (Stallings, 2006) and (Paar and Pelzl, 2010) Outline Review: Basic Mathematical

More information

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2006 Contents 9 Introduction to Number Theory and Cryptography 1 9.1 Subgroups

More information

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM

8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM 8. INTRACTABILITY I poly-time reductions packing and covering problems constraint satisfaction problems sequencing problems partitioning problems graph coloring numerical problems Lecture slides by Kevin

More information

Simplification by Truth Table and without Truth Table

Simplification by Truth Table and without Truth Table Engineering Mathematics 2013 SUBJECT NAME SUBJECT CODE MATERIAL NAME MATERIAL CODE REGULATION UPDATED ON : Discrete Mathematics : MA2265 : University Questions : SKMA1006 : R2008 : August 2013 Name of

More information

1 Sequences and Summation

1 Sequences and Summation 1 Sequences and Summation A sequence is a function whose domain is either all the integers between two given integers or all the integers greater than or equal to a given integer. For example, a m, a m+1,...,

More information

Introductory Mathematics

Introductory Mathematics J MUSCAT 1 Introductory Mathematics Joseph Muscat 1999 1. What, in your opinion, is a number? Can you give a real-world example of a negative and a complex number? Are they just useful but unreal numbers?

More information

CS483 Design and Analysis of Algorithms

CS483 Design and Analysis of Algorithms CS483 Design and Analysis of Algorithms Lectures 2-3 Algorithms with Numbers Instructor: Fei Li lifei@cs.gmu.edu with subject: CS483 Office hours: STII, Room 443, Friday 4:00pm - 6:00pm or by appointments

More information

CS 360, Winter Morphology of Proof: An introduction to rigorous proof techniques

CS 360, Winter Morphology of Proof: An introduction to rigorous proof techniques CS 30, Winter 2011 Morphology of Proof: An introduction to rigorous proof techniques 1 Methodology of Proof An example Deep down, all theorems are of the form If A then B, though they may be expressed

More information

Polynomial-Time Reductions

Polynomial-Time Reductions Reductions 1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. [von Neumann 1953, Godel

More information

Logic, Sets, and Proofs

Logic, Sets, and Proofs Logic, Sets, and Proofs David A. Cox and Catherine C. McGeoch Amherst College 1 Logic Logical Operators. A logical statement is a mathematical statement that can be assigned a value either true or false.

More information

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime. PUTNAM TRAINING NUMBER THEORY (Last updated: December 11, 2017) Remark. This is a list of exercises on Number Theory. Miguel A. Lerma Exercises 1. Show that the sum of two consecutive primes is never twice

More information

School of Mathematics and Statistics. MT1003 Pure Mathematics. Handout 0: Course Information

School of Mathematics and Statistics. MT1003 Pure Mathematics. Handout 0: Course Information MRQ 2006 School of Mathematics and Statistics MT1003 Pure Mathematics Handout 0: Course Information Lecturer: Martyn Quick, Mathematical Institute, Room 210. Recommended Texts: D. M. Burton, Elementary

More information

Simplification by Truth Table and without Truth Table

Simplification by Truth Table and without Truth Table SUBJECT NAME SUBJECT CODE : MA 6566 MATERIAL NAME REGULATION : Discrete Mathematics : University Questions : R2013 UPDATED ON : June 2017 (Scan the above Q.R code for the direct download of this material)

More information

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2000 2013 Contents 9 Introduction to Number Theory 63 9.1 Subgroups

More information

MAT115A-21 COMPLETE LECTURE NOTES

MAT115A-21 COMPLETE LECTURE NOTES MAT115A-21 COMPLETE LECTURE NOTES NATHANIEL GALLUP 1. Introduction Number theory begins as the study of the natural numbers the integers N = {1, 2, 3,...}, Z = { 3, 2, 1, 0, 1, 2, 3,...}, and sometimes

More information

F 99 Final Quiz Solutions

F 99 Final Quiz Solutions Massachusetts Institute of Technology Handout 53 6.04J/18.06J: Mathematics for Computer Science May 11, 000 Professors David Karger and Nancy Lynch F 99 Final Quiz Solutions Problem 1 [18 points] Injections

More information

Discrete Mathematics Logics and Proofs. Liangfeng Zhang School of Information Science and Technology ShanghaiTech University

Discrete Mathematics Logics and Proofs. Liangfeng Zhang School of Information Science and Technology ShanghaiTech University Discrete Mathematics Logics and Proofs Liangfeng Zhang School of Information Science and Technology ShanghaiTech University Resolution Theorem: p q p r (q r) p q p r q r p q r p q p p r q r T T T T F T

More information

Week 4-5: Binary Relations

Week 4-5: Binary Relations 1 Binary Relations Week 4-5: Binary Relations The concept of relation is common in daily life and seems intuitively clear. For instance, let X be the set of all living human females and Y the set of all

More information

Propositional Logic, Predicates, and Equivalence

Propositional Logic, Predicates, and Equivalence Chapter 1 Propositional Logic, Predicates, and Equivalence A statement or a proposition is a sentence that is true (T) or false (F) but not both. The symbol denotes not, denotes and, and denotes or. If

More information

STRATEGIES OF PROBLEM SOLVING

STRATEGIES OF PROBLEM SOLVING STRATEGIES OF PROBLEM SOLVING Second Edition Maria Nogin Department of Mathematics College of Science and Mathematics California State University, Fresno 2014 2 Chapter 1 Introduction Solving mathematical

More information

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof Ch. 1.6 Introduction to Proofs The following techniques for methods of proofs are discussed in our text - Vacuous proof - Trivial proof - Direct proof - Indirect proof (our book calls this by contraposition)

More information

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II CS 5319 Advanced Discrete Structure Lecture 9: Introduction to Number Theory II Divisibility Outline Greatest Common Divisor Fundamental Theorem of Arithmetic Modular Arithmetic Euler Phi Function RSA

More information

Induction and recursion. Chapter 5

Induction and recursion. Chapter 5 Induction and recursion Chapter 5 Chapter Summary Mathematical Induction Strong Induction Well-Ordering Recursive Definitions Structural Induction Recursive Algorithms Mathematical Induction Section 5.1

More information

Set Basics. P. Danziger

Set Basics. P. Danziger - 5 Set Basics P. Danziger 1 Set Basics Definition 1 (Cantor) A set is a collection into a whole of definite and separate objects of our intuition or thought. (Russell) Such that given an object x and

More information

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald) Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald) 1 Euclid s Algorithm Euclid s Algorithm for computing the greatest common divisor belongs to the oldest known computing procedures

More information

Tutorial Obtain the principal disjunctive normal form and principal conjunction form of the statement

Tutorial Obtain the principal disjunctive normal form and principal conjunction form of the statement Tutorial - 1 1. Obtain the principal disjunctive normal form and principal conjunction form of the statement Let S P P Q Q R P P Q Q R A: P Q Q R P Q R P Q Q R Q Q R A S Minterm Maxterm T T T F F T T T

More information

Notes on counting. James Aspnes. December 13, 2010

Notes on counting. James Aspnes. December 13, 2010 Notes on counting James Aspnes December 13, 2010 1 What counting is Recall that in set theory we formally defined each natural number as the set of all smaller natural numbers, so that n = {0, 1, 2,...,

More information

CS Discrete Mathematics Dr. D. Manivannan (Mani)

CS Discrete Mathematics Dr. D. Manivannan (Mani) CS 275 - Discrete Mathematics Dr. D. Manivannan (Mani) Department of Computer Science University of Kentucky Lexington, KY 40506 Course Website: www.cs.uky.edu/~manivann/cs275 Notes based on Discrete Mathematics

More information

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide Undergraduate Notes in Mathematics Arkansas Tech University Department of Mathematics Introductory Notes in Discrete Mathematics Solution Guide Marcel B. Finan c All Rights Reserved 2015 Edition Contents

More information

Introduction to Number Theory

Introduction to Number Theory INTRODUCTION Definition: Natural Numbers, Integers Natural numbers: N={0,1,, }. Integers: Z={0,±1,±, }. Definition: Divisor If a Z can be writeen as a=bc where b, c Z, then we say a is divisible by b or,

More information

CMSC 27130: Honors Discrete Mathematics

CMSC 27130: Honors Discrete Mathematics CMSC 27130: Honors Discrete Mathematics Lectures by Alexander Razborov Notes by Geelon So, Isaac Friend, Warren Mo University of Chicago, Fall 2016 Lecture 1 (Monday, September 26) 1 Mathematical Induction.................................

More information

Part IA. Numbers and Sets. Year

Part IA. Numbers and Sets. Year Part IA Year 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004 2003 2002 2001 2017 19 Paper 4, Section I 1D (a) Show that for all positive integers z and n, either z 2n 0 (mod 3) or

More information

CMPSCI 250: Introduction to Computation. Lecture 11: Proof Techniques David Mix Barrington 5 March 2013

CMPSCI 250: Introduction to Computation. Lecture 11: Proof Techniques David Mix Barrington 5 March 2013 CMPSCI 250: Introduction to Computation Lecture 11: Proof Techniques David Mix Barrington 5 March 2013 Proof Techniques Review: The General Setting for Proofs Types of Proof: Direct, Contraposition, Contradiction

More information

Fundamentals of Pure Mathematics - Problem Sheet

Fundamentals of Pure Mathematics - Problem Sheet Fundamentals of Pure Mathematics - Problem Sheet ( ) = Straightforward but illustrates a basic idea (*) = Harder Note: R, Z denote the real numbers, integers, etc. assumed to be real numbers. In questions

More information

7. Prime Numbers Part VI of PJE

7. Prime Numbers Part VI of PJE 7. Prime Numbers Part VI of PJE 7.1 Definition (p.277) A positive integer n is prime when n > 1 and the only divisors are ±1 and +n. That is D (n) = { n 1 1 n}. Otherwise n > 1 is said to be composite.

More information

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. Chapter 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. If n > 1

More information

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics. Section 2.1 Introduction Sets are one of the basic building blocks for the types of objects considered in discrete mathematics. Important for counting. Programming languages have set operations. Set theory

More information

Models of Computation. by Costas Busch, LSU

Models of Computation. by Costas Busch, LSU Models of Computation by Costas Busch, LSU 1 Computation CPU memory 2 temporary memory input memory CPU output memory Program memory 3 Example: f ( x) x 3 temporary memory input memory Program memory compute

More information

NP and Computational Intractability

NP and Computational Intractability NP and Computational Intractability 1 Polynomial-Time Reduction Desiderata'. Suppose we could solve X in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Reduction.

More information

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...}

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...} WORKSHEET ON NUMBERS, MATH 215 FALL 18(WHYTE) We start our study of numbers with the integers: Z = {..., 2, 1, 0, 1, 2, 3,... } and their subset of natural numbers: N = {1, 2, 3,...} For now we will not

More information

Basic counting techniques. Periklis A. Papakonstantinou Rutgers Business School

Basic counting techniques. Periklis A. Papakonstantinou Rutgers Business School Basic counting techniques Periklis A. Papakonstantinou Rutgers Business School i LECTURE NOTES IN Elementary counting methods Periklis A. Papakonstantinou MSIS, Rutgers Business School ALL RIGHTS RESERVED

More information

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. 2 Arithmetic This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. (See [Houston, Chapters 27 & 28]) 2.1 Greatest common divisors Definition 2.16. If a, b are integers, we say

More information

Introduction. Foundations of Computing Science. Pallab Dasgupta Professor, Dept. of Computer Sc & Engg INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR

Introduction. Foundations of Computing Science. Pallab Dasgupta Professor, Dept. of Computer Sc & Engg INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR 1 Introduction Foundations of Computing Science Pallab Dasgupta Professor, Dept. of Computer Sc & Engg 2 Comments on Alan Turing s Paper "On Computable Numbers, with an Application to the Entscheidungs

More information

Lecture 4: Constructing the Integers, Rationals and Reals

Lecture 4: Constructing the Integers, Rationals and Reals Math/CS 20: Intro. to Math Professor: Padraic Bartlett Lecture 4: Constructing the Integers, Rationals and Reals Week 5 UCSB 204 The Integers Normally, using the natural numbers, you can easily define

More information

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2)

Algorithms and Theory of Computation. Lecture 22: NP-Completeness (2) Algorithms and Theory of Computation Lecture 22: NP-Completeness (2) Xiaohui Bei MAS 714 November 8, 2018 Nanyang Technological University MAS 714 November 8, 2018 1 / 20 Set Cover Set Cover Input: a set

More information

Out-colourings of Digraphs

Out-colourings of Digraphs Out-colourings of Digraphs N. Alon J. Bang-Jensen S. Bessy July 13, 2017 Abstract We study vertex colourings of digraphs so that no out-neighbourhood is monochromatic and call such a colouring an out-colouring.

More information

CSE 321 Solutions to Practice Problems

CSE 321 Solutions to Practice Problems CSE 321 Solutions to Practice Problems Instructions: Feel free NOT to multiply out binomial coefficients, factorials, etc, and feel free to leave answers in the form of a sum. No calculators, books or

More information

Discrete Mathematics. Benny George K. September 22, 2011

Discrete Mathematics. Benny George K. September 22, 2011 Discrete Mathematics Benny George K Department of Computer Science and Engineering Indian Institute of Technology Guwahati ben@iitg.ernet.in September 22, 2011 Set Theory Elementary Concepts Let A and

More information

CMSC Discrete Mathematics SOLUTIONS TO FIRST MIDTERM EXAM October 18, 2005 posted Nov 2, 2005

CMSC Discrete Mathematics SOLUTIONS TO FIRST MIDTERM EXAM October 18, 2005 posted Nov 2, 2005 CMSC-37110 Discrete Mathematics SOLUTIONS TO FIRST MIDTERM EXAM October 18, 2005 posted Nov 2, 2005 Instructor: László Babai Ryerson 164 e-mail: laci@cs This exam contributes 20% to your course grade.

More information