CS 2100 Class Notes Week 4
CS 2100 Class Notes Week 4 CS 2100
Popular in Discrete Structures
Popular in Computer science
This 5 page Class Notes was uploaded by Nick on Friday September 16, 2016. The Class Notes belongs to CS 2100 at University of Utah taught by Zvonimir Rakamaric in Winter 2016. Since its upload, it has received 11 views. For similar materials see Discrete Structures in Computer science at University of Utah.
Reviews for CS 2100 Class Notes Week 4
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 09/16/16
CS 2100 9-13-16 today’s material is on the quiz everything up to and not including induction is on the quiz no notes or book on the quiz quiz review plan is to review the solutions to practice quiz and then other problems. May not last 2 hours. It is not a replacement for office hours when do proof by cases, can you reuse cases, yes, but rarely possible. pidgeon hole principle 9 tennis balls distributed evenly to 4 players 2 2 2 3 at least one player must have 3 balls m*n+1 objects n containers There exists a container with at least m+1 objects. n=4 m*n+1=9 = m*4+1=9 m=3 Ex: any 4 integers in Z+ some pair has a difference divisible by 3 2 1 1 one box for each possible remainder. each integer needs to map to exactly 1 box. prove that remainder =0 n=3K+r m=3L+r [2 numbers that have the same remainder] n-m=3K+r-3L-r=3(K-L) x=K-L [closure] n-m=3*x+0 done It doesn’t matter what the remainder of the pair is, the answer is the same. EX: for any 11 positive integers, some pair must have a difference divisible by 10 11=m*n+1 10 containers 11=m*10+1 m=1 m+1=2 so, there must be at least one pair prove that remainder =0 n=10K+r m=10L+r [2 numbers that have the same remainder] n-m=10K+r-10L-r=10(K-L) x=K-L [closure] n-m=10*x+0 done pigeonhole principle is similar to the remainder but if the remainder is not 1, then it gets better, more options, not worse. It is about describing the worst case. Coming up with the number of boxes is an art with no mechanics to it, just a hunch or luck? Pg 147 #34 a Example of proof by contradiction Pg 147 #12 A is rational, b is irrational then a+b is irrational Cex: a=x/y [ def of rational] a+b= p/q [ counterexample] ... B= k/l [so rational, disproving counterexample] -- 9-15-16 review tonight here quiz is on tues pigeon hole will be on quiz 2 it is harder than practice we are behind the schedule by a day he is leaving the hardest thing for last proof by induction: used a lot in CS used to generalize info about a few integers to all integers trying to prove: for all n element of positive integers, P(n) 1) base case: show p(1) == holds 2) inductive step: (if holds for one then holds for the other) 3) ifP(n-1)== holds 4) 1 2 … n n+1… P(1) → P(2)--> P(n) … can think of it as dominos, if push down the base case and if n-1 falls then n falls, then they all will fall. EX: for all positive integers n, P(n) is sum (from 1 to n) =(n(n+1))/2 1+2+3+...+n-1+n base case: P(1)=sum (from 1 to 1) =(1(1+1))/2 =1 inductive step: if P(n-1) then P(n) P(n-1)= sum (from 1 to n-1) =(n-1)(n-1+1))/2 try to write P(N) in a recursive way P(n-1) + n =P(n) express P(n) in terms of P(n-1) P(n)=((n-1)n)/2+n=(n(n+1))/2 = P(n) done QED EX: for all n element positive integer, S(n)=K(n) where S(n)=1+3+5+...+(2n-1) and K(n)=n^2 base case: S(1)=sum(1 to 1) (2*1-1)=1 K(1)=1^2=1=1 if sum(1 to n)(2*i-1)=n^2 then sum(1 to n+1)(2*i-1)=(n+1)^2 sum(1 to n+1)(2*i-1)= sum(1 to n) (2*i-1)+(2(n+1)-1)= n^2+2n+2-1= (n+1)^2 done assume that P(n) holds and then prove that P(n+1) holds could also do it without sum notation if base case doesn’t hold then it is a counterexample and doesn’t hold in this class we will not be layering strategies on each other, but is is valid logic. page 122 #8m base case: sum(1 to 1) (1/(1(1+1))=1/(1+1) for 1 >=1 =½ inductive case: if sum(1 to n) (1/(i(i+1))=n/(n+1) for n >=1 then sum(1 to n+1) (1/(i(i+1))=(n+1)/(n+1+1) for (n+1) >= 1 sum(1 to n+1) (1/(i(i+1))=sum(1 to n) (1/(i(i+1))+/((n+1)(n+2))=(n+1)/(n+2) Done -- review 1,3,7,15,31,63 2^n-1 An=A(n-1)+1 will be questions about the implication (p-->q)-->-r=-rV(p^q) p q r -R left right T T T T F T F T T need to put all the columns or every step. should say why equivalent from the truth table. need to know the truth table of AND, OR, NOT, →, … prove (x→ y)V(-x→-y) use p→ q = -pVq = (-xVy)V(-(-x)V-y) = (-xVy)V(xV-y) = (-xV(yV(xV-y)) = (-xV(yV(-yVx)) = -xV((yV-y)Vx) = (-xV(tVx) = -xVt = t n^2+n+1 is odd n is even there exists k, n, and m that is an integer, n=2k [def of even] n^2+n+1 (2k)^2+2k+1 2(2k^2+k)+1 m=2k^2+k [closure] 2m+1 done for all x, r in R !=0 if(x is irrational ^ r is irrational) → x*r is irrational contradiction: x is irrational ^ r is rational ^ x*r is set of rational r is rational and x*r is rational there exists a, b, c, d as integers r=a/b and x*r=c/d where b!= 0 and d != 0 [def of Q] x*a/b=c/d x=(c*b)/(d*a) = e/f [closure] so x is rational if only make one assumption and follow valid logic there on out, and if conclude a contradiction, then the assumption must be wrong. p-->q = contrapositive: -q→-p contradiction: -(p-->q) = (p^-q)
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'