New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

CS 2100 Class Notes Week 4

by: Nick

CS 2100 Class Notes Week 4 CS 2100

Marketplace > University of Utah > Computer science > CS 2100 > CS 2100 Class Notes Week 4
The U
GPA 3.78

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Proofs, Pigeon Hole principle, proof by induction, review for the quiz
Discrete Structures
Zvonimir Rakamaric
Class Notes
Discrete math, logic, proofs
25 ?




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)


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


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'

Why people love StudySoup

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."

Allison Fischer University of Alabama

"I signed up to be an Elite Notetaker with 2 of my sorority sisters this semester. We just posted our notes weekly and were each making over $600 per month. I LOVE StudySoup!"

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.