... ιντεγερκ 2 ⇒ ν = κ , ωηιχη ισεϖεν 1/25/12 More slowly … • Thm For any integer n, n2 is odd if and only if n is odd • To prove a statement of the form “P iff Q,” two separate proofs are needed: – If P ... the assertions together are abbreviated “P iff Q” or “P⇔Q” or “P ≡Q” 1/25/12 More slowly … • Thm For any integer n, n2 is odd if and only if n is odd () “If n2 is odd then n is odd” is equivalent ... (“contrapositive”) which is the same as “if n is even then n2 is even” (since n is an integer) … then n=2k for some k and n2=4k2, which is even 1/25/12 Contrapositive and converse • The contrapositive of
Ngày tải lên: 22/03/2019, 10:35
... bottom pancake Trang 9Why does this take 2n-3 flips? • For n≥2, let P(n) := “n pancakes can be sorted using 2n-3 flips” • Suppose this is false for some n • Let C = {n: P(n) is false} • C has a least ... arguing that a fraction can be reduced to “lowest terms” integer is nonempty Trang 6To prove P(n) for every nonnegative n: • Let C = {n: P(n) is false} (the set of “counterexamples”) • Assume C ... by WOP Call it m • So m pancakes cannot be sorted using 2m-3 flips and m is the smallest number for which that is the case Trang 10Why does this take 2n-3 flips? • m≠2 since one flip sorts 2 pancakes
Ngày tải lên: 22/03/2019, 10:37
Discrrete mathematics for computer science 07logic and computers
... may be hard to simplify formulas as much as possible – Any tautology is equivalent to p ⋁ ¬p so if we could easily simplify formulas we could easily determine whether a formula is a tautology ... Trang 1Logic and computersTrang 2Binary Arithmetic0 +0 0 0 +1 1 1 +0 1 1 +1 10 Only two digits: the bits 0 and 1 (Think: 0 = F, 1 = T) Trang 3Logic and Computers A half adder: ... number of bits to be added? 0 a2 b2 a1 b1 c2 c1 carryout Trang 12Simplifying Circuits• Simpler formulas turn into circuits that use less hardware! • E.g p ⋁ q ⋁ (p⋀q) is equivalent to p ⋁ q
Ngày tải lên: 22/03/2019, 10:41
Discrrete mathematics for computer science 09sets
... is contained in B” • (∀x) (x∈A ⇒ x∈B) • N ⊆ Z, {7} ⊆ {7, “Sunday”, π} • ∅ ⊆ A for any set A (∀x) (x∈∅ ⇒ x∈A) • A ⊆ A for any set A • To be clear that A ⊆ B but A ≠ B, write A ⊊ B • “Proper subset” ... Trang 1SetsTrang 2What is a Set?• Informally, a collection of objects, determined by its members, treated as a single mathematical object
Ngày tải lên: 22/03/2019, 10:45
Discrrete mathematics for computer science 10relations
... → R f(x,y) = x/y Defined for all pairs (x,y) except when y=0! 2/13/12 A Function that is “Partial,” Not Total domain f R×R codomain R f: R ×R → R f(x,y) = x/y Defined for all pairs (x,y) except ... “Size” For finite sets, a bijection exists iff A and B have the same number of elements domain A 2/13/12 f codomain B 10 Cardinality or “Size” Use the same as a definition of “same size” for infinite
Ngày tải lên: 22/03/2019, 10:47
Discrrete mathematics for computer science 11uncountable
... 1 1 Trang 11Cantor’s TheoremFor every set, A (finite or infinite) , there is no bijection A↔P(A) Trang 12There is no bijection A↔P(A)W::= {a A | a f(a)} , so for any a, a W iff a f(a) ... , for some a0 A (∀a) a f(a0) iff a f(a ) Pf by contradiction: suppose f:A↔P(A) is a bijection Let Pf by contradiction: Trang 13There is no bijection A↔P(A)W::= {a A | a f(a)} , so for ... A↔P(A)W::= {a A | a f(a)} , so for any a , a W iff a f(a) f is a bijection, so W=f(a0) , for some a0 A a f(a ) iff a f(a ) Pf by contradiction: suppose f:A↔P(A) is a bijection Let
Ngày tải lên: 22/03/2019, 10:49
Discrrete mathematics for computer science 12induction
... level Fifth level Trang 5Example Induction ProofLet’s prove: r-1 (for r ≠ 1) Trang 6Statements in magenta form atemplate for inductive proofs: • Proof: (by induction on n ) • The induction ... 1+r +r + +r = r-1 L (for r ≠ 1) Trang 7Base Case (n = 0):r - 1 = = r - 1 1 L 0+1 1+r +r + +r = r - 1 Example Induction Proof 1 OK! Trang 8• Inductive Step: Assume P ( n ) for some n ≥ 0 and prove
Ngày tải lên: 22/03/2019, 10:51
Discrrete mathematics for computer science arithmetic
... n-1 multiplications • Method 2: use successive squaring – How many times can you divide n by 2 before it is reduced to 1? – Repeated squaring requires between – Huge savings! n = 1000 => at ... multiplications • Method 2: use successive squaring – Requires about log2n multiplications • Same idea works for multiplication modulo p • Example: If n is a 500-digit number, we can compute q n (mod p) in
Ngày tải lên: 22/03/2019, 10:55
Discrrete mathematics for computer science asymptotic
... Functions3/26/12 Trang 2Asymptotic Equivalence• Def: For example, Note that n2 +1 is being used to name the function f such that f(n) = n2 +1 for every n f (n) : g(n) iff limn ... example: Stirling’s formula n! : n e ⎛ ⎝⎜ ⎞ ⎠⎟ 3/26/12 Trang 4Little-Oh: f = o(g)• Def: f(n) = o(g(n)) if lim n • For example, n2 ... So, for example, 3n2 Trang 11Rough Paraphrase• f∼g: f and g grow to be roughly equal •
Ngày tải lên: 22/03/2019, 10:59
Discrrete mathematics for computer science conditional
... are independent events iff Pr(A|B) = Pr(A) • That is, knowing whether B is the case gives no information that would help determine the probability of A • Proof: A and B independent iff Pr(A)∙Pr(B) ... probability that Santorum will be the Republican nominee? Trang 9Total ProbabilitySimple version: For any events A and B whose probability is neither 0 nor 1: That is, Pr(A) is the weighted average
Ngày tải lên: 22/03/2019, 11:14
Discrrete mathematics for computer science counting subsets
... one choice for the last So by the product rule, n ∙ (n-1) ∙ (n-2) ∙ … ∙ 2.1 = n! How Many 4-Letter Words Using Each Letter at Most Once? • • • • • • 26 choices for first letter Only 25 for second ... Letter at Most Once? • • • • • • 26 choices for first letter Only 25 for second letter 24 for third letter 23 for fourth letter So 26∙25∙24∙23 or 26!/22! Generalized Product Rule • • Let Q be a set ... |Q| = n1⋅n2⋅⋅⋅nk if n1 possible 1st elements, n2 possible 2nd elements (for each first entry), n3 possible 3rd elements (for each 1st & 2nd entry, ) then, How Many Hands with Cards? • • • • I.e.,
Ngày tải lên: 22/03/2019, 11:18
Discrrete mathematics for computer science digraphs and relations
... Trang 1Digraphs and RelationsTrang 5R is a transitive if R = G + for some digraph G transitivity Trang 8reflexivity For any digraph G, G* is reflexive Trang 9G* is the reflexive transitive ... is symmetric if a R b IMPLIES b R a Trang 14(weak) partial ordersTrang 15R is a W PO if R = D * for some DAG D weak partial orders Trang 16transitive, symmetric &reflexive equivalence relations
Ngày tải lên: 22/03/2019, 11:30
Discrrete mathematics for computer science digraphs
... Directed Graphs 3/6/12 Normal Person’s Graph y = f(x) y x 3/6/12 Computer Scientist’s Graph a b c d f e 3/6/12 Digraphs • a set, V, of vertices aka nodes a set, ... v 3/6/12 w Relations and Graphs a b d c V= {a,b,c,d} E = {(a,b), (a,c), (c,b)} 3/6/12 Digraphs Formally, a digraph with vertices V is the same as a binary relation on V 3/6/12 Walks & Paths Walk:
Ngày tải lên: 22/03/2019, 11:32
Discrrete mathematics for computer science public key crypto
... easy on a computer -about 100 digit-by-digit multiplications • What are the factors of 206085796112139733547? – Seems to require vast numbers April 25, 2012 10 Recall there’s a shortcut for computing ... it takes n steps to search through the first n possible exponents • For 500-digit numbers, we’re talking about a computing effort of 1700 steps vs 10500 steps April 25, 2012 13 Discrete logarithm ... these, and get at their meaning, he must substitute the fourth letter of the alphabet, namely D, for A, and so with the others.” April 25, 2012 Tyepmg Pic Gvctxskvetlc April 25, 2012 Public Key
Ngày tải lên: 22/03/2019, 11:50
Discrrete mathematics for computer science random variables
... X(s) = if the flip comes up heads, if it comes up tails Example: S = Harvard basketball games, and for any game s∈S, X(s) = if Harvard wins game s, if Harvard loses These are examples of Bernoulli ... games, X(s) = number of points player LR scored in game s Probability Mass Function • • • • • For any x∈T, Pr({s∈S: X(s) = x}) is a well defined probability (Min 0, max 1, sum to over all possible
Ngày tải lên: 22/03/2019, 11:52
Discrrete mathematics for computer science recurrences
... from numbers to numbers in terms of the value of the same function for smaller arguments • Eg Fibonacci: – F0 = 0, F1 = 1, and for n>1, – F n = F n-1 +F n-2 Trang 3A note on Fibonacci• Incredibly, ... conquer• Determine whether an item x is in a sorted list L by binary search • For convenience assume list L has 2 n elements for some n • Algorithm: – If L is of length 1, check to see if the unique ... length 2 n+1 where n ≥ 0, compare x to L[2 n ] – If x≤L[2 n ] then search for x in L[1 2 n ] – If x>L[2 n ] then search for x in L[2 n +1 2 n+1 ]. Trang 8• Let Dn = # of comparison steps to find
Ngày tải lên: 22/03/2019, 11:58
Discrrete mathematics for computer science series
... of a Geometric Series• What is • Method 1: Prove by induction that for every n≥0, • And then make some argument about the limit as n →∞ to conclude that the sum is 2 Trang 3Sum of a Geometric ... of 31 books you get 2 book lengths off the table!And there is no limit to how far the stack can extend! 3/22/19 http://mathforum.org/advanced/robertd/harmonic.html Trang 22FINIS ... center of gravity = (1+2+2½)/3 = 1⅚ from right end Trang 18The Harmonic Series Diverges• Let Then for any n, • Doubling the number of terms adds at least ½ to the sum • Corollary The series diverges,
Ngày tải lên: 22/03/2019, 12:02
Discrrete mathematics for computer science statistics
... average: • For example, X = 1, 3, 2, 4, 1, 4, 1 , then μX=16/7 • Note that the mean need not be one of the data values. • We might as well write this as E[X] following the notation used for random ... way, even though neither is exactly a function of the other • For example, height and weight of people Height Weight Trang 10Covariance for Random Variables• Roll two dice Let X = larger of the two ... 1Probability and StatisticsTrang 2Probability vs Statistics• In probability, we build up from the mathematics of permutations and combinations and set theory a mathematical theory of how outcomes
Ngày tải lên: 22/03/2019, 12:06
concrete mathematics a foundation for computer science phần 4 ppsx
... coefficientsgives a formula that we can sum on k:The sum over all integers j is zero, by (5.24) Hence -S, is the sum for j < 0 To evaluate -S, for j < 0, let’s replace j by -k - 1 and sum for k 3 0: ... k)‘s we like: For example, here’s how the row for n = 4 can be computed: The two right-most entries are obvious-there’s just one way for all hats to land correctly, and there’s no way for just three ... thatformal infinite sums of the form tk3,, (Xkzk form a field, if the coefficients ak lie in a field We can add, subtract, multiply, divide, differentiate, and dofunctional composition on such formal
Ngày tải lên: 14/08/2014, 04:21
concrete mathematics a foundation for computer science phần 5 pps
... other formula, (6.87), gives us an almost miraculous closed form for infinitely many infinite sums: Formula (6.89) is not only a closed form for HE), it also tells us the approx-imate size of Bzn, ... a few things.For one, kim’ isn’t a polynomial if j = 0; so we will need to split off that termand handle it separately For another, we’re missing the term k = 0 from theformula for nth difference; ... remarkable formula for zcot z was found by Euler (exercise 73): zcotz = l-2tTg We can expand Euler’s formula in powers of z2, obtaining . Equating coefficients of zZn with those in our other formula,
Ngày tải lên: 14/08/2014, 04:21