EECS 70
Discrete Mathematics and Probability Theory
Fall 2014
Anant Sahai
Homework 3
This homework is due September 22, 2014, at 12:00 noon.
1. Propose-and-Reject Lab
In this weeks Virtual Lab, we will simulate the traditional propose-and-reject algorithm
EECS 70
Discrete Mathematics and Probability Theory
Fall 2014
Anant Sahai
Homework 5
This homework is due October 6, 2014, at 12:00 noon.
1. Modular Arithmetic Lab (continue)
Oystein Ore described a puzzle with a dramatic element from Brahma-Sphuta-Siddha
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and Ye
HW 3
Due Monday July 11 at 1:59PM
1. (12 points: 3/3/6) Planar Graph
A simple graph is triangle-free when it has no simple cycle of length three.
(a) Prove for any connecte
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and Ye
HW 4
Due Monday July 18 at 1:59PM
1. Sample Space and Events (1/1/1/1/1/1/2/2 points)
Consider the sample space of all outcomes from flipping a coin 3 times.
(a)
(b)
(c)
(d
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and Ye
Discussion 5D
1. Chebyshevs Inequality
using Markov Inequality Pr[X ] E[X] .
(a) Derive the Chebyshevs Inequality Pr[|X | ] Var(X)
2
Refer to Lecture Note 14 Page 2 and 3.
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and Ye
Discussion 4B Sol
1. Birthdays
Suppose you record the birthdays of a large group of people, one at a time until you have found a match,
i.e., a birthday that has already be
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and Ye
Discussion 4A Sol
1. Counting and Probability Practice
1. A message source M of a digital communication system outputs a word of length 8 characters, with the
characters dr
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and Ye
Discussion 5A Sol
Definition: A random variable X on a sample space is a function that assigns to each sample point
a real number X()
Until further notice, well restrict o
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and Ye
Discussion 4D Sol
1. Boy or Girl?
The following are variants of the famous boy or girl paradox.
Note: For both parts, assume that the probability of a boy or girl being bor
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and Ye
Discussion 5B Sol
1. Will I Get My Package?
A deceitful delivery dude is out transporting n packages to n customers. Not only does he hand a random
package to each customer
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and Ye
Discussion 4C Sol
1. This is Potpourri
1. Out of 1000 computer science students, 400 belong to a club (and may work part time), 500 work part
time (and may belong to a club
EECS 70
Fall 2015
Discrete Mathematics and Probability Theory
Jean Walrand
Discussion
15B
1. (Conditional expectation) Suppose that X and Y are independent geometric random variables with parameter
p. Suppose that n > 2 is a positive integer.
What is E(X
EECS 70
Fall 2015
Discrete Mathematics and Probability Theory
Jean Walrand
Discussion
14A
1. (Covariance) We have a bag of 5 red and 5 blue balls. We take two balls from the bag without replacement.
Let X1 and X2 be indicator random variables for the firs
EECS 70
Fall 2015
Discrete Mathematics and Probability Theory
Jean Walrand
Discussion
10a
1. A roulette of apples You bought 20 apples at your local farmers market. Due to the organic nature of the
apples, they are infested with worms. In particular, each
Pre-Lecture
Today.
Gauss and Induction
Child Gauss: (n N)(ni=1 i =
First homework party tonight: 6-9pm Cory 521!
2. Homework 1 is due Thursday 10pm (with an additional one-hour
buffer period).
Check Gradescope today to see if you have access to the
course
CS70 - Lecture 6
Administration
Review of L5
Graphs: Coloring; Special Graphs
1. Review of L5
2. Planar Five Color Theorem
I
3. Special Graphs:
I
I
Trees: Three characterizations
Hypercubes: Strongly connected!
I
Definitions: graph, walk, tour, path, cycl
EECS 70
Discrete Mathematics and Probability Theory
Fall 2014
Anant Sahai
Homework 4
This homework is due September 29, 2014, at 12:00 noon.
1. Modular Arithmetic Lab
In Python, you can perform many common modular arithmetic operations. For example, the m
lab2sol
EECS 70
September 11, 2014
1 Virtual Lab 2 Solution: Logic and Quantiers
EECS 70: Discrete Mathematics and Probability Theory, Fall 2014
Due Date: Monday, September 15th, 2014 at 12pm
Instructions:
Complete this lab by lling in all of the require
VirtualLab5Solution:ChineseRemainderTheoremand
Euler'sTheorem
EECS70:DiscreteMathematicsandProbabilityTheory,Fall2014
DueDate:Monday,October6th,2014at12pm
Instructions:
Completethislabbyfillinginalloftherequiredfunctions,markedwith" O R C D H R "
YU OE EE
lab4sol
EECS 70
September 25, 2014
1 Virtual Lab 4 Solution: Modular Arithmetic and Primality Testing
EECS 70: Discrete Mathematics and Probability Theory, Fall 2014
Due Date: Monday, September 29th, 2014 at 12pm
Instructions:
Complete this lab by lling
Today.
Secret Sharing.
Polynomials
A polynomial
P(x) = ad x d + ad1 x d1 + a0 .
Share secret among n people.
Polynomials.
Secrecy: Any k 1 knows nothing.
Roubustness: Any k knows secret.
Efficient: minimize storage.
Secret Sharing.
is specified by coeffic
Today
Review for Midterm.
First there was logic.
A statement is a true or false.
Statements?
3 = 4 1 ? Statement!
3 = 5 ? Statement!
3 ? Not a statement!
n = 3 ? Not a statement.but a predicate.
Predicate: Statement with free variable(s).
Given a value fo
Today.
Strengthening: need to.
Strenthening: how?
Theorem: For all n 1, ni=1 i12 2. (Sn = ni=1 i12 .)
Base: P(1). 1 2.
Ind Step: ki=1 i12 2.
S(k + 1) = Sk + (k +11)2
ki =+11 i12
Couple of more induction proofs.
Stable Marriage.
2 f (k) + (k +11)2 By ind.
Lecture 5: Graphs.
Konigsberg bridges problem.
Graphs: formally.
Can you make a tour visiting each bridge exactly once?
B
A
C
B
A
C
Konigsberg bridges by Bogdan Giusca - License.
Graphs!
Euler
Definitions: model.
Fact!
Euler Again!
Planar graphs.
Euler Ag
Lecture 7. Outline.
1. Modular Arithmetic.
Clock Math!
2. Inverses for Modular Arithmetic: Greatest Common Divisor.
Division!
3. Euclids GCD Algorithm.
A little tricky here!
Clock Math
If it is 1:00 now.
What time is it in 2 hours? 3:00!
What time is it i
CS70: Lecture 2. Outline.
Quick Background and Notation.
Integers closed under addition.
Today: Proofs!
a, b Z = a + b Z
1. By Example.
a|b means a divides b.
2. Direct. (Prove P = Q. )
2|4? Yes!
3. by Contraposition (Prove P = Q)
7|23? No!
4. by Contradi
70: Discrete Math and Probability.
Admin.
Instructor/Admin
Course Webpage: inst.cs.berkeley.edu/~cs70/sp16
Explains policies, has homework, midterm dates, etc.
Programming Computers Superpower!
What are your super powerful programs doing?
Logic and Proofs
CS 70
Discrete Mathematics and Probability Theory
Fall 2015
Jean Walrand
Discussion 12A
1. (Sanity Check!) Prove or give a counterexample: for any random variables X and Y , Var[X + Y] =
Var[X] + Var[Y].
2. (Bernoulli and Binomial Distribution) A random v
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and YeDiscussion templateC Sol
1. Woah There is a simple rule to test if a number n is divisible by 11: if the difference between the sum of
the odd numbered digits of n (1st, 3rd
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Psomas, Dinh an Ye
Discussion 7A
1. Gamblers Ruin
Suppose that a gambler starts playing a game with an initial amount of money i, where 0 < i <= N. The
game is turn based, where at the end of e
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and Ye
Discussion 6C
1. Woah There is a simple rule to test if a number n is divisible by 11: if the difference between the sum of
the odd numbered digits of n (1st, 3rd, 5th.) an
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Psmoas, Dinh and Ye
Discussion 4A
1. Baby Fermat
Assume that a does have a multiplicative inverse (mod m). Let us prove that its multiplicative inverse can
be written as ak (mod m) for some k 0
CS 70
Discrete Mathematics and Probability Theory
Summer 2016 Dinh, Psomas, and Ye
Discussion 7D Sol
1. Roots
Lets make sure youre comfortable with thinking about roots of polynomials in familiar old R. For all of
these questions, take the context to be R