CS 70
Discrete Mathematics and Probability Theory
Summer 2017 Hongling Lu, Vrettos Moulos, and Allen Tang
HW 4
Sundry
Before you start your homework, write down your team. Who else did you work with on this
homework? List names and email addresses. (In ca
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
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
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
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
EECS 70
Discrete Mathematics and Probability Theory
Fall 2015
Jean Walrand
Discussion 14A Solution
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
EECS 70
Discrete Mathematics and Probability Theory
Fall 2015
Jean Walrand
Discussion 15B Solution
1. (Conditional expectation) Suppose that X and Y are independent geometric random variables with parameter
p. Suppose that n > 2 is a positive integer.
Wha
CS 70
Discrete Mathematics and Probability Theory
Fall 2015
Jean Walrand
Discussion 11A
Definition: A random variable X on a sample space is a function that assigns to each sample point
a real number X()
Definition: The distribution of a discrete random
CS 70
Discrete Mathematics and Probability Theory
Fall 2015
Jean Walrand
Discussion 12B
1. (Sanity Check!) Derive Chebyshevs inequality using Markovs inequality for random variable X.
2. (Balls and Bins Again) For this problem we toss m balls into n bins.
CS 70
Discrete Mathematics and Probability Theory
Fall 2015
Jean Walrand
Discussion 12B
1. (Sanity Check!) Derive Chebyshevs inequality using Markovs inequality for random variable X.
Answer: Were interested in the probability Pr(|X E[X]| k) = Pr(X E[X])2
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 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 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.
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
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
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